Setup
Prerequisites
Section titled “Prerequisites”Install the following tools before getting started:
Git Hooks
Section titled “Git Hooks”Run this once after cloning the repo:
git config core.hooksPath .githooksThis activates the pre-commit hook which:
- Runs type-checking on backend changes before every commit
- Keeps
env-dev.sha256/env-prod.sha256in sync when env files change
Secret Files
Section titled “Secret Files”The following files are not committed to git. Get them from Bitwarden and place them at the paths below:
| File | Path | Bitwarden | GitHub Secret |
|---|---|---|---|
| Dev env vars | growl-backend/terraform/.env.dev | ✓ | ENV_FILE_DEV_B64 (base64-encoded) |
| Prod env vars | growl-backend/terraform/.env.prod | ✓ | ENV_FILE_PROD_B64 (base64-encoded) |
| EC2 SSH key | ~/.ssh/growl-key (or wherever you prefer) | ✓ | EC2_SSH_KEY |
Tfvars files are committed to git and do not need to be retrieved separately.
To encode an env file for storing as a GitHub secret:
cat growl-backend/terraform/.env.dev | base64Running the Backend Locally
Section titled “Running the Backend Locally”The local server reads from growl-backend/.env. Get the dev env file from Bitwarden and place it at growl-backend/.env.
Then start the server:
cd growl-backend
make local-server