Skip to content

Configuring Server

Alanna Scott edited this page Sep 6, 2019 · 4 revisions

To run the server you will need to populate your .env file. If you are working on the Participedia team, the team lead will give you a valid .env file through a private channel.

USER=`whoami`

# These are used to validate Auth0 tokens
export AUTH0_CLIENT_ID=YOUR_AUTH0_CLIENT_ID
export AUTH0_CLIENT_SECRET=YOUR_AUTH0_CLIENT_SECRET
# these are used to sign the AWS ElasticSearch request
export AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY
export AWS_REGION=us-east-1
export BEARER_TOKEN=YOUR_AWS_BEARER_TOKEN

export DATABASE_URL=postgres://${USER}@localhost:5432/participedia
export DATABASE_TEST_URL=postgres://${USER}@localhost:5432/participedia-test

export AWS_UPLOADS_URL="https://s3.amazonaws.com/uploads.participedia.xyz/"
export AWS_UPLOADS_S3_BUCKET="http://uploads.participedia.xyz.s3-website-us-east-1.amazonaws.com/"
export AUTH0_DOMAIN=participedia.auth0.com
export GOOGLE_MAPS_API=YOUR_GOOGLE_MAPS_API_KEY
export ASSETS_URL=http://assets.participedia.xyz.s3-website-us-east-1.amazonaws.com/

export TESTLOCAL=true

Populate these values into your local environment with . .env (if you use zsh instead of bash use source .env instead).

Start the server using npm start and in another terminal window use npm run watch to bundle and watch the JS files.

Assuming everything so far has worked, you should be able to load the page locally now and these URLs should work:

If any step here fails, please contact @dethe to get it working, otherwise you can go on to Paths

Clone this wiki locally