# rautroshan-sys/learningplatform architecture

> Architecture diagram of the GitHub repository rautroshan-sys/learningplatform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rautroshan-sys/learningplatform
- Repository: https://github.com/rautroshan-sys/learningplatform

## Overview

The product is an adaptive learning platform whose central cycle is diagnostic assessment, mastery estimation, prerequisite-aware learning recommendations, adaptive quizzes, and updated mastery. The React app presents learning screens and the FastAPI backend exposes assessment, path, quiz, mastery, and AI capabilities. Sampled services show BKT updates, gap detection, and Supabase persistence; the README documents the broader cycle. Route-to-service wiring and most page-to-API calls were not sampled, so those links are not inferred here.

Main entry points: [`backend/main.py`](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/main.py) (FastAPI app), [`backend/app/db/client.py`](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/db/client.py) (Supabase client), [`backend/app/services/diagnostic_service.py`](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/services/diagnostic_service.py) (Diagnostic assessment), [`backend/app/services/quiz_service.py`](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/services/quiz_service.py) (Quiz processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Student experience"]
  node_app["App router<br/>[App.tsx]"]
  node_diagnostic_ui["Diagnostic screen<br/>[Diagnostic.tsx]"]
  node_quiz_ui["Quiz screen<br/>[Quiz.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["Learning API"]
  node_api_entry["FastAPI app<br/>[main.py]"]
  node_diagnostic_route["Diagnostic routes<br/>[diagnostic.py]"]
  node_path_route["Path routes<br/>[path.py]"]
  node_quiz_route["Quiz routes<br/>[quiz.py]"]
  node_mastery_route["Mastery routes<br/>[mastery.py]"]
  node_ai_route["AI routes<br/>[ai_routes.py]"]
end

subgraph group_learning["Adaptive learning"]
  node_diagnostic_service["Diagnostic assessment"]
  node_quiz_service["Quiz processing<br/>[quiz_service.py]"]
  node_mastery_service["Mastery profile<br/>[mastery_service.py]"]
  node_bkt["BKT model<br/>[bkt.py]"]
  node_dag["Prerequisite graph<br/>[dag.py]"]
  node_groq_client["AI generation<br/>[groq_client.py]"]
end

subgraph group_integrations["External services"]
  node_db_client["Supabase client<br/>[client.py]"]
  node_supabase[("Supabase data store")]
end

node_student(("Student"))
node_groq{{"Groq API"}}

node_student -->|"uses"| node_app
node_app -->|"routes to"| node_diagnostic_ui
node_app -->|"routes to"| node_quiz_ui
node_app -->|"routes to"| node_dashboard
node_diagnostic_ui -.->|"submits assessment"| node_api_client
node_quiz_ui -.->|"requests quiz"| node_api_client
node_dashboard -.->|"requests profile"| node_api_client
node_api_client -.->|"calls API"| node_api_entry
node_api_entry -->|"dispatches"| node_diagnostic_route
node_api_entry -->|"dispatches"| node_path_route
node_api_entry -->|"dispatches"| node_quiz_route
node_api_entry -->|"dispatches"| node_mastery_route
node_api_entry -->|"dispatches"| node_ai_route
node_diagnostic_service -->|"updates mastery"| node_bkt
node_diagnostic_service -->|"writes mastery"| node_mastery_service
node_quiz_service -->|"detects gaps"| node_dag
node_quiz_service -->|"updates mastery"| node_bkt
node_quiz_service -->|"reads and writes"| node_mastery_service
node_ai_route -->|"requests generation"| node_groq_client
node_groq_client -->|"calls model"| node_groq
node_diagnostic_service -->|"reads questions"| node_db_client
node_diagnostic_service -->|"stores mastery"| node_db_client
node_quiz_service -->|"reads and writes"| node_db_client
node_mastery_service -->|"reads and writes"| node_db_client
node_ai_route -->|"reads grounding"| node_db_client
node_db_client -->|"queries data"| node_supabase

click node_app "https://github.com/rautroshan-sys/learningplatform/blob/main/frontend/src/App.tsx"
click node_diagnostic_ui "https://github.com/rautroshan-sys/learningplatform/blob/main/frontend/src/pages/Diagnostic.tsx"
click node_quiz_ui "https://github.com/rautroshan-sys/learningplatform/blob/main/frontend/src/pages/Quiz.tsx"
click node_dashboard "https://github.com/rautroshan-sys/learningplatform/blob/main/frontend/src/pages/Dashboard.tsx"
click node_api_client "https://github.com/rautroshan-sys/learningplatform/blob/main/frontend/src/services/api.ts"
click node_api_entry "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/main.py"
click node_diagnostic_route "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/api/routes/diagnostic.py"
click node_path_route "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/api/routes/path.py"
click node_quiz_route "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/api/routes/quiz.py"
click node_mastery_route "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/api/routes/mastery.py"
click node_ai_route "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/api/routes/ai_routes.py"
click node_diagnostic_service "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/services/diagnostic_service.py"
click node_quiz_service "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/services/quiz_service.py"
click node_mastery_service "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/services/mastery_service.py"
click node_bkt "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/adaptive/bkt.py"
click node_dag "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/adaptive/dag.py"
click node_groq_client "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/ai/groq_client.py"
click node_db_client "https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/db/client.py"

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_app,node_diagnostic_ui,node_quiz_ui,node_dashboard,node_api_client toneBlue
class node_api_entry,node_diagnostic_route,node_path_route,node_quiz_route,node_mastery_route,node_ai_route toneAmber
class node_diagnostic_service,node_quiz_service,node_mastery_service,node_bkt,node_dag,node_groq_client,node_groq toneMint
class node_db_client,node_supabase toneRose
class node_student toneIndigo
```

## Components

### Student experience

- [App router](https://github.com/rautroshan-sys/learningplatform/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Diagnostic screen](https://github.com/rautroshan-sys/learningplatform/blob/main/frontend/src/pages/Diagnostic.tsx): `frontend/src/pages/Diagnostic.tsx`
- [Quiz screen](https://github.com/rautroshan-sys/learningplatform/blob/main/frontend/src/pages/Quiz.tsx): `frontend/src/pages/Quiz.tsx`
- [Dashboard](https://github.com/rautroshan-sys/learningplatform/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [API client](https://github.com/rautroshan-sys/learningplatform/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### Learning API

- [FastAPI app](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/main.py): `backend/main.py`
- [Diagnostic routes](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/api/routes/diagnostic.py): `backend/app/api/routes/diagnostic.py`
- [Path routes](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/api/routes/path.py): `backend/app/api/routes/path.py`
- [Quiz routes](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/api/routes/quiz.py): `backend/app/api/routes/quiz.py`
- [Mastery routes](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/api/routes/mastery.py): `backend/app/api/routes/mastery.py`
- [AI routes](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/api/routes/ai_routes.py): `backend/app/api/routes/ai_routes.py`

### Adaptive learning

- [Diagnostic assessment](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/services/diagnostic_service.py): `backend/app/services/diagnostic_service.py`
- [Quiz processing](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/services/quiz_service.py): `backend/app/services/quiz_service.py`
- [Mastery profile](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/services/mastery_service.py): `backend/app/services/mastery_service.py`
- [BKT model](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/adaptive/bkt.py): `backend/app/adaptive/bkt.py`
- [Prerequisite graph](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/adaptive/dag.py): `backend/app/adaptive/dag.py`
- [AI generation](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/ai/groq_client.py): `backend/app/ai/groq_client.py`

### External services

- [Supabase client](https://github.com/rautroshan-sys/learningplatform/blob/main/backend/app/db/client.py): `backend/app/db/client.py`
- **Supabase data store**

### Other components

- **Student**
- **Groq API**

## Connections

- Student → App router: uses
- App router → Diagnostic screen: routes to
- App router → Quiz screen: routes to
- App router → Dashboard: routes to
- Diagnostic screen → API client: submits assessment
- Quiz screen → API client: requests quiz
- Dashboard → API client: requests profile
- API client → FastAPI app: calls API
- FastAPI app → Diagnostic routes: dispatches
- FastAPI app → Path routes: dispatches
- FastAPI app → Quiz routes: dispatches
- FastAPI app → Mastery routes: dispatches
- FastAPI app → AI routes: dispatches
- Diagnostic assessment → BKT model: updates mastery
- Diagnostic assessment → Mastery profile: writes mastery
- Quiz processing → Prerequisite graph: detects gaps
- Quiz processing → BKT model: updates mastery
- Quiz processing → Mastery profile: reads and writes
- AI routes → AI generation: requests generation
- AI generation → Groq API: calls model
- Diagnostic assessment → Supabase client: reads questions
- Diagnostic assessment → Supabase client: stores mastery
- Quiz processing → Supabase client: reads and writes
- Mastery profile → Supabase client: reads and writes
- AI routes → Supabase client: reads grounding
- Supabase client → Supabase data store: queries data
