Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

Latest commit

 

History

History
84 lines (54 loc) · 1.32 KB

CONTRIBUTING.md

File metadata and controls

84 lines (54 loc) · 1.32 KB

Running it locally

Cloning

For Go projects to work they have to be cloned on the right places.

Let's assume ~/Code/Go as our default Go projects folder.

So:

git clone git@github.com:caarlos0/watchub.git
cd watchub

Dependencies

Now, install Go 1.11+ and run:

make setup

To install the other project's dependencies.

Linting

Just run:

make lint

Running the tests

Just run:

make test

Database setup

Start up postgres and run:

createdb watchub
for sql in ./migrations/*; do psql watchub -f $sql; done

Tunnel with ngrok

To test the entire flow, you'll need to install ngrok.

Install it, then just run:

ngrok http 3000

Then, create an application on github.

Fill it like this:

  1. Application name: Watchub dev
  2. Homepage URL: the ngrok http forwarding URL, e.g. https://6f7ca783.ngrok.io
  3. Application description: empty
  4. Authorization callback URL: same as homepage url, but with a /login/callback suffix. e.g.: https://6f7ca783.ngrok.io/login/callback

GitHub will then give you a Client ID and a Client Secret.

Export them like this:

export GITHUB_CLIENT_ID="your client id"
export GITHUB_CLIENT_SECRET="your client secret"

And then just run the app:

go run main.go