Environment Variables

Backend (curriclean-api/)

Secrets are set via wrangler secret put <NAME>. Non-sensitive vars live in wrangler.jsonc → vars and can be committed.

Secrets

KeyRequiredNotes
JWT_SECRETyesHS256 signing secret for access tokens; must match the frontend
AUTH_SHARED_SECRETyes (if OAuth)Server-to-server secret for /auth/oauth-upsert; must match the frontend
RESEND_API_KEYyesTransactional email (verify + reset)
BRAVE_API_KEYnoEnables /applications/{id}/suggested-profiles; feature hidden if absent
OPENROUTER_API_KEYnoUse OpenRouter instead of Workers AI for LLM inference

Vars (non-sensitive, in wrangler.jsonc)

KeyDefaultNotes
DAILY_TOKEN_BUDGET50000Per-user daily token cap across all LLM calls
CV_PDF_MAX_BYTES5242880Max PDF upload size (5 MB)
FRONTEND_URLhttp://localhost:3000Origin used in verify/reset email links and CORS
OPENROUTER_MODELopenai/gpt-4o-miniModel used when OPENROUTER_API_KEY is set
OPENROUTER_BASE_URLhttps://openrouter.ai/api/v1OpenRouter endpoint

Cloudflare Bindings (in wrangler.jsonc)

BindingTypePurpose
DBD1Primary SQLite database (curriclean)
BUDGET_KVKVDaily token budget cache (curriclean-budget-kv)
AIWorkers AILLM inference — no key needed

Frontend

KeyRequiredWhereNotes
NEXT_PUBLIC_API_URLyesbuild-timeBackend Worker URL
NEXT_PUBLIC_AUTH_GOOGLE_ENABLEDnobuild-time1 to show Google button
NEXT_PUBLIC_AUTH_GITHUB_ENABLEDnobuild-time1 to show GitHub button
AUTH_SECRETyeswrangler secretAuth.js session encryption
JWT_SECRETyeswrangler secretSame value as backend JWT_SECRET
AUTH_SHARED_SECRETyes (if OAuth)wrangler secretSame value as backend AUTH_SHARED_SECRET
AUTH_GOOGLE_ID / AUTH_GOOGLE_SECRETnowrangler secretGoogle OAuth
AUTH_GITHUB_ID / AUTH_GITHUB_SECRETnowrangler secretGitHub OAuth