# adhishthanashok/adaptivelearn architecture

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

- Interactive diagram: https://gitdiagram.com/adhishthanashok/adaptivelearn
- Repository: https://github.com/adhishthanashok/adaptivelearn

## Overview

AdaptiveLearn is a short-form educational video platform with educator content authoring and student assessment. The main learner loop is sign-in, browse the feed, watch a video, answer its quiz, and review attempts; documented adaptive recommendations build on that learning activity. The graph captures the sampled frontend calls and backend registration/authentication wiring. Other route behavior and recommendation or knowledge-tracking internals are not shown in the sampled source, so their detailed connections are omitted.

Main entry points: [`backend/app/main.py`](https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/main.py) (API application), [`frontend/lib/api.ts`](https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/lib/api.ts) (Frontend API client), [`backend/app/db/database.py`](https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/db/database.py) (Database sessions), [`frontend/app/auth/page.tsx`](https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/app/auth/page.tsx) (Sign in / register)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_student["Student learning"]
  node_auth_page["Sign in / register<br/>[page.tsx]"]
  node_auth_store["Browser auth state<br/>[auth.ts]"]
  node_student_feed["Video feed<br/>[page.tsx]"]
  node_player["Video player<br/>[VideoPlayer.tsx]"]
  node_quiz_overlay["Quiz interaction<br/>[QuizOverlay.tsx]"]
  node_history["Quiz history<br/>[page.tsx]"]
  node_api_client["Frontend API client<br/>[api.ts]"]
end

subgraph group_educator["Educator authoring"]
  node_educator_ui["Educator dashboard<br/>[page.tsx]"]
end

subgraph group_backend["API and identity"]
  node_app_entry["API application<br/>[main.py]"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_feed_routes["Feed routes<br/>[feed.py]"]
  node_quiz_routes["Quiz routes<br/>[quizzes.py]"]
  node_view_routes["View routes<br/>[views.py]"]
  node_educator_routes["Educator routes<br/>[educator.py]"]
  node_security["JWT and roles<br/>[security.py]"]
end

subgraph group_data["Persistence"]
  node_models["Learning data models<br/>[models.py]"]
  node_db_layer["Database sessions<br/>[database.py]"]
end

node_learner(("Student"))
node_educator_actor(("Educator"))
node_postgres[("PostgreSQL")]

node_learner -->|"signs in"| node_auth_page
node_auth_page -->|"submits credentials"| node_api_client
node_auth_page -->|"stores session"| node_auth_store
node_learner -->|"opens feed"| node_student_feed
node_student_feed -->|"requests feed"| node_api_client
node_student_feed -->|"shows videos"| node_player
node_player -->|"loads quiz, records view"| node_api_client
node_player -->|"presents quiz"| node_quiz_overlay
node_quiz_overlay -->|"submits answer"| node_api_client
node_learner -->|"reviews attempts"| node_history
node_history -->|"requests history"| node_api_client
node_educator_actor -->|"manages content"| node_educator_ui
node_educator_ui -->|"creates and lists content"| node_api_client
node_api_client -->|"HTTP API requests"| node_app_entry
node_app_entry -->|"registers routes"| node_auth_routes
node_app_entry -->|"registers routes"| node_feed_routes
node_app_entry -->|"registers routes"| node_quiz_routes
node_app_entry -->|"registers routes"| node_view_routes
node_app_entry -->|"registers routes"| node_educator_routes
node_auth_routes -->|"hashes and issues tokens"| node_security
node_auth_routes -->|"queries and updates"| node_db_layer
node_app_entry -->|"creates tables"| node_db_layer
node_db_layer -->|"connects"| node_postgres
node_db_layer -->|"maps schema"| node_models

click node_auth_page "https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/app/auth/page.tsx"
click node_auth_store "https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/lib/auth.ts"
click node_student_feed "https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/app/page.tsx"
click node_player "https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/components/VideoPlayer.tsx"
click node_quiz_overlay "https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/components/QuizOverlay.tsx"
click node_history "https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/app/history/page.tsx"
click node_api_client "https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/lib/api.ts"
click node_educator_ui "https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/app/educator/page.tsx"
click node_app_entry "https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/main.py"
click node_auth_routes "https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/api/routes/auth.py"
click node_feed_routes "https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/api/routes/feed.py"
click node_quiz_routes "https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/api/routes/quizzes.py"
click node_view_routes "https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/api/routes/views.py"
click node_educator_routes "https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/api/routes/educator.py"
click node_security "https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/core/security.py"
click node_models "https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/models/models.py"
click node_db_layer "https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/db/database.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_auth_page,node_auth_store,node_student_feed,node_player,node_quiz_overlay,node_history,node_api_client toneBlue
class node_educator_ui,node_postgres toneAmber
class node_app_entry,node_auth_routes,node_feed_routes,node_quiz_routes,node_view_routes,node_educator_routes,node_security toneMint
class node_models,node_db_layer toneRose
class node_learner,node_educator_actor toneIndigo
```

## Components

### Student learning

- [Sign in / register](https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/app/auth/page.tsx): `frontend/app/auth/page.tsx`
- [Browser auth state](https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/lib/auth.ts): `frontend/lib/auth.ts`
- [Video feed](https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Video player](https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/components/VideoPlayer.tsx): `frontend/components/VideoPlayer.tsx`
- [Quiz interaction](https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/components/QuizOverlay.tsx): `frontend/components/QuizOverlay.tsx`
- [Quiz history](https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/app/history/page.tsx): `frontend/app/history/page.tsx`
- [Frontend API client](https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`

### Educator authoring

- [Educator dashboard](https://github.com/adhishthanashok/adaptivelearn/blob/main/frontend/app/educator/page.tsx): `frontend/app/educator/page.tsx`

### API and identity

- [API application](https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication routes](https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/api/routes/auth.py): `backend/app/api/routes/auth.py`
- [Feed routes](https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/api/routes/feed.py): `backend/app/api/routes/feed.py`
- [Quiz routes](https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/api/routes/quizzes.py): `backend/app/api/routes/quizzes.py`
- [View routes](https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/api/routes/views.py): `backend/app/api/routes/views.py`
- [Educator routes](https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/api/routes/educator.py): `backend/app/api/routes/educator.py`
- [JWT and roles](https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/core/security.py): `backend/app/core/security.py`

### Persistence

- [Learning data models](https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/models/models.py): `backend/app/models/models.py`
- [Database sessions](https://github.com/adhishthanashok/adaptivelearn/blob/main/backend/app/db/database.py): `backend/app/db/database.py`

### Other components

- **Student**
- **Educator**
- **PostgreSQL**

## Connections

- Student → Sign in / register: signs in
- Sign in / register → Frontend API client: submits credentials
- Sign in / register → Browser auth state: stores session
- Student → Video feed: opens feed
- Video feed → Frontend API client: requests feed
- Video feed → Video player: shows videos
- Video player → Frontend API client: loads quiz, records view
- Video player → Quiz interaction: presents quiz
- Quiz interaction → Frontend API client: submits answer
- Student → Quiz history: reviews attempts
- Quiz history → Frontend API client: requests history
- Educator → Educator dashboard: manages content
- Educator dashboard → Frontend API client: creates and lists content
- Frontend API client → API application: HTTP API requests
- API application → Authentication routes: registers routes
- API application → Feed routes: registers routes
- API application → Quiz routes: registers routes
- API application → View routes: registers routes
- API application → Educator routes: registers routes
- Authentication routes → JWT and roles: hashes and issues tokens
- Authentication routes → Database sessions: queries and updates
- API application → Database sessions: creates tables
- Database sessions → PostgreSQL: connects
- Database sessions → Learning data models: maps schema
