Quick start
Requirements
- Go 1.27 (Go workspace
go.work: one module per service pluspkgandtools) - Node 22 + pnpm 11 (web app and this documentation site)
- Docker with compose
- Python 3.14 + uv only to work on
services/vision
First run
make hooks # install lefthook git hooks (lint + conventional commits)
make up # MongoDB, Kafka, Valkey, Permify, immudb, Garage (S3)
Then either run the Go services from the repository root (each reads its config from env vars):
export PRINCIPAL_PUBLIC_KEY=Y4UZIWZQa9/4q4wnuiWStDqLvrpaKIr8hZPgNyzq2uE= APP_ENV=development
go run ./services/authz/cmd/authz
PRINCIPAL_SIGNING_KEY=ZGV2LW9ubHktZWQyNTUxOS1zZWVkLTMyLWJ5dGVzISE= AUTH_DEV_LOGIN=true \
go run ./services/gateway/cmd/gateway
or start every application service in containers with the apps profile:
docker compose --profile apps up -d --build
Finally start the web app:
cd web && pnpm install && pnpm dev # http://localhost:3000
Log in with the dev login admin / admin. It exists only when APP_ENV=development and
AUTH_DEV_LOGIN=true; the gateway refuses to start with dev login and APP_ENV=production. The dev user has
the fixed ID 00000000-0000-4000-8000-000000000001 and authz assigns it the seeded Bureau role in
development. Dev sessions are created already "stepped up" (ACR passkey), so sensitive endpoints work for
15 minutes after login; GET /v1/auth/step-up refreshes it.
The default HTTP_ADDR of the shared config is :8080, and METRICS_ADDR defaults to :9090 for every Go
service. When running several services with go run, set HTTP_ADDR (and METRICS_ADDR) per service:
gateway 8080, authz 8081, members 8082, audit 8083 (set it: audit keeps :8080). files, inventory, events
and borrowing have their own defaults (HTTP 8084–8087, metrics 9184–9187). The gateway's built-in
GATEWAY_ROUTES only routes authz, members and audit; copy the compose value to reach the other services.
Compose profiles
| Profile | Started | Command |
|---|---|---|
| (default) | mongo (single-node replica set rs0), kafka (KRaft), valkey, permify (memory engine), immudb, garage + garage-init (buckets atelier-files, atelier-identity, atelier-public) | make up |
keycloak | Keycloak 26.8 on 127.0.0.1:8180, realm atelier imported from dev/keycloak | make up-full |
search | OpenSearch on 127.0.0.1:9200 (also started by the apps profile for the search service) | make up-full |
apps | authz, members, audit, files, inventory, events, vision, gateway, web (built from source; borrowing not yet) | docker compose --profile apps up -d |
Every port is bound to 127.0.0.1. Kafka is reachable from the host on 127.0.0.1:19092.
Development secrets (Ed25519 principal key pair, KEK) are defaults in docker-compose.yml; never reuse them.
Enum values and identifiers are English (draft, available, fr_id_card…). Data created before that change
still holds French values and is not migrated: wipe the volumes with docker compose down -v and start again.
Make targets
| Target | Purpose |
|---|---|
make help | List targets |
make hooks | Install git hooks (lefthook) |
make up / make up-full / make down | Start infrastructure / + Keycloak and OpenSearch / stop |
make generate | buf lint + buf generate (proto → pkg/gen) |
make lint | golangci-lint on every Go module, Biome + typecheck on the web app |
make test | All tests including integration tests (needs Docker), web unit tests |
make test-short | Unit tests only (go test -short) |
make cover | Total Go coverage per module |
make build | Build every Go service into bin/ |
make images | Build Docker images locally (atelier/<service>:dev, not pushed) |
make security | govulncheck, gosec, trivy, semgrep (release time, heavy) |
Environment variables
Configuration is through env vars only. Variables shared by every Go service (pkg/config, pkg/cryptox,
pkg/s3x):
| Variable | Default | Description |
|---|---|---|
APP_ENV | production | development, test or production |
HTTP_ADDR | :8080 | Listen address (own defaults: authz :8081, members :8082, files :8084, inventory :8085, events :8086, borrowing :8087) |
METRICS_ADDR | :9090 | Prometheus /metrics listener (private; files, inventory, events, borrowing default to :9184–:9187) |
LOG_LEVEL | info | slog level |
OTEL_EXPORTER_OTLP_ENDPOINT | empty | Enables OTLP trace export |
KAFKA_BROKERS | localhost:19092 | Comma-separated brokers |
MONGO_URI, MONGO_DATABASE | mongodb://localhost:27017/?directConnection=true, service name | MongoDB |
PRINCIPAL_PUBLIC_KEY | required | Base64 Ed25519 public key verifying X-Atl-Principal |
PRINCIPAL_SIGNING_KEY | required (gateway) | Base64 Ed25519 seed signing principal tokens |
AUTHZ_URL | http://localhost:8081 | authz ConnectRPC endpoint |
CRYPTO_KEK_SOURCE | env | env (CRYPTO_KEK, base64 32 bytes) or barbican (OS_AUTH_URL, OS_APPLICATION_CREDENTIAL_ID, OS_APPLICATION_CREDENTIAL_SECRET, OS_REGION_NAME, CRYPTO_KEK_BARBICAN_SECRET_ID) |
S3_ENDPOINT, S3_REGION, S3_ACCESS_KEY, S3_SECRET_KEY, S3_PUBLIC_ENDPOINT | —, garage, —, —, endpoint | S3 (services that store files) |
Service-specific variables are listed on each service page.
Tests
go test -short ./...in a module: unit tests with fakes.go test ./...: integration tests with testcontainers (ghcr.io/hadkaz/psmdb-no-avx:8.0.38-16single-node replica set shared per test binary,apache/kafka:4.3.1), or existing instances throughMONGO_TEST_URI/KAFKA_TEST_BROKERS.- Coverage target 85–90 %.
This documentation
cd docs/site
pnpm install
pnpm start # http://localhost:3000 (French); pnpm start:en for English
pnpm build # generates the API pages from services/*/openapi.yaml, then builds