Wiki · Systems

System architecture

One Next.js App Router codebase, many hostnames, shared Prisma models, Supabase auth, and clearly marked stubs where GPU, Stripe, and Zoom will attach.

Application shell

The monorepo serves www, library, checkout, journal, lab, and exam via middleware.ts host rewrites. Shared chrome hides on Journal/Lab/Exam/Login so those surfaces can feel like focused tools. Public marketing pages keep Navbar + Footer.

Data

PostgreSQL via Prisma (application database); Qdrant for RAG vectors. Core commerce: Order, OrderItem. Ownership: BookOwned. Lab: LearningObjective, UserObjectiveProgress, Milestone, StudySession, SessionMessage, RecallEvent, GeneratedMaterial, LabSettings. Exam: ExamSession with Zoom stub fields.

Auth

Supabase Google + Apple OAuth through /auth/callback. Account dropdown appears only when a session exists. Lab and Exam require auth when Supabase env is present; otherwise Lab allows a demo user id for local UX exercise.

Integration seams

  • TODO(AI-INTEGRATION) — mockInference → GPU/LLM RAG service
  • TODO(PAYMENTS) — stub card capture → Stripe PaymentIntents
  • TODO(ZOOM) — stub meeting IDs → Zoom Meeting API

Related reading