Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added frontend .env file samples and guidance. #11

Merged
merged 1 commit into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions docs/configuration/choose-and-configure-docker-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,24 @@ A "local" deployment is deployed on your personal computer and is not meant to b
don't need to configure anything, just follow the quick start guide above to get up and running with a local deployment
without needing any further configuration.

#### Customize Settings
#### Setup .env Files

##### Backend

After cloning this repo to a machine of your choice, create a folder for your environment
files in the repo root. You'll need `./.envs/.local/.django` and `./.envs/.local/.postgres` Use the samples in `./documentation/sample_env_files/local` as guidance. NOTE, you'll need to replace the placeholder passwords and users where noted, but, otherwise, minimal config should be required.
files in the repo root. You'll need `./.envs/.local/.django` and `./.envs/.local/.postgres`
Use the samples in `./documentation/sample_env_files/local` as guidance.
NOTE, you'll need to replace the placeholder passwords and users where noted, but, otherwise, minimal config should be
required.

##### Frontend

In the `./frontend` folder, you also need to create a single .env file which holds your configurations for your login
method as well as certain feature switches (e.g. turn off imports). We've included a sample using auth0 and
another sample using django's auth backend. Local vs production deployments are essentially the same, but the root
url of the backend will change from localhost to whereever you're hosting the application in production.

#### Build the Stack

Once your .env files are setup, build the stack using docker-compose:

Expand Down
3 changes: 3 additions & 0 deletions docs/sample_env_files/frontend/local/django.auth.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REACT_APP_USE_AUTH0=false
REACT_APP_USE_ANALYZERS=true
REACT_APP_ALLOW_IMPORTS=true
7 changes: 7 additions & 0 deletions docs/sample_env_files/frontend/local/with.auth0.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
REACT_APP_APPLICATION_DOMAIN=
REACT_APP_APPLICATION_CLIENT_ID=
REACT_APP_AUDIENCE=http://localhost:3000
REACT_APP_API_ROOT_URL=http://localhost:8000
REACT_APP_USE_AUTH0=true
REACT_APP_USE_ANALYZERS=true
REACT_APP_ALLOW_IMPORTS=true
3 changes: 3 additions & 0 deletions docs/sample_env_files/frontend/production/django.auth.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REACT_APP_USE_AUTH0=false
REACT_APP_USE_ANALYZERS=true
REACT_APP_ALLOW_IMPORTS=true
7 changes: 7 additions & 0 deletions docs/sample_env_files/frontend/production/with.auth0.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
REACT_APP_APPLICATION_DOMAIN=
REACT_APP_APPLICATION_CLIENT_ID=
REACT_APP_AUDIENCE=http://localhost:3000
REACT_APP_API_ROOT_URL=[your open contracts backend url]
REACT_APP_USE_AUTH0=true
REACT_APP_USE_ANALYZERS=true
REACT_APP_ALLOW_IMPORTS=true