Environment Variables¶
This project uses environment variables for local development and CI.
Rules¶
- Never commit secrets.
- Use the example files as templates:
- Backend:
backend/.env.example - Frontend:
frontend/.env.example
Backend¶
Required:
DATABASE_URL: PostgreSQL connection string
Backend runtime note:
- Backend services and CLI commands read
DATABASE_URLfrom the current process environment directly. - Backend runtime code does not auto-load local env files.
Optional:
MAPBOX_TOKEN: secret Mapbox token for backend geocodingSENTRY_DSN: error tracking (optional)ENVIRONMENT:developmentorproductionLOG_LEVEL: logging levelHEARTBEAT_STALE_THRESHOLD_MINUTES: backend heartbeat/health threshold overrideALERT_API_URL: optional notification provider endpointALERT_USER_KEY: optional notification recipient/user keyALERT_API_TOKEN: optional notification provider tokenALERTS_ENABLED: set tofalseto suppress outbound operational notificationsALERTS_REFERENCE_URL: optional alert deep link override for operator-facing contextOPERATIONAL_NOTIFICATION_MODE: set tocritical_onlyto persist P2/P3 operational incidents without sending outbound notifications; defaults tonormalPLAYWRIGHT_BROWSERS_PATH: optional shared Chromium cache path for scheduled browser-based jobs
Frontend¶
Required:
NEXT_PUBLIC_MAPBOX_TOKEN: Mapbox token for the map UIDATABASE_URL: database connection used by server-side API routes
Recommended:
NEXT_PUBLIC_BASE_URL: canonical base URL for sitemap/robots/metadata (for example,https://wait-time.ca)HEARTBEAT_STALE_THRESHOLD_MINUTES: health endpoint stale threshold overrideDATABASE_SSL_MODE: optional server-side API database SSL override. Set torequireto force SSL, ordisable/false/off/0to disable it. When unset, local database hosts disable SSL and non-local hosts require SSL.
Deployment notes:
NEXT_PUBLIC_MAPBOX_TOKENmust be present when building frontend assets that render the map.NEXT_PUBLIC_BASE_URLshould be set explicitly in production so metadata, robots, and sitemap output stay canonical.- Environment-specific deployment files, host paths, and alerting credentials are intentionally excluded from public documentation.