- Operating System: MacOS or Linux
- Git (>=2.34.0)
- GNU Make (>=3.81.0)
- Docker (>=27.4.0)
- Visual Studio Code (or any other editor that supports devcontainer)
-
From project root, create
.env:cp .env.example .env
Fill in the values for the environment variables.
-
Build the images for development:
make build-images-dev
-
Generate SSL certificates and keys for development:
make cert-dev
-
Run the development server:
make start # To stop, run `make stop`
- Enter the shell of the API server container (run
make shell-apiserver). - Install:
uv add {DEPENDENCY} --no-syncor remove:uv remove {DEPENDENCY} --no-sync(--no-synconly performs version check, no download.) - Exit the shell, rebuild dev images, then restart the API server container (run
make start).
- Add the variable and value in
.env(at project root). - Add the variable to the
Settingsclass inapiserver/main/config.py. - GitHub repository: Settings > Secrets and variables > Actions > Secrets/Variables.
- Add the variable name (no value) in
.env.examplefor future reference.
-
Step 1: Modify the ORM class in
apiserver/main/features/{feature_name}/models.py -
Step 2: Check that the
models.pyare imported inapiserver/migrations/env.py -
Step 3: Enter the container
make shell-apiserver
-
Step 4: Generate the migration file
alembic revision --autogenerate -m "{DESCRIPTION}" -
Step 5: Double check the content of the new migration file in
apiserver/migrations/versions/ -
Step 6: Apply the migration file
alembic upgrade head
On the production host, configure .env with ENVIRONMENT=prod, DOCKER_USERNAME, and DOCKER_ACCESS_TOKEN (do not put IMAGE_TAG in .env). The working tree must be clean; the script switches to main and runs git pull origin main before deploying.
Images built from main are pushed with a tag equal to the full Git commit hash (40 hex characters). CI builds on every push to main.
-
Deploy latest
main: aftergit pull, the deploy uses the currentHEADcommit as the image tag.make deploy
-
Deploy a specific commit (pin or rollback): pass the same full hash the registry uses for that image.
make deploy IMAGE_TAG={FULL_GIT_COMMIT_HASH}
Rollback: If the version you just deployed is bad, deploy again with the previous known-good commit’s full hash (the image must already exist in the registry from an earlier CI run). Example: make deploy IMAGE_TAG=abcdef0123456789abcdef0123456789abcdef01.