Environment Variables
Complete reference of all environment variables used by Quizzz.
Application
| Variable | Required | Description |
|---|---|---|
NODE_ENV | Yes | development or production |
PORT | No | HTTP port (default: 3000) |
APP_BASE_URL | Yes | Full app URL (e.g., https://quizzz.techtranslab.com) |
NEXT_PUBLIC_BASE_URL | Yes | Same as APP_BASE_URL (client-side) |
Database
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string |
POSTGREST_URL | Yes | PostgREST HTTP endpoint |
POSTGREST_ANON_KEY | Yes | PostgREST anonymous role JWT |
POSTGREST_SERVICE_ROLE_KEY | Yes | PostgREST service role JWT |
DB_HOST | No | Direct PG host (for worker) |
DB_PORT | No | Direct PG port (default: 5432) |
DB_NAME | No | Direct PG database name |
Redis / Worker
| Variable | Required | Description |
|---|---|---|
REDIS_HOST | No | Redis host (default: localhost) |
REDIS_PORT | No | Redis port (default: 6379) |
REDIS_PASSWORD | No | Redis authentication password |
QUIZZZ_MODE | No | Set to worker for background worker mode |
AI Providers
| Variable | Required | Description |
|---|---|---|
GEMINI_API_KEY | Yes | Google Gemini API key (platform-managed) |
MANAGED_AI_PROVIDER | No | Default managed AI provider |
SECRET_ENCRYPTION_KEY | Yes | AES key for encrypting teacher BYOK keys |
Authentication
| Variable | Required | Description |
|---|---|---|
AUTH_PROVIDER | Yes | postgres or authjs |
GOOGLE_CLIENT_ID | Yes | Google OAuth client ID |
GOOGLE_CLIENT_SECRET | Yes | Google OAuth client secret |
AUTH_SESSION_TTL_DAYS | No | Session lifetime (default: 14) |
Storage
| Variable | Required | Description |
|---|---|---|
STORAGE_PROVIDER | Yes | gcs or local |
GCS_BUCKET | Yes* | GCS bucket for uploads |
TEACHER_UPLOADS_BUCKET | Yes* | Bucket for teacher file uploads |
S3_REGION | Yes* | S3-compatible region |
S3_ACCESS_KEY_ID | Yes* | S3 access key |
S3_SECRET_ACCESS_KEY | Yes* | S3 secret key |
S3_BUCKET | Yes* | S3 bucket name |
CDN_PUBLIC_URL | Yes* | Public CDN URL for assets |
* Required when STORAGE_PROVIDER=gcs
Domains
| Variable | Required | Description |
|---|---|---|
DOMAIN_PROVIDER | No | cloudflare for custom domain support |
CLOUDFLARE_API_TOKEN | No | Cloudflare API token |
CLOUDFLARE_ZONE_ID | No | Cloudflare zone ID |
Stripe
| Variable | Required | Description |
|---|---|---|
STRIPE_SECRET_KEY | Yes | Stripe secret key |
STRIPE_WEBHOOK_SECRET | Yes | Stripe webhook signing secret |
STRIPE_PRICE_* | Yes | Stripe price IDs for each plan tier |