Skip to content

Environment variables

Create src/.env locally (gitignored). On Railway, set the same names in the service dashboard. Names are listed in src/env.example.

Danger

Do not commit secrets. Do not log raw passwords, DEKs, or API keys.

Portal / Playwright

Variable Notes
APIHC_BASE_URL Portal origin (e.g. API Healthcare host)
APIHC_DOMAIN Login directory (e.g. MC Network)
APIHC_TIMEOUT ms
APIHC_HEADLESS true / false
APIHC_SLOW_MO ms
APIHC_USERNAME / APIHC_PASSWORD Optional single-user / test only

Database & Redis

Variable Notes
DATABASE_URL Preferred; Railway injects this
DB_USER / DB_PASSWORD / DB_HOST / DB_PORT / DB_NAME Alternative to URL
REDIS_URL Celery broker
RATE_LIMIT_REDIS_URL Optional separate Redis for SlowAPI

App / auth

Variable Notes
INTERNAL_SECRET X-Internal-Secret for internal routes
COOKIE_SECRET_KEY Signs credentials_auth cookie
BASE_URL / BACKEND_URL / API_URL Magic-link host
FRONTEND_URL Optional frontend origin
ENVIRONMENT development or production (cookie Secure, etc.)
PORT Railway web port

Email

Variable Notes
RESEND_API_KEY / RESEND_FROM_EMAIL / RESEND_FROM_NAME User mail
ADMIN_EMAIL Operator inbox for alerts
MAILTRAP_API_TOKEN / MAILTRAP_FROM_EMAIL / MAILTRAP_FROM_NAME Admin alerts (src/mail/config.py reads MAILTRAP_API_TOKEN)

AWS KMS

Variable Notes
AWS_KMS_KEY_ID CMK id or ARN
AWS_DEFAULT_REGION e.g. us-east-2 as deployed
AWS_ACCESS_KEY_ID_ENCRYPT / AWS_SECRET_ACCESS_KEY_ENCRYPT Web: GenerateDataKey
AWS_ACCESS_KEY_ID_DECRYPT / AWS_SECRET_ACCESS_KEY_DECRYPT Worker: Decrypt

Optional fallback: AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY (avoid in production; merges roles).

Storage (optional)

Variable Notes
BUCKET / ENDPOINT / ACCESS_KEY_ID / SECRET_ACCESS_KEY / REGION Railway object storage for screenshots

Celery

Variable Notes
CELERY_WORKER_CONCURRENCY Often 1 with Playwright
Signoff archive • Material for MkDocs