This document describes how to run and develop the project locally (via Docker) and how to deploy it into Kubernetes (via Helm).
It also provides guidance on environment setup, migrations, testing, and code quality checks.
Before starting, make sure you have installed:
- Docker (Containerized local development)
- Poetry (Python dependencies management)
- Helm (Kubernetes deployment)
- SOPS (Helm secrets encryption)
- pre-commit (Code checks and secrets auto-encryption before commit)
The project relies on .env files and pre-commit hooks for correct operation.
Create .env in the root of the project (based on .env.example).
It must contain a path to your GitHub access token file:
GITHUB_ACCESS_TOKEN_FILE=/path/to/token/fileEach service (services/<SERVICE>/) contains its own .env.example.
Before local development or running migrations, copy it to .env and fill in the required credentials:
cp services/<SERVICE>/.env.example services/<SERVICE>/.envRun once in the root of the repository:
pre-commit installThis will ensure that before each commit:
- code style and linters are checked.
secrets.yamlis encrypted intosecrets.enc.yamlautomatically.
- Docker containers will not start correctly.
- Database migrations (Alembic) will fail.
- Secrets wonβt be encrypted before commit.
.
βββ .github/ # GitHub Actions workflows
βββ helm/ # Base Helm charts
βββ k6/ # Grafana k6 load tests
βββ scripts/ # Helper scripts
βββ services/ # Microservices (auth, user, etc.)
β βββ <service>/
β βββ docker/ # Docker configuration (Dockerfile, docker-compose)
β βββ helm/ # Helm chart for Kubernetes
β βββ src/ # Source code
β βββ pyproject.toml # Poetry configuration
βββ .env # Global environment variables (github access token)
βββ .pre-commit-config.yaml # Pre-commit configuration (code quality checks)
βββ .sops.yaml # SOPS GPG fingerprints (secrets.yaml encryption/decryption)
βββ Makefile # Global commands (docker, helm, testing, linting)
βββ team-keys.asc # Team GPG keys for SOPS
.env files are created both in the project root and inside each service before starting containers.
Each service can be built and started individually. All commands are executed via make.
make build <SERVICE>make up <SERVICE>make stop <SERVICE>make down <SERVICE>make rebuild <SERVICE>make destroy <SERVICE>Example for the auth service:
make build auth make up auth
Kubernetes deployment is based on Helm charts with helm-secrets and sops for secret management.
A detailed guide is available here:
π Helm Deployment Guide
.env for the target service (copied from .env.example).
make revision <SERVICE> msg="add new table"make upgrade <SERVICE>make downgrade <SERVICE>Run tests for a specific service:
make pytest <SERVICE>Run tests with coverage report:
make pytest-cov <SERVICE>Format and check code for a specific service:
-
Lint:
make lint <SERVICE>
-
Format imports:
make isort <SERVICE>
-
Format code:
make black <SERVICE>
-
Type check:
make mypy <SERVICE>
-
Full check (lint, format, mypy, tests, helm-encrypt):
make check <SERVICE>
-
Always work with
secrets.yaml(plain text). -
secrets.enc.yamlis never edited manually β it is generated automatically:- during the global check step (
make check <SERVICE>), or - via
pre-commithooks (if installed).
- during the global check step (
-
If you use
pre-commit, you donβt need to runmake checkmanually before committing.
- Use Docker for local development.
- Use Helm for deploying into Kubernetes clusters.
- Keep secrets only in
secrets.yaml(do not commit plain text to git). - Trust
pre-committo handle secret encryption automatically. - Run
make check <SERVICE>manually only if you want to verify locally without committing.