SystemHigh-Level Design
Configuration Map
Every environment variable across frontend and backend, cross-referenced by the components that read it and the impact if missing.
System Configuration Map
Every environment variable across both packages, cross-referenced by the components that read it.
| Variable | Set in | Used by | Breaks if missing |
|---|---|---|---|
NEXT_PUBLIC_SUPABASE_URL | frontend/.env.local | Frontend browser + server | Auth, DB, Storage - entire app down |
NEXT_PUBLIC_SUPABASE_ANON_KEY | frontend/.env.local | Frontend browser + server | Auth, DB - entire app down |
SUPABASE_SERVICE_ROLE_KEY | frontend/.env.local | Frontend admin client | Role checks, admin panel, book upload - degraded |
SUPABASE_URL | backend/.env | Backend Supabase reads | Backend cannot verify books or sessions |
SUPABASE_SERVICE_ROLE_KEY | backend/.env | Backend Supabase reads | Backend cannot read/write any data |
ML_SERVICE_URL | frontend/.env.local | Frontend chat proxy, upload | Chat and book upload fail - cannot reach backend |
BACKEND_API_KEY | frontend/.env.local | Sent as X-API-Key header to backend | No effect - backend does not validate this header |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | frontend/.env.local | Stripe Elements (browser) | Checkout page cannot render |
STRIPE_SECRET_KEY | frontend/.env.local | Create payment intent | Checkout fails |
STRIPE_WEBHOOK_SECRET | frontend/.env.local | Webhook signature verification | Webhook returns 400 - purchases not fulfilled |
NEXT_PUBLIC_APP_URL | frontend/.env.local | Stripe redirects, link generation | Stripe redirects may fail |
REDIS_URL | backend/.env | Backend cache, queue, locks | Chat and ingestion fail entirely |
QDRANT_URL | backend/.env | Vector search | Chat continues without grounding, ingestion fails |
QDRANT_API_KEY | backend/.env | Qdrant authentication | Vector search fails |
TYPESENSE_API_KEY | backend/.env | TypeSense authentication | BM25 search fails |
TYPESENSE_NODES | backend/.env | TypeSense client config | BM25 search fails |
LLM_PROVIDER | backend/.env | Chat + ingestion LLM calls | No LLM calls possible - chat and ingestion fail |
OPENAI_API_KEY | backend/.env | OpenAI LLM + embedding calls | Chat and ingestion fail if provider is OpenAI |
ANTHROPIC_API_KEY | backend/.env | Anthropic LLM calls | Chat fails if provider is Anthropic |
EMBEDDING_PROVIDER | backend/.env | Chunk embedding | Ingestion indexing fails |
RERANKER_API_KEY | backend/.env | Jina reranker | Falls back to score-sort (soft failure) |
NEXT_PUBLIC_DEBUG_MODE | frontend/.env.local | Debug bypass | No effect - debug mode disabled |
NEXT_PUBLIC_MAX_FILE_SIZE | frontend/.env.local | File validation | Falls back to hardcoded default |
NEXT_PUBLIC_MAX_COVER_SIZE | frontend/.env.local | File validation | Falls back to hardcoded default |