# guidertech/ai-learning-platform architecture

> Architecture diagram of the GitHub repository guidertech/ai-learning-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/guidertech/ai-learning-platform
- Repository: https://github.com/guidertech/ai-learning-platform

## Overview

ClassOrbit is a student learning platform whose central journey runs from choosing a subject and chapter through prerequisite diagnosis, recovery when needed, guided topic study, and chapter mastery checks. Results and activity contribute to progress reporting. Maya provides chat and voice tutoring alongside that journey; language controls, profile/settings, homework, and leaderboard are supporting capabilities. The graph uses the supplied tree and README, with sampled source/index references for selected connections; unsampled route behavior is not inferred.

Main entry points: [`src/app/prerequisite/[chapterId]/page.tsx`](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/prerequisite/%5BchapterId%5D/page.tsx) (Prerequisite diagnostic), [`src/features/maya/components/MayaPanel.tsx`](https://github.com/guidertech/ai-learning-platform/blob/main/src/features/maya/components/MayaPanel.tsx) (Maya tutor panel), [`src/app/learning/[conceptId]/page.tsx`](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/learning/%5BconceptId%5D/page.tsx) (Topic learning), [`src/context/LearningContext.tsx`](https://github.com/guidertech/ai-learning-platform/blob/main/src/context/LearningContext.tsx) (Learning state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning journey"]
  node_subjects["Subject selection<br/>[page.tsx]"]
  node_chapter["Chapter study<br/>[page.tsx]"]
  node_prereq["Prerequisite diagnostic<br/>[page.tsx]"]
  node_prereq_api["Diagnostic quiz API<br/>[route.ts]"]
  node_recovery["Recovery lessons<br/>[page.tsx]"]
  node_mastery["Chapter mastery test<br/>[page.tsx]"]
  node_results["Test results<br/>[page.tsx]"]
  node_study["Topic learning<br/>[page.tsx]"]
  node_learning_context["Learning state"]
  node_progress["Progress reports<br/>[page.tsx]"]
end

subgraph group_tutor["Maya tutoring"]
  node_maya_panel["Maya tutor panel<br/>[MayaPanel.tsx]"]
  node_chat_api["Tutor chat API<br/>[route.ts]"]
  node_voice_server["Voice WebSocket server<br/>[ws-server.mjs]"]
  node_tutor_prompt["Tutor prompt builder"]
end

subgraph group_student["Student experience"]
  node_language["Language controls"]
  node_translator["Page translator"]
  node_settings["Profile and settings<br/>[page.tsx]"]
  node_homework["Homework support<br/>[page.tsx]"]
  node_leaderboard["Leaderboard<br/>[page.tsx]"]
end

subgraph group_platform["Data and services"]
  node_supabase[("Supabase data<br/>[client.ts]")]
  node_server_supabase["Server Supabase client<br/>[server.ts]"]
end

node_student_actor(("Student"))

node_student_actor -->|"chooses subject"| node_subjects
node_subjects -.->|"opens chapter"| node_chapter
node_chapter -->|"starts diagnostic"| node_prereq
node_prereq -.->|"requests questions"| node_prereq_api
node_prereq_api -->|"reads chapter data"| node_supabase
node_prereq -->|"recommends recovery"| node_recovery
node_prereq -->|"unlocks syllabus"| node_study
node_study -.->|"takes chapter test"| node_mastery
node_mastery -.->|"shows analysis"| node_results
node_results -->|"informs reporting"| node_progress
node_learning_context -->|"loads and updates"| node_supabase
node_learning_context -.->|"provides learning state"| node_study
node_study -.->|"offers tutoring"| node_maya_panel
node_maya_panel -.->|"sends chat"| node_chat_api
node_chat_api -->|"builds prompt"| node_tutor_prompt
node_maya_panel -->|"opens voice socket"| node_voice_server
node_maya_panel -->|"uses learning state"| node_learning_context
node_student_actor -->|"personalizes profile"| node_settings
node_settings -->|"selects language"| node_language
node_language -->|"translates page"| node_translator
node_student_actor -->|"gets homework help"| node_homework
node_student_actor -.->|"views rankings"| node_leaderboard
node_progress -.->|"loads progress"| node_supabase

click node_subjects "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/subjects/page.tsx"
click node_chapter "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/chapters/%5BchapterId%5D/page.tsx"
click node_prereq "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/prerequisite/%5BchapterId%5D/page.tsx"
click node_prereq_api "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/api/generate-prereq-quiz/route.ts"
click node_recovery "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/prerequisite/%5BchapterId%5D/recovery/page.tsx"
click node_mastery "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/quiz/chapter/%5BchapterId%5D/page.tsx"
click node_results "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/quiz/chapter/%5BchapterId%5D/results/page.tsx"
click node_study "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/learning/%5BconceptId%5D/page.tsx"
click node_learning_context "https://github.com/guidertech/ai-learning-platform/blob/main/src/context/LearningContext.tsx"
click node_progress "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/progress/%5BsubjectId%5D/page.tsx"
click node_maya_panel "https://github.com/guidertech/ai-learning-platform/blob/main/src/features/maya/components/MayaPanel.tsx"
click node_chat_api "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/api/chat/route.ts"
click node_voice_server "https://github.com/guidertech/ai-learning-platform/blob/main/ws-server.mjs"
click node_tutor_prompt "https://github.com/guidertech/ai-learning-platform/blob/main/src/features/maya/services/buildTutorSystemPrompt.ts"
click node_language "https://github.com/guidertech/ai-learning-platform/blob/main/src/features/language/store/LanguageContext.tsx"
click node_translator "https://github.com/guidertech/ai-learning-platform/blob/main/src/features/language/components/BrowserPageTranslator.tsx"
click node_settings "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/settings/page.tsx"
click node_homework "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/homework/page.tsx"
click node_leaderboard "https://github.com/guidertech/ai-learning-platform/blob/main/src/app/leaderboard/page.tsx"
click node_supabase "https://github.com/guidertech/ai-learning-platform/blob/main/src/lib/supabase/client.ts"
click node_server_supabase "https://github.com/guidertech/ai-learning-platform/blob/main/src/lib/supabase/server.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_subjects,node_chapter,node_prereq,node_prereq_api,node_recovery,node_mastery,node_results,node_study,node_learning_context,node_progress toneBlue
class node_maya_panel,node_chat_api,node_voice_server,node_tutor_prompt toneAmber
class node_language,node_translator,node_settings,node_homework,node_leaderboard toneMint
class node_supabase,node_server_supabase toneRose
class node_student_actor toneIndigo
```

## Components

### Learning journey

- [Subject selection](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/subjects/page.tsx): `src/app/subjects/page.tsx`
- [Chapter study](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/chapters/%5BchapterId%5D/page.tsx): `src/app/chapters/[chapterId]/page.tsx`
- [Prerequisite diagnostic](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/prerequisite/%5BchapterId%5D/page.tsx): `src/app/prerequisite/[chapterId]/page.tsx`
- [Diagnostic quiz API](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/api/generate-prereq-quiz/route.ts): `src/app/api/generate-prereq-quiz/route.ts`
- [Recovery lessons](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/prerequisite/%5BchapterId%5D/recovery/page.tsx): `src/app/prerequisite/[chapterId]/recovery/page.tsx`
- [Chapter mastery test](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/quiz/chapter/%5BchapterId%5D/page.tsx): `src/app/quiz/chapter/[chapterId]/page.tsx`
- [Test results](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/quiz/chapter/%5BchapterId%5D/results/page.tsx): `src/app/quiz/chapter/[chapterId]/results/page.tsx`
- [Topic learning](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/learning/%5BconceptId%5D/page.tsx): `src/app/learning/[conceptId]/page.tsx`
- [Learning state](https://github.com/guidertech/ai-learning-platform/blob/main/src/context/LearningContext.tsx): `src/context/LearningContext.tsx`
- [Progress reports](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/progress/%5BsubjectId%5D/page.tsx): `src/app/progress/[subjectId]/page.tsx`

### Maya tutoring

- [Maya tutor panel](https://github.com/guidertech/ai-learning-platform/blob/main/src/features/maya/components/MayaPanel.tsx): `src/features/maya/components/MayaPanel.tsx`
- [Tutor chat API](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/api/chat/route.ts): `src/app/api/chat/route.ts`
- [Voice WebSocket server](https://github.com/guidertech/ai-learning-platform/blob/main/ws-server.mjs): `ws-server.mjs`
- [Tutor prompt builder](https://github.com/guidertech/ai-learning-platform/blob/main/src/features/maya/services/buildTutorSystemPrompt.ts): `src/features/maya/services/buildTutorSystemPrompt.ts`

### Student experience

- [Language controls](https://github.com/guidertech/ai-learning-platform/blob/main/src/features/language/store/LanguageContext.tsx): `src/features/language/store/LanguageContext.tsx`
- [Page translator](https://github.com/guidertech/ai-learning-platform/blob/main/src/features/language/components/BrowserPageTranslator.tsx): `src/features/language/components/BrowserPageTranslator.tsx`
- [Profile and settings](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/settings/page.tsx): `src/app/settings/page.tsx`
- [Homework support](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/homework/page.tsx): `src/app/homework/page.tsx`
- [Leaderboard](https://github.com/guidertech/ai-learning-platform/blob/main/src/app/leaderboard/page.tsx): `src/app/leaderboard/page.tsx`

### Data and services

- [Supabase data](https://github.com/guidertech/ai-learning-platform/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [Server Supabase client](https://github.com/guidertech/ai-learning-platform/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`

### Other components

- **Student**

## Connections

- Student → Subject selection: chooses subject
- Subject selection → Chapter study: opens chapter
- Chapter study → Prerequisite diagnostic: starts diagnostic
- Prerequisite diagnostic → Diagnostic quiz API: requests questions
- Diagnostic quiz API → Supabase data: reads chapter data (evidence: `src/app/api/generate-prereq-quiz/route.ts`)
- Prerequisite diagnostic → Recovery lessons: recommends recovery
- Prerequisite diagnostic → Topic learning: unlocks syllabus
- Topic learning → Chapter mastery test: takes chapter test
- Chapter mastery test → Test results: shows analysis
- Test results → Progress reports: informs reporting
- Learning state → Supabase data: loads and updates (evidence: `src/context/LearningContext.tsx`)
- Learning state → Topic learning: provides learning state
- Topic learning → Maya tutor panel: offers tutoring
- Maya tutor panel → Tutor chat API: sends chat
- Tutor chat API → Tutor prompt builder: builds prompt (evidence: `src/app/api/chat/route.ts`)
- Maya tutor panel → Voice WebSocket server: opens voice socket (evidence: `src/features/maya/components/MayaPanel.tsx`)
- Maya tutor panel → Learning state: uses learning state (evidence: `src/features/maya/components/MayaPanel.tsx`)
- Student → Profile and settings: personalizes profile
- Profile and settings → Language controls: selects language (evidence: `src/app/settings/page.tsx`)
- Language controls → Page translator: translates page (evidence: `src/features/language/index.ts`)
- Student → Homework support: gets homework help
- Student → Leaderboard: views rankings
- Progress reports → Supabase data: loads progress
