README.md

Find benefits and services

The setup documentation can be found below. If you'd like to contribute to the project, we have more detailed documentation regarding our tech choices here: doc.

Environment variables

These need to be set on the production service for the app to function correctly.
Some are also required for testing. You will also need some of these set for local development
(at the very least, you should have AIRTABLE_READ_KEY and GOOGLE_MAPS_KEY).
Contact other developers on the project for what values we're currently using.

Variable

Use

Where

AIRTABLE_READ_KEY

load data (benefits / translations / etc) from Airtable

production / locally

AIRTABLE_WRITE_KEY

write feedback form data to Airtable

production

AIRTABLE_BASE_KEY

This tells the app which Airtable base to pull data from. If it is not set, the CDS master base will be used

production / locally

GOOGLE_MAPS_KEY

do Google Maps queries on the map page

production / locally / CircleCI

SENTRY_DSN

save browser errors to Sentry

production

GA_UA

track app usage with Google Analytics for VAC

production

GA_UA_CDS

track app usage with Google Analytics for CDS

production

GITHUB_PUBLIC_ACCESS_TOKEN

gather data from GitHub for the stats page

production

WEBHOOK_URL

Sends slack deployment notifications

production

BROWSERSTACK_USERNAME

run tests on Windows via BrowserStack

locally

BROWSERSTACK_ACCESS_KEY

run tests on Windows via BrowserStack

locally

Note that CDS docker images are public, so you should not put any sensitive (ie write) keys in the docker image.

Adding a new environment locally (OS X)

In the terminal, run: nano ~/.bash_profile (or nano ~/.zshrc if you're using the zsh shell)

Add the following line: export GOOGLE_MAPS_KEY="foo"

[ctrl] + x, and type y to save

source ~/.bash_profile (or source ~/.zshrc)

echo $GOOGLE_MAPS_KEY to make sure it is set

Adding a new environment locally (Windows 7)

Example setup:
Variable Name = AIRTABLE_READ_KEY
Contact other developers on the project for what values we're currently using.
restart Command Prompt, echo %AIRTABLE_READ_KEY% to check if value is setup properly

Adding a new environment variable to the source code

To add a new ENV variable to the source code, take the following steps:

Add the ENV variable to Heroku through their web interface.
It will need to be added to any production apps as well as the app that the pull request reviews are based on, namely
vac-poc-staging. Go to the apps, then the Settings tab, then "Reveal Config Vars"
and set the variable.

yarn install (While in project main directory, takes a while, especially on building packages)

yarn dev (run while CD'd in project folder used to start the local server)

If you run into syntax errors chances are there are missing packages/dependencies and you may want to try
running a clean yarn install. Delete Node_modules folder and then re run yarn install in the main folder.