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

VariableRequiredDescription
DATABASE_URLYesPooled Postgres connection string, used by the running app.
DIRECT_URLYesDirect (non-pooled) Postgres connection string, used for running migrations.

Authentication

VariableRequiredDescription
AUTH_SECRETYesSigning secret for sessions (Auth.js) and for the “view portal” access cookie. Generate with openssl rand -base64 32.
NEXTAUTH_URLYes (dev)The app's own URL, used by Auth.js.

App

VariableRequiredDescription
APP_URLYesPublic URL used to build links in emails/SMS and API callbacks.

Platform billing & payment security

VariableRequiredDescription
PAYMENT_KEYS_SECRETNoEncrypts 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_KEYNoYour 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_KEYNoPaired 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

VariableRequiredDescription
OPENAI_API_KEYNoEnables the AI assistant and CBT AI features (question generation, exam insights, revision plans, grading suggestions) via OpenAI.
ANTHROPIC_API_KEYNoSame features via Anthropic. Set either provider.
AI_PROVIDERNoopenai or anthropic when both keys are set. Defaults to openai.
OPENAI_MODEL / ANTHROPIC_MODELNoOverride the default model per provider.

Online learning (live classes)

VariableRequiredDescription
LIVEKIT_URLNoLiveKit Cloud or self-hosted server URL. Powers the native, embedded live classroom.
LIVEKIT_API_KEY / LIVEKIT_API_SECRETNoLiveKit credentials. Without these, “Schedule Live Class” still works; “Start Class” shows a “not configured” message.

File storage

VariableRequiredDescription
BLOB_READ_WRITE_TOKENNoVercel 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)

VariableRequiredDescription
RECORDING_S3_BUCKETNoS3-compatible bucket LiveKit Egress writes recordings to.
RECORDING_S3_REGIONNoBucket region.
RECORDING_S3_ACCESS_KEY / RECORDING_S3_SECRET_KEYNoBucket 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