Documentation — For developers
Environment Variables & Configuration Reference
Every variable below is read once at startup. Required variables are marked "Required"; everything else is optional — the related feature shows an honest "not configured" message instead of failing when left unset.
Database
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | Pooled Postgres connection string, used by the running app. |
DIRECT_URL | Yes | Direct (non-pooled) Postgres connection string, used for running migrations. |
Authentication
| Variable | Required | Description |
|---|---|---|
AUTH_SECRET | Yes | Signing secret for sessions (Auth.js) and for the “view portal” access cookie. Generate with openssl rand -base64 32. |
NEXTAUTH_URL | Yes (dev) | The app's own URL, used by Auth.js. |
App
| Variable | Required | Description |
|---|---|---|
APP_URL | Yes | Public URL used to build links in emails/SMS and API callbacks. |
Platform billing & payment security
| Variable | Required | Description |
|---|---|---|
PAYMENT_KEYS_SECRET | No | Encrypts each school’s own payment gateway keys at rest (AES-256-GCM). Falls back to AUTH_SECRET if unset — set a distinct value in production. |
PLATFORM_PAYSTACK_PUBLIC_KEY | No | Your own Paystack merchant account, used to charge schools their Schoolum subscription. Separate from each school’s own gateway (which they connect themselves, from Settings, to collect fees from parents). |
PLATFORM_PAYSTACK_SECRET_KEY | No | Paired secret key. Webhook endpoint: /api/webhooks/platform-paystack. |
Left unset, platform billing falls back to a simulated “Pay now → confirm” flow — useful for demos and early setup.
AI assistant & CBT AI features
| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY | No | Enables the AI assistant and CBT AI features (question generation, exam insights, revision plans, grading suggestions) via OpenAI. |
ANTHROPIC_API_KEY | No | Same features via Anthropic. Set either provider. |
AI_PROVIDER | No | openai or anthropic when both keys are set. Defaults to openai. |
OPENAI_MODEL / ANTHROPIC_MODEL | No | Override the default model per provider. |
Online learning (live classes)
| Variable | Required | Description |
|---|---|---|
LIVEKIT_URL | No | LiveKit Cloud or self-hosted server URL. Powers the native, embedded live classroom. |
LIVEKIT_API_KEY / LIVEKIT_API_SECRET | No | LiveKit credentials. Without these, “Schedule Live Class” still works; “Start Class” shows a “not configured” message. |
File storage
| Variable | Required | Description |
|---|---|---|
BLOB_READ_WRITE_TOKEN | No | Vercel Blob token for lecture videos/documents and recordings — stored privately, served only through an authenticated route. |
Live class recording (optional, on top of Online Learning)
| Variable | Required | Description |
|---|---|---|
RECORDING_S3_BUCKET | No | S3-compatible bucket LiveKit Egress writes recordings to. |
RECORDING_S3_REGION | No | Bucket region. |
RECORDING_S3_ACCESS_KEY / RECORDING_S3_SECRET_KEY | No | Bucket credentials. Without these, the “Start recording” control simply doesn’t appear. |
Per-school configuration (not environment variables)
These are set per school from inside the app, not in .env:
- Email/SMS delivery provider and credentials (Settings → Notifications)
- Payment gateway for collecting fees from parents (Settings → Payments)
- Branding (logo, color) and report card design
- Role & permission configuration