Files
Sauci/apps/api/.env.example
jjbrunton 5c973c4ac5 perf(api): bound worker pools and add telemetry
Share one configured PostgreSQL pool across worker repositories and make API and worker connection budgets explicit.

Add privacy-safe aggregate request, query, pool, sync, and outbox telemetry, a loopback-only representative load fixture, bounded worker shutdown, and focused regression and integration coverage.

Document the database-wide budget formula and defer pg_stat_statements activation to a reviewed migration and planned restart.
2026-08-29 22:43:27 +01:00

41 lines
1.8 KiB
Bash

PORT=3003
DATABASE_URL=postgresql://sauci:sauci_local_only@127.0.0.1:54320/sauci
SUPABASE_AUTH_URL=https://your-project.supabase.co
SUPABASE_AUTH_AUDIENCE=authenticated
# Optional connection-pool bounds. The API process opens one pool and shares it
# across every repository, so these are the process-wide limits, not per-domain
# ones. The worker has its own separately bounded process pool. Raising either
# maximum raises the server connections this instance can hold; keep the total
# across instances inside the database's own limit.
# DATABASE_POOL_MAX=10
# DATABASE_POOL_IDLE_TIMEOUT_MS=30000
# DATABASE_POOL_CONNECTION_TIMEOUT_MS=10000
# Server-only hosted Auth Admin credential. Used for account deletion and for
# enriching admin user lists; it is never exposed to the browser or used as a
# Supabase database client.
# SUPABASE_AUTH_SERVICE_ROLE_KEY=
# Optional overrides. The issuer defaults to <SUPABASE_AUTH_URL>/auth/v1 and
# the JWKS endpoint defaults to <SUPABASE_AUTH_URL>/auth/v1/.well-known/jwks.json.
# SUPABASE_AUTH_ISSUER=
# SUPABASE_AUTH_JWKS_URL=
# Test-only. Startup fails if this is set outside NODE_ENV=test.
# AUTH_TEST_JWKS={"keys":[]}
# Optional stable credential for non-browser admin clients such as MCP. MCP
# receives the token as SAUCI_ADMIN_API_TOKEN; it does not receive the user ID.
# Both values are required together. The user ID must belong to an active,
# least-privilege admin_users row; generate a random token of at least 32 chars.
# ADMIN_API_SERVICE_TOKEN=
# ADMIN_API_SERVICE_USER_ID=00000000-0000-4000-8000-000000000002
# Optional admin review decryption. Keep the private JWK server-side only.
# ADMIN_PRIVATE_KEY_JWK=
# Optional local fixture identity used by `npm run db:seed -w @sauci/api`.
# SEED_USER_ID=00000000-0000-4000-8000-000000000001
# SEED_USER_EMAIL=local@sauci.test