Environment Variables
Required
- DATABASE_URL: PostgreSQL connection string (required in production)
Optional
- ENVIRONMENT: local/test/staging/production (default development)
- DEBUG: true/false (default false)
- APP_VERSION: application version label for runtime visibility
- LOG_LEVEL: DEBUG/INFO/WARNING/ERROR (default INFO)
Database
- SQL_ECHO: true/false (default false)
- DB_POOL_SIZE: SQLAlchemy pool size (default 5)
- DB_MAX_OVERFLOW: SQLAlchemy pool overflow (default 10)
- DB_POOL_TIMEOUT: SQLAlchemy pool timeout seconds (default 30)
- DB_POOL_RECYCLE: SQLAlchemy pool recycle seconds (default 1800)
URLs
- FRONTEND_URL: frontend base URL for redirects
- API_BASE_URL: backend public base URL
- LOGO_IMAGE: optional public URL for branding assets
CORS
- CORS_ORIGINS: comma-separated allowed origins
- CORS_ORIGIN_REGEX: optional regex fallback
- CORS_ALLOW_CREDENTIALS: true/false (default true)
- CORS_ALLOW_METHODS: comma-separated methods or *
- CORS_ALLOW_HEADERS: comma-separated headers or *
Email
- EMAIL_ENABLED: true/false (default true)
- ENABLE_EMAILS: true/false (default true)
- EMAIL_PROVIDER: mailersend, resend, or smtp (defaults to smtp)
- MAILERSEND_API_KEY: MailerSend API key (required when EMAIL_PROVIDER=mailersend)
- RESEND_API_KEY: Resend API key (required when EMAIL_PROVIDER=resend)
- EMAIL_FROM: sender email address (must be on a domain verified by your email provider)
- EMAIL_FROM_NAME: sender display name
- EMAIL_REPLY_TO: reply-to address
Verification
- VERIFICATION_TOKEN_EXPIRY_MINUTES: token ttl in minutes (default 1440)
- VERIFICATION_TOKEN_LENGTH: generated token length (default 8)
Business rules
- MIN_RESPONSES_FOR_PUBLIC_RESULTS: minimum responses before public result comparisons (default 5)
- MIN_RESPONSES_PER_COMPANY: minimum responses per company (default 5)
- MIN_RESPONSES_PER_LOCATION: minimum responses per location (default 5)
Feature flags
- ENABLE_REPORT_DOWNLOAD: true/false
- ENABLE_AI_ANALYSIS: true/false
- ENABLE_COMPANY_REPORTS: true/false
- ENABLE_BACKGROUND_TASKS: true/false
Optional AI
- OPENAI_API_KEY: optional key
- OPENAI_MODEL: optional model name
Production validation
If ENVIRONMENT=production:
- DATABASE_URL must be set
- FRONTEND_URL must start with https://
- FRONTEND_URL must be set
- API_BASE_URL must be set and start with https://
- If EMAIL_ENABLED and ENABLE_EMAILS are true:
- EMAIL_PROVIDER must be set to the provider you intend to use
- If EMAIL_PROVIDER=mailersend, MAILERSEND_API_KEY must be set
- If EMAIL_PROVIDER=resend, RESEND_API_KEY must be set
- EMAIL_FROM must be set