How whitemirrortechnologies/v4-production works
V4 is a CAT-preparation platform: learners discover exams and courses, create accounts, purchase access, then study lessons and practise or take tests; staff build and manage the learning catalogue and question bank. Its Next.js App Router pages and server actions form the product surface, with shared authentication and catalogue logic backed by Supabase. The README documents several major capabilities whose detailed implementations were not sampled, so those appear as subsystem nodes; links without direct source evidence are left out. Optional future Razorpay payments are not represented as live integration.
Main entry points: server.ts User-scoped client · catalog.ts Catalogue data · auth.ts Viewer and roles · page.tsx Learner dashboard
Components 29
Public discovery
- Public catalogue
src/app/(public) - Course cards
src/components/course-card.tsx
Accounts and access
- Sign-in and signup
src/app/(auth) - Account actions
src/app/(auth)/actions.ts - Demo checkout
src/app/checkout/actions.ts
Student learning
- Learner dashboard
src/app/app/page.tsx - Course learning
src/app/app/learn/[slug]/[[...lectureId]]/page.tsx - Practice sessions
src/app/app/practice/page.tsx - Practice interaction
src/components/practice-session.tsx - Practice answers
src/app/app/practice/actions.ts - Timed exams and results
src/components/exam-screen.tsx
Staff content management
- Admin overview
src/app/admin/page.tsx - Course and curriculum editor
src/app/admin/courses/actions.ts - Syllabus management
src/app/admin/syllabus - Question bank
src/app/admin/questions - Test builder and series
src/app/admin/series - Users and orders
src/app/admin
Shared services
- Catalogue data
src/lib/catalog.ts - Viewer and roles
src/lib/auth.ts - User-scoped client
src/lib/supabase/server.ts - Shared UI primitives
src/components/ui.tsx - Form interactions
src/components/forms.tsx - Course artwork
src/components/course-art.tsx - Site navigation
src/components/site-header.tsx - Formatting helpers
src/lib/format.ts - Action result types
src/lib/result.ts - Curriculum tree loader
src/lib/tree.ts
Other components
- Learner or visitor
- Supabase services
Connections 34
- Learner or visitor → Public catalogue: browses
README.md - Public catalogue → Catalogue data: loads listings
src/app/(public)/courses/page.tsx - Public catalogue → Course cards: renders
src/app/(public)/courses/page.tsx - Course cards → Course artwork: renders
src/components/course-card.tsx - Learner or visitor → Sign-in and signup: creates account
README.md - Sign-in and signup → Account actions: submits
src/components/auth-form.tsx - Account actions → User-scoped client: uses
src/app/(auth)/actions.ts - Viewer and roles → User-scoped client: creates client
src/lib/auth.ts - User-scoped client → Supabase services: queries with user session
src/lib/supabase/server.ts - Learner dashboard → Viewer and roles: requires viewer
src/app/app/page.tsx - Learner dashboard → Catalogue data: loads learner data
src/app/app/page.tsx - Learner dashboard → User-scoped client: reads progress
src/app/app/page.tsx - Course learning → Catalogue data: loads curriculum
src/lib/catalog.ts - Catalogue data → Curriculum tree loader: builds curriculum
src/lib/catalog.ts - Catalogue data → Supabase services: reads catalogue
src/lib/catalog.ts - Practice sessions → Practice answers: starts practice
src/app/app/practice/page.tsx - Practice interaction → Practice answers: submits answers
src/components/practice-session.tsx - Practice answers → User-scoped client: uses
src/app/app/practice/actions.ts - Timed exams and results → Learner or visitor: presents exam
- Learner or visitor → Demo checkout: purchases access
README.md - Demo checkout → Supabase services: records demo purchase
- Admin overview → Viewer and roles: checks staff access
src/app/admin/page.tsx - Course and curriculum editor → Viewer and roles: checks staff access
src/app/admin/courses/actions.ts - Course and curriculum editor → User-scoped client: writes course data
src/app/admin/courses/actions.ts - Admin overview → User-scoped client: loads overview
src/app/admin/page.tsx - Syllabus management → User-scoped client: manages syllabus
src/app/admin/syllabus/page.tsx - Question bank → User-scoped client: manages questions
src/app/admin/questions/page.tsx - Test builder and series → User-scoped client: manages tests
- Users and orders → User-scoped client: manages accounts and orders
src/app/admin/page.tsx - Site navigation → Viewer and roles: loads viewer
src/components/site-header.tsx - Site navigation → Catalogue data: loads exam info
src/components/site-header.tsx - Form interactions → Shared UI primitives: styles controls
src/components/forms.tsx - Course cards → Formatting helpers: formats course data
src/components/course-card.tsx - Practice interaction → Action result types: handles action result
src/components/practice-session.tsx