|
1 | | -# ============================================================ |
2 | | -# LMS Platform — Environment Variables |
3 | | -# Copy this file to .env.local and fill in your values. |
4 | | -# NEVER commit .env.local to version control. |
5 | | -# ============================================================ |
| 1 | +# ─── MINIMUM VIABLE LOCAL SETUP ────────────────────────────────────────────── |
| 2 | +# Copy this file to .env.local and fill in the values below. |
| 3 | +# Do NOT commit .env.local — it is listed in .gitignore. |
| 4 | +# At minimum, you need these 4 vars to run the app locally: |
| 5 | +# NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY, |
| 6 | +# SUPABASE_SERVICE_ROLE_KEY, NEXT_PUBLIC_PLATFORM_DOMAIN |
6 | 7 |
|
7 | | -# ─── Supabase ──────────────────────────────────────────────── |
8 | | -# Found at: https://supabase.com/dashboard → Project Settings → API |
9 | | -NEXT_PUBLIC_SUPABASE_URL=https://your-project-id.supabase.co |
10 | | -NEXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY=eyJ... # anon / publishable key |
11 | | -SUPABASE_SERVICE_ROLE_KEY=eyJ... # service_role key — keep secret! |
| 8 | +# ─── SUPABASE ───────────────────────────────────────────────────────────────── |
| 9 | +# Get these from: Supabase Dashboard → your project → Settings → API |
| 10 | +NEXT_PUBLIC_SUPABASE_URL= # Required — Supabase project URL |
| 11 | +NEXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY= # Required — anon/publishable key |
| 12 | +SUPABASE_SERVICE_ROLE_KEY= # Required — service role key (bypasses RLS, server-only) |
12 | 13 |
|
13 | | -# ─── Platform Domain ───────────────────────────────────────── |
14 | | -# The root domain for subdomain routing. Each school gets school.yourdomain.com |
15 | | -# For local dev: lvh.me:3000 (all subdomains resolve to localhost) |
16 | | -NEXT_PUBLIC_PLATFORM_DOMAIN=yourdomain.com |
17 | | -NEXT_PUBLIC_APP_URL=https://yourdomain.com |
| 14 | +# ─── STRIPE — STUDENT PAYMENTS (Connect) ────────────────────────────────────── |
| 15 | +# Students pay schools via Stripe Connect (PaymentIntents) |
| 16 | +# Get keys from: https://dashboard.stripe.com/apikeys |
| 17 | +STRIPE_SECRET_KEY= # Required for payment features |
| 18 | +NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY= # Required for payment features |
| 19 | +STRIPE_WEBHOOK_SECRET= # Required — student payment webhook (/api/stripe/webhook) |
18 | 20 |
|
19 | | -# ─── Stripe — Student Payments (Connect) ───────────────────── |
20 | | -# Schools receive payments via Stripe Connect. |
21 | | -# Found at: https://dashboard.stripe.com/apikeys |
22 | | -STRIPE_SECRET_KEY=sk_live_... |
23 | | -NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_... |
24 | | -# Webhook secret for /api/stripe/webhook (student payments) |
25 | | -# Created at: https://dashboard.stripe.com/webhooks → add endpoint |
26 | | -STRIPE_WEBHOOK_SECRET=whsec_... |
| 21 | +# ─── STRIPE — SCHOOL BILLING (Platform) ─────────────────────────────────────── |
| 22 | +# Schools pay the platform via Stripe Billing (Checkout + Subscriptions) |
| 23 | +STRIPE_PLATFORM_WEBHOOK_SECRET= # Required for school billing webhook (/api/stripe/platform-webhook) |
27 | 24 |
|
28 | | -# ─── Stripe — Platform Billing (School Subscriptions) ──────── |
29 | | -# Platform charges schools for their plan (Starter, Pro, Business). |
30 | | -# Webhook secret for /api/stripe/platform-webhook |
31 | | -STRIPE_PLATFORM_WEBHOOK_SECRET=whsec_... |
| 25 | +# ─── PLATFORM ───────────────────────────────────────────────────────────────── |
| 26 | +NEXT_PUBLIC_PLATFORM_DOMAIN=lvh.me # Has-Default — subdomain base (lvh.me for local, yourdomain.com in prod) |
| 27 | +NEXT_PUBLIC_APP_URL=http://localhost:3000 # Has-Default — base URL of the app |
| 28 | +NEXT_PUBLIC_APP_NAME=LMS Platform # Has-Default — displayed in UI and emails |
32 | 29 |
|
33 | | -# ─── AI — OpenAI (Exam Grading, Exercises, AI Tutor) ───────── |
34 | | -# Found at: https://platform.openai.com/api-keys |
35 | | -OPENAI_API_KEY=sk-... |
| 30 | +# ─── AI ─────────────────────────────────────────────────────────────────────── |
| 31 | +OPENAI_API_KEY= # Optional — server-side AI features (Aristotle tutor, grading) |
| 32 | +# ⚠ SECURITY: This key is exposed to the browser bundle. Do not use a production key here. |
| 33 | +# It is consumed by the speech-input component. Server-side proxying is the intended fix (tracked separately). |
| 34 | +NEXT_PUBLIC_OPENAI_API_KEY= # Optional — client-side speech input feature |
| 35 | +ASSEMBLYAI_API_KEY= # Optional — audio transcription for speech exercises |
36 | 36 |
|
37 | | -# ─── Email — Mailgun ───────────────────────────────────────── |
38 | | -# Used for enrollment confirmations, certificate delivery, welcome emails. |
39 | | -# Found at: https://app.mailgun.com/mg/dashboard |
40 | | -MAILGUN_API_KEY=key-... |
41 | | -MAILGUN_DOMAIN=mg.yourdomain.com |
42 | | -MAILGUN_API_URL=https://api.mailgun.net # use https://api.eu.mailgun.net for EU |
43 | | -EMAIL_FROM=noreply@yourdomain.com |
| 37 | +# ─── OBSERVABILITY / LANGFUSE ───────────────────────────────────────────────── |
| 38 | +LANGFUSE_PUBLIC_KEY= # Optional — LLM observability (Langfuse) |
| 39 | +LANGFUSE_SECRET_KEY= # Optional |
| 40 | +LANGFUSE_BASEURL= # Optional — defaults to Langfuse cloud if omitted |
44 | 41 |
|
45 | | -# ─── Certificates ──────────────────────────────────────────── |
46 | | -# Used to sign and verify issued certificates. |
47 | | -CERTIFICATE_ENCRYPTION_KEY=a-random-32-char-secret-string |
48 | | -CERTIFICATE_ISSUER_NAME=Your Platform Name |
| 42 | +# ─── EMAIL / MAILGUN ────────────────────────────────────────────────────────── |
| 43 | +MAILGUN_API_KEY= # Optional — transactional email |
| 44 | +MAILGUN_API_URL= # Optional — e.g. https://api.eu.mailgun.net (EU region) |
| 45 | +MAILGUN_DOMAIN= # Optional — your Mailgun sending domain |
| 46 | +EMAIL_FROM= # Optional — e.g. noreply@yourdomain.com |
49 | 47 |
|
50 | | -# ─── Company Info (used in invoices / emails) ──────────────── |
51 | | -COMPANY_NAME=Your Company Name |
52 | | -COMPANY_EMAIL=hello@yourdomain.com |
53 | | -COMPANY_ADDRESS=123 Main St, City, Country |
54 | | -COMPANY_PHONE=+1 555 000 0000 |
| 48 | +# ─── CERTIFICATES ───────────────────────────────────────────────────────────── |
| 49 | +CERTIFICATE_ENCRYPTION_KEY= # Optional — course completion certificate signing |
| 50 | +CERTIFICATE_ISSUER_NAME= # Optional — displayed on certificates |
55 | 51 |
|
56 | | -# ─── Cron Jobs ─────────────────────────────────────────────── |
57 | | -# Secret to authenticate /api/cron/* endpoints (called by Vercel Cron). |
58 | | -# Generate with: openssl rand -hex 32 |
59 | | -CRON_SECRET=your-random-cron-secret |
| 52 | +# ─── INFRASTRUCTURE (deployment only) ───────────────────────────────────────── |
| 53 | +CLOUDFLARE_ZONE_ID= # Optional — Cloudflare DNS zone for custom domains |
| 54 | +CF_DNS_API_TOKEN= # Optional — Cloudflare API token |
| 55 | +SERVER_IP= # Optional — deployment target IP |
60 | 56 |
|
61 | | -# ─── PayPal (Optional — alternative payment provider) ──────── |
62 | | -# Only required if PAYMENT_PROVIDER=paypal |
63 | | -PAYPAL_CLIENT_ID= |
64 | | -PAYPAL_CLIENT_SECRET= |
65 | | -PAYMENT_PROVIDER=stripe # stripe | paypal | manual |
| 57 | +# ─── PAYMENTS — PAYPAL ──────────────────────────────────────────────────────── |
| 58 | +PAYPAL_CLIENT_ID= # Optional — PayPal payment provider |
| 59 | +PAYPAL_CLIENT_SECRET= # Optional |
| 60 | +PAYMENT_PROVIDER=stripe # Has-Default — stripe | manual | paypal |
66 | 61 |
|
67 | | -# ─── MCP Server (Optional — AI development tooling) ────────── |
68 | | -MCP_SERVER_URL= |
69 | | -MCP_PROXY_SECRET= |
| 62 | +# ─── MCP SERVER ─────────────────────────────────────────────────────────────── |
| 63 | +# The mcp-server/ sub-project exposes LMS data to AI agents via MCP protocol. |
| 64 | +# See mcp-server/.env.example for the MCP server own env vars. |
| 65 | +MCP_PROXY_SECRET= # Optional — shared secret for MCP proxy auth |
| 66 | +MCP_SERVER_URL=http://localhost:3001 # Has-Default — URL of the MCP server |
70 | 67 |
|
71 | | -# ─── CORS (Optional — restrict API origins) ────────────────── |
72 | | -ALLOWED_ORIGIN=https://yourdomain.com |
| 68 | +# ─── CRON ───────────────────────────────────────────────────────────────────── |
| 69 | +CRON_SECRET= # Optional — protects cron endpoints (/api/cron/*) |
73 | 70 |
|
74 | | -# ─── Local Development Only ────────────────────────────────── |
75 | | -# NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321 |
76 | | -# NEXT_PUBLIC_PLATFORM_DOMAIN=lvh.me:3000 |
77 | | -# NEXT_PUBLIC_APP_URL=http://lvh.me:3000 |
| 71 | +# ─── INVOICING ──────────────────────────────────────────────────────────────── |
| 72 | +COMPANY_NAME= # Optional — appears on generated invoices |
| 73 | +COMPANY_ADDRESS= # Optional |
| 74 | +COMPANY_EMAIL= # Optional |
| 75 | +COMPANY_PHONE= # Optional |
| 76 | + |
| 77 | +# ─── TESTING ────────────────────────────────────────────────────────────────── |
| 78 | +BASE_URL=http://localhost:3000 # Has-Default — base URL for Playwright tests |
| 79 | +E2E_BASE_URL=http://localhost:3000 # Has-Default — explicit E2E base URL |
| 80 | +E2E_TENANT_BASE_URL=http://testschool.lvh.me:3000 # Has-Default — tenant subdomain for E2E multi-tenant tests |
0 commit comments