yarn 0.18+ must be present on your machine.
$ yarn
- Linux (e.g. Ubuntu): https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
- macOS: https://docs.docker.com/docker-for-mac/install/
- Windows: https://docs.docker.com/docker-for-windows/install/
docker run -p 5432:5432 -d postgres
$ yarn db:init
Note: this will also work for wiping the DB clean when needed.
$ yarn watch
$ yarn start
Backend is now listening on port 3888 (or $PORT
if set)
# Get URL from e.g. Heroku dashboard
$ DATABASE_URL=postgres://user:pass@hostname/dbname yarn register:admin
Set environment variables using:
$ heroku config.set ENV_VAR=[value]
We recommend creating a .env file in the root of the repository. Change directory to the repository root and simply:
$ cat ENV_VAR=[value] >> .env
Backend will refuse to run if NODE_ENV=production and this is not set:
SECRET=[secret-string]
Recommendation for generating [secret-string]
:
$ node -e "console.log(require('crypto').randomBytes(256).toString('base64'));"