OWC

Railway Environments

This project uses the same code in test and production. Only Railway variables differ.

Canonical variable definitions live in ENVIRONMENT_VARIABLES.md. Use this file as the Railway-specific runbook.

Test Environment Variables

Set these in the Railway test environment:

ENVIRONMENT=test
DEBUG=false
APP_VERSION=1.0.0
LOG_LEVEL=INFO

DATABASE_URL=$
SQL_ECHO=false
DB_POOL_SIZE=20
DB_MAX_OVERFLOW=10
DB_POOL_TIMEOUT=30
DB_POOL_RECYCLE=3600

FRONTEND_URL=
API_BASE_URL=

CORS_ORIGINS=
CORS_ORIGIN_REGEX=
CORS_ALLOW_CREDENTIALS=true
CORS_ALLOW_METHODS=*
CORS_ALLOW_HEADERS=*

EMAIL_ENABLED=true
ENABLE_EMAILS=true
EMAIL_PROVIDER=mailersend
EMAIL_FROM=info@example.com
EMAIL_FROM_NAME=Open Work Culture
EMAIL_REPLY_TO=info@example.com
MAILERSEND_API_KEY=<set-in-railway-secret>

VERIFICATION_TOKEN_EXPIRY_MINUTES=1440
VERIFICATION_TOKEN_LENGTH=8

MIN_RESPONSES_FOR_PUBLIC_RESULTS=5
MIN_RESPONSES_PER_COMPANY=5
MIN_RESPONSES_PER_LOCATION=5

ENABLE_REPORT_DOWNLOAD=true
ENABLE_AI_ANALYSIS=true
ENABLE_COMPANY_REPORTS=true
ENABLE_BACKGROUND_TASKS=true

OPENAI_API_KEY=
OPENAI_MODEL=gpt-5.5

Production Environment Differences

Use the same variable names as test. Typical production differences:

ENVIRONMENT=production
FRONTEND_URL=
API_BASE_URL=
CORS_ORIGINS=

Use production-only secrets for:

Variables That Usually Differ By Environment

Secrets That Must Never Be Committed

Safe Copy Strategy

  1. Export or copy variables from test.
  2. Paste into production environment in Railway.
  3. Replace only environment-specific values and production secrets.
  4. Keep variable names unchanged.

Source Of Truth

Important Railway Behavior

How To Verify Active Environment Safely