Skip to main content

Quick start

Requirements​

  • Go 1.27 (Go workspace go.work: one module per service plus pkg and tools)
  • 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.

Ports

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​

ProfileStartedCommand
(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
keycloakKeycloak 26.8 on 127.0.0.1:8180, realm atelier imported from dev/keycloakmake up-full
searchOpenSearch on 127.0.0.1:9200 (also started by the apps profile for the search service)make up-full
appsauthz, 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.

Resetting local data

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​

TargetPurpose
make helpList targets
make hooksInstall git hooks (lefthook)
make up / make up-full / make downStart infrastructure / + Keycloak and OpenSearch / stop
make generatebuf lint + buf generate (proto → pkg/gen)
make lintgolangci-lint on every Go module, Biome + typecheck on the web app
make testAll tests including integration tests (needs Docker), web unit tests
make test-shortUnit tests only (go test -short)
make coverTotal Go coverage per module
make buildBuild every Go service into bin/
make imagesBuild Docker images locally (atelier/<service>:dev, not pushed)
make securitygovulncheck, 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):

VariableDefaultDescription
APP_ENVproductiondevelopment, test or production
HTTP_ADDR:8080Listen address (own defaults: authz :8081, members :8082, files :8084, inventory :8085, events :8086, borrowing :8087)
METRICS_ADDR:9090Prometheus /metrics listener (private; files, inventory, events, borrowing default to :9184–:9187)
LOG_LEVELinfoslog level
OTEL_EXPORTER_OTLP_ENDPOINTemptyEnables OTLP trace export
KAFKA_BROKERSlocalhost:19092Comma-separated brokers
MONGO_URI, MONGO_DATABASEmongodb://localhost:27017/?directConnection=true, service nameMongoDB
PRINCIPAL_PUBLIC_KEYrequiredBase64 Ed25519 public key verifying X-Atl-Principal
PRINCIPAL_SIGNING_KEYrequired (gateway)Base64 Ed25519 seed signing principal tokens
AUTHZ_URLhttp://localhost:8081authz ConnectRPC endpoint
CRYPTO_KEK_SOURCEenvenv (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, —, —, endpointS3 (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-16 single-node replica set shared per test binary, apache/kafka:4.3.1), or existing instances through MONGO_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