Last updated: 2026-04-05
Production-ready STEM learning platform where teachers transform class materials into a structured Course Blueprint that powers grounded student learning experiences. The platform combines a role-specific web app, a Python AI orchestration backend, and Supabase-managed data, storage, and background jobs.
- Teachers upload class materials, generate a Course Blueprint, curate it, and publish it as the class source of truth.
- Students learn inside a blueprint-grounded workspace with always-on chat, quizzes, flashcards, and assignment tracking.
- Teachers review submissions, monitor class chat activity, inspect class intelligence dashboards, and use adaptive teaching briefs to plan follow-up instruction.
- Guests can enter a sandbox classroom, switch between teacher and student views, and explore a safe demo flow without touching real user data.
- Create a class and share the join code.
- Upload PDF, DOCX, or PPTX materials.
- Wait for background extraction, chunking, and embedding to finish.
- Generate and edit a Course Blueprint through its draft, overview, and published states.
- Generate quiz, flashcard, or chat activities from the published blueprint.
- Assign activities, review submissions, and inspect teaching insights.
- Sign in and join a class with a join code.
- Open the class workspace and review the published blueprint.
- Use always-on class chat or complete assigned quizzes, flashcards, and chat activities.
- Revisit the dashboard to track assigned, in-progress, submitted, and reviewed work.
- Enter from the landing page when guest mode is enabled.
- Authenticate through Supabase Anonymous Auth.
- Receive a cloned sandbox classroom seeded with demo materials, blueprint data, activities, analytics, and chat history.
- Switch between teacher and student perspectives, reset the sandbox, or create a permanent account from a clean state.
- Stay within the current guest quota model: sandboxes expire after 32 hours max or 8 hours of inactivity, with global caps on active and newly created guest sessions.
| Area | Current capability |
|---|---|
| Blueprint workflow | Draft -> Overview -> Published lifecycle with editable topics and objectives |
| Materials pipeline | Upload, process, preview, download, and delete classroom materials |
| Student learning | Always-on class chat, chat assignments, quizzes, flashcards |
| Teacher review | Submission review, feedback surfaces, transcript and attempt inspection |
| Teacher support | Adaptive teaching brief widget and class intelligence dashboard |
| Visual explanation | Generative canvas for diagrams, charts, and visual summaries |
| Guest access | Full sandbox demo mode with role switching and cleanup lifecycle |
| Testing | Web unit tests, backend unit tests, and Playwright E2E coverage |
flowchart LR
T[Teacher] --> W[Next.js Web App]
S[Student] --> W
G[Guest] --> W
W --> SA[Server Actions and API Routes]
SA --> PY[Python FastAPI Backend]
SA --> SB[(Supabase)]
PY --> LLM[OpenAI / Gemini / OpenRouter]
PY --> SB
SB --> AUTH[Auth]
SB --> DB[(Postgres + RLS)]
SB --> STORE[Storage]
SB --> EDGE[Edge Functions]
EDGE --> MW[material-worker]
EDGE --> GC[guest-sandbox-cleanup]
- The web app is built with Next.js 16 App Router, TypeScript, Tailwind CSS 4, and a shared UI system built from Radix-style primitives, Lucide icons, and Motion.
- All AI generation and orchestration go through the Python FastAPI backend. The Next.js app no longer calls model providers directly.
- Supabase provides Auth, Postgres, Storage, Row Level Security, queue-backed material processing, guest sandbox persistence, and Edge Functions.
- The canonical backend response envelope is:
{
"ok": true,
"data": {},
"error": null,
"meta": {
"request_id": "..."
}
}flowchart LR
A[Upload class materials] --> B[Process and embed content]
B --> C[Generate Course Blueprint]
C --> D[Teacher edits and approves]
D --> E[Publish blueprint]
E --> F[Generate activities]
F --> G[Students learn through chat, quiz, and flashcards]
G --> H[Teachers review outcomes and insights]
| Path | Purpose |
|---|---|
web/ |
Next.js application, routing, UI, server actions, and role-specific experiences |
backend/ |
Python FastAPI backend for AI orchestration, class flows, analytics, and chat workspace services |
supabase/ |
SQL migrations, Supabase local config, and Edge Functions |
tests/ |
Playwright E2E tests and test artifacts |
- Node.js 20+
pnpm- Python 3.11+
- A Supabase project or local Supabase stack
- At least one configured AI provider for end-to-end AI features
From the repo root:
pnpm install
pip install -r backend/requirements.txt- Copy
web/.env.exampletoweb/.env.local. - If you run the Python backend separately, use
backend/.env.exampleas a checklist and export those variables into your shell or an env loader of your choice. Theuvicorn ...command below does not auto-load.envfiles in this repo. - Fill in:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEYSUPABASE_SECRET_KEYNEXT_PUBLIC_SITE_URLPYTHON_BACKEND_URLPYTHON_BACKEND_API_KEYunless local unauthenticated access is explicitly enabled- at least one AI provider key and model pair
- Enable guest mode only when your Supabase project also has Anonymous Auth enabled:
NEXT_PUBLIC_GUEST_MODE_ENABLED=true
Terminal 1:
pnpm devTerminal 2:
uvicorn app.main:app --app-dir backend --host 0.0.0.0 --port 8001 --reloadpnpm test
pnpm test:watch
pnpm vitest run "web/src/app/classes/[classId]/_components/MaterialActionsMenu.test.tsx"python3 -m unittest discover -s backend/tests -p 'test_*.py'- Copy
tests/.env.exampletotests/.env. - Fill in hosted or preview credentials and join code.
- Run:
npx playwright test --config tests/playwright.config.tsE2E coverage currently includes teacher navigation, student navigation, class access flows, settings, sign-out, and guest entry.
web/is deployed as the Next.js frontend.backend/is deployed as a separate FastAPI service.supabase/migrations and Edge Functions must be applied to the target Supabase project.- Hosted Supabase auth should apply both
supabase/templates/confirmation.htmlandsupabase/templates/recovery.htmlso confirmation and password-reset links match the app's/auth/confirmflow. - Material processing runs through Supabase queueing and the
material-workerEdge Function. - Guest sandbox cleanup runs through the
guest-sandbox-cleanupEdge Function.
See DESIGN.md for the product and technical design, and DEPLOYMENT.md for the hosted rollout runbook.
- The Python backend is required for all AI generation, class create/join, class chat workspace operations, material dispatch, analytics, and visual generation.
- Guest mode depends on both
NEXT_PUBLIC_GUEST_MODE_ENABLEDand Supabase Anonymous Auth being enabled for the target project. - Material processing depends on the Supabase queue worker path, not a purely synchronous Vercel request flow.
- The web app uses
--webpackforpnpm devandpnpm build; Turbopack is not the current project path.
- ARCHITECTURE.md — deep technical architecture and runtime flows
- DESIGN.md — product and technical design
- DEPLOYMENT.md — deployment and operations guide
- UIUX.md — UI/UX language, system, and frontend implementation
- web/README.md — web app-specific notes
- backend/README.md — Python backend guide
- supabase/README.md — Supabase migration notes