Skip to content

Commit 1242788

Browse files
authored
Docs: update env vars + dev container instructions
1 parent 15f6412 commit 1242788

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

README.md

+17-19
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ For a more detailed explanation of this project's key concepts and architecture,
4545
- [Docker](https://www.docker.com/) - Containers for api and db
4646
- [Heroku](https://heroku.com) - Build, deploy and operate staging and production apps
4747
- [GitHub Actions](https://github.com/features/actions) - CI pipeline
48-
- Swagger - API documentation
4948

5049
## Local development
5150

@@ -59,16 +58,22 @@ For a more detailed explanation of this project's key concepts and architecture,
5958

6059
**Recommended for Visual Studio & Visual Studio Code users.**
6160

62-
This method will automatically install all dependencies and IDE settings in a Dev Container (Docker container) within Visual Studio Code. Simply clone this repo to your computer, open in Visual Studio Code, and select "Re-open in Container" when notified.
61+
This method will automatically install all dependencies and IDE settings in a Dev Container (Docker container) within Visual Studio Code.
6362

64-
After re-opening VS Code in a dev container, develop as you normally would and use the container terminal within VS Code. Next, [configure your environment variables](#configure-environment-variables).
63+
Directions for running a dev container:
64+
1. Meet the [system requirements](https://code.visualstudio.com/docs/devcontainers/containers#_system-requirements)
65+
2. Follow the [installation instructions](https://code.visualstudio.com/docs/devcontainers/containers#_installation)
66+
3. [Check the installation](https://code.visualstudio.com/docs/devcontainers/tutorial#_check-installation)
67+
4. After you've verified that the extension is installed and working, click on the "Remote Status" bar icon and select
68+
"Reopen in Container". From here, the option to "Re-open in Container" should pop up in notifications whenever opening this project in VS.
69+
5. [Configure your environment variables](#configure-environment-variables) and develop as you normally would.
6570

6671
The dev Container is configured in the `.devcontainer` directory:
6772

6873
- `docker-compose.yml` file in this directory extends the `docker-compose.yml` in the root directory.
6974
- `devcontainer.json` configures the integrations with Visual Studio Code, such as the IDE extensions and settings in the `vscode` directory.
7075

71-
Read for more detailed instructions: [Visual Studio Code Docs: Developing Inside a Dev Container](https://code.visualstudio.com/docs/devcontainers/containers).
76+
See [Visual Studio Code Docs: Developing Inside a Dev Container](https://code.visualstudio.com/docs/devcontainers/containers) for more info.
7277

7378
### Install dependencies
7479

@@ -78,18 +83,10 @@ yarn
7883

7984
### Configure Environment Variables
8085

81-
- If you are an official Chayn volunteer: please get in touch with the team for access to our environment variables.
82-
83-
- If you are an open-source contributor: create a new `.env` file and populate it with the following variables.
84-
85-
**The Firebase tokens are required for running locally, the Simplybook tokens are required for testing, and all other variables are optional.**
86-
87-
You will need to gather your own Firebase tokens. Here are resources to get started:
88-
89-
- [Firebase Docs: Auth](https://firebase.google.com/docs/auth)
90-
- [Firebase Docs: API Keys](https://firebase.google.com/docs/projects/api-keys)
91-
- [Firebase Docs: Projects](https://firebase.google.com/docs/projects/learn-more#project-identifiers)
92-
- [Firebase Docs: Get Started with Fundamentals](https://firebase.google.com/docs/guides)
86+
Create a new `.env` file and populate it with the variables below. Note that only the Firebase and Simplybook tokens are required.
87+
To configure the Firebase variables, first [create a Firebase project in the Firebase console](https://firebase.google.com/) (Google account required).
88+
Next, follow [these directions](https://firebase.google.com/docs/cloud-messaging/auth-server#provide-credentials-manually) to generate a private key file in JSON format.
89+
These will generate all the required Firebase variables.
9390

9491
The Simplybook variables can be mocked data, meaning **you do not need to use real Simplybook variables, simply copy paste the values given below.**
9592
If you acquire real Simplybook environment variables, use the same format given below.
@@ -103,6 +100,7 @@ DATABASE_URL=postgres://<username>:<password>@<host>:<port>/<db>
103100
NODE_ENV=development
104101
105102
FIREBASE_TYPE=service_account
103+
106104
FIREBASE_PROJECT_ID=
107105
FIREBASE_PRIVATE_KEY_ID=
108106
FIREBASE_PRIVATE_KEY=
@@ -119,7 +117,7 @@ FIREBASE_PROJECT_ID=
119117
FIREBASE_STORAGE_BUCKET=
120118
FIREBASE_MESSAGING_SENDER_ID=
121119
FIREBASE_API_ID=
122-
FIREBASE_MEASUREMENT_ID=
120+
FIREBASE_MEASUREMENT_ID= # must enable Google Anayltics in Firebase project
123121
124122
# VARIABLES REQUIRED FOR TESTING, REPLACE WITH REAL VALUES IF NEEDED
125123
SIMPLYBOOK_CREDENTIALS='{"login":"testlogin","password":"testpassword","company":"testcompany"}'
@@ -142,7 +140,7 @@ RESPOND_IO_DELETE_CONTACT_WEBHOOK=
142140

143141
#### Using Docker - RECOMMENDED
144142

145-
The project is containerized and can be run solely in docker - both the PostgreSQL database and NestJS app. To run the backend locally, make sure your system has Docker installed - you may need Docker Desktop if using a Mac.
143+
The project is containerized and can be run solely in docker - both the PostgreSQL database and NestJS app. To run the backend locally, make sure your system has Docker installed - you may need Docker Desktop if using a Mac or Windows.
146144

147145
First make sure the docker app is running (just open the app). Then run
148146

@@ -236,7 +234,7 @@ Workspace settings for VSCode are included for consistent linting and formatting
236234

237235
### Seed Local Database
238236

239-
If you're a volunteer, add data to your local database by seeding it with a backup file. Please [read our Tech Volunteer Guide](https://www.notion.so/chayn/Tech-volunteer-wiki-5356c7118c134863a2e092e9df6cbc34?pvs=4#0fb25ffde84f4854b2d9730200eee283) for directions on seeding the local database.
237+
If you're an open-source contributor, add data to your local database by seeding it with a backup file. Please read the [Chayn Tech Wiki Guide](https://www.notion.so/chayn/Tech-volunteer-wiki-5356c7118c134863a2e092e9df6cbc34?pvs=4#0fb25ffde84f4854b2d9730200eee283) to obtain a backup file and follow directions to seed the local database.
240238

241239
If you're staff and have access to Heroku, you also have the option to seed the database via the following script. Before you start, make sure:
242240

0 commit comments

Comments
 (0)