# abdallahanass/learnlite architecture

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

- Interactive diagram: https://gitdiagram.com/abdallahanass/learnlite
- Repository: https://github.com/abdallahanass/learnlite

## Overview

Learning Platform serves students, instructors, and administrators through a React client and FastAPI API. The main workflow is role-gated course discovery and management, enrollment, lesson progress, and quizzes; reviews, analytics, authentication, and administration are additional product branches. The backend also supports course-content retrieval assistance and a wellness chatbot. Source evidence is uneven: some domain services and UI pages are indexed but unsampled, so their internal call paths are omitted; documented integrations are shown separately where implementation links are not verified.

Main entry points: [`backend/app/api/router.py`](https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/router.py) (API route registry), [`backend/app/api/dependencies.py`](https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/dependencies.py) (Auth and service wiring), [`frontend/src/App.js`](https://github.com/abdallahanass/learnlite/blob/main/frontend/src/App.js) (Role-based routes), [`frontend/src/api/client.js`](https://github.com/abdallahanass/learnlite/blob/main/frontend/src/api/client.js) (Authenticated API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Role-based routes<br/>[App.js]"]
  node_http["Authenticated API client<br/>[client.js]"]
  node_studentui["Student learning UI"]
  node_instructorui["Instructor tools"]
  node_adminui["Admin dashboard"]
  node_authui["Login and profile"]
end

subgraph group_api["FastAPI API"]
  node_entry["API route registry<br/>[router.py]"]
  node_authroutes["Authentication routes<br/>[auth.py]"]
  node_courseroutes["Course routes<br/>[courses.py]"]
  node_enrollroutes["Enrollment routes<br/>[enrollment.py]"]
  node_quizroutes["Quiz routes<br/>[quiz.py]"]
  node_reviewroutes["Review routes<br/>[review.py]"]
  node_adminroutes["Admin routes<br/>[admin.py]"]
  node_airoutes["AI assistant routes<br/>[ai.py]"]
  node_wellroutes["Wellness routes<br/>[wellness.py]"]
  node_deps["Auth and service wiring<br/>[dependencies.py]"]
end

subgraph group_domain["Learning services"]
  node_courses["Course management<br/>[course.py]"]
  node_enroll["Enrollment and progress<br/>[enrollment.py]"]
  node_quizzes["Quiz assessment<br/>[quiz.py]"]
  node_reviews["Course reviews<br/>[review.py]"]
  node_otherservices["Accounts and analytics"]
end

subgraph group_ai["AI features"]
  node_wellness["Wellness chatbot<br/>[wellness_bot.py]"]
  node_assistant["Course assistant"]
  node_ingest["Lesson ingestion<br/>[pipeline.py]"]
  node_extract["PDF and video extraction<br/>[extractors.py]"]
  node_chunk["Text chunking<br/>[chunker.py]"]
  node_embed["Vector indexing<br/>[embedder.py]"]
end

subgraph group_data["Persistence"]
  node_models["Learning data models<br/>[models.py]"]
  node_session["Database sessions<br/>[session.py]"]
  node_postgres[("PostgreSQL")]
  node_redis[("Redis token blacklist<br/>[redis.py]")]
end

node_people(("Platform users"))
node_chroma[("ChromaDB vector store")]
node_groq["Groq API"]

node_people -->|"use"| node_app
node_app -->|"routes to"| node_studentui
node_app -->|"routes to"| node_instructorui
node_app -->|"routes to"| node_adminui
node_app -->|"routes to"| node_authui
node_studentui -.->|"requests via"| node_http
node_instructorui -.->|"requests via"| node_http
node_adminui -.->|"requests via"| node_http
node_authui -.->|"requests via"| node_http
node_http -->|"HTTP REST"| node_entry
node_entry -->|"registers"| node_authroutes
node_entry -->|"registers"| node_courseroutes
node_entry -->|"registers"| node_enrollroutes
node_entry -->|"registers"| node_quizroutes
node_entry -->|"registers"| node_reviewroutes
node_entry -->|"registers"| node_adminroutes
node_entry -->|"registers"| node_airoutes
node_entry -->|"registers"| node_wellroutes
node_enrollroutes -->|"invokes"| node_enroll
node_deps -->|"provides service"| node_courses
node_deps -->|"provides service"| node_enroll
node_deps -->|"provides service"| node_quizzes
node_deps -->|"provides service"| node_reviews
node_deps -->|"provides services"| node_otherservices
node_airoutes -->|"uses assistant modules"| node_assistant
node_wellroutes -.->|"uses service"| node_wellness
node_ingest -->|"extracts text"| node_extract
node_ingest -->|"chunks text"| node_chunk
node_ingest -->|"indexes chunks"| node_embed
node_assistant -.->|"retrieves context"| node_chroma
node_assistant -.->|"calls language model"| node_groq
node_session -->|"opens sessions"| node_postgres
node_session -->|"creates tables"| node_models
node_deps -->|"gets session"| node_session
node_deps -->|"checks blacklist"| node_redis
node_enroll -->|"reads and updates"| node_models
node_reviews -->|"reads and updates"| node_models

click node_app "https://github.com/abdallahanass/learnlite/blob/main/frontend/src/App.js"
click node_http "https://github.com/abdallahanass/learnlite/blob/main/frontend/src/api/client.js"
click node_studentui "https://github.com/abdallahanass/learnlite/tree/main/frontend/src/pages/student"
click node_instructorui "https://github.com/abdallahanass/learnlite/tree/main/frontend/src/pages/instructor"
click node_adminui "https://github.com/abdallahanass/learnlite/tree/main/frontend/src/pages/admin"
click node_authui "https://github.com/abdallahanass/learnlite/tree/main/frontend/src/pages"
click node_entry "https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/router.py"
click node_authroutes "https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/auth.py"
click node_courseroutes "https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/courses.py"
click node_enrollroutes "https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/enrollment.py"
click node_quizroutes "https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/quiz.py"
click node_reviewroutes "https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/review.py"
click node_adminroutes "https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/admin.py"
click node_airoutes "https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/ai.py"
click node_wellroutes "https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/wellness.py"
click node_deps "https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/dependencies.py"
click node_courses "https://github.com/abdallahanass/learnlite/blob/main/backend/app/services/course.py"
click node_enroll "https://github.com/abdallahanass/learnlite/blob/main/backend/app/services/enrollment.py"
click node_quizzes "https://github.com/abdallahanass/learnlite/blob/main/backend/app/services/quiz.py"
click node_reviews "https://github.com/abdallahanass/learnlite/blob/main/backend/app/services/review.py"
click node_otherservices "https://github.com/abdallahanass/learnlite/tree/main/backend/app/services"
click node_wellness "https://github.com/abdallahanass/learnlite/blob/main/backend/app/ai/wellness_bot.py"
click node_assistant "https://github.com/abdallahanass/learnlite/tree/main/backend/app/ai"
click node_ingest "https://github.com/abdallahanass/learnlite/blob/main/backend/app/ai/pipeline.py"
click node_extract "https://github.com/abdallahanass/learnlite/blob/main/backend/app/ai/extractors.py"
click node_chunk "https://github.com/abdallahanass/learnlite/blob/main/backend/app/ai/chunker.py"
click node_embed "https://github.com/abdallahanass/learnlite/blob/main/backend/app/ai/embedder.py"
click node_models "https://github.com/abdallahanass/learnlite/blob/main/backend/app/database/models.py"
click node_session "https://github.com/abdallahanass/learnlite/blob/main/backend/app/database/session.py"
click node_redis "https://github.com/abdallahanass/learnlite/blob/main/backend/app/database/redis.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_http,node_studentui,node_instructorui,node_adminui,node_authui,node_people toneBlue
class node_entry,node_authroutes,node_courseroutes,node_enrollroutes,node_quizroutes,node_reviewroutes,node_adminroutes,node_airoutes,node_wellroutes,node_deps,node_chroma toneAmber
class node_courses,node_enroll,node_quizzes,node_reviews,node_otherservices,node_groq toneMint
class node_wellness,node_assistant,node_ingest,node_extract,node_chunk,node_embed toneRose
class node_models,node_session,node_postgres,node_redis toneIndigo
```

## Components

### React client

- [Role-based routes](https://github.com/abdallahanass/learnlite/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Authenticated API client](https://github.com/abdallahanass/learnlite/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Student learning UI](https://github.com/abdallahanass/learnlite/tree/main/frontend/src/pages/student): `frontend/src/pages/student`
- [Instructor tools](https://github.com/abdallahanass/learnlite/tree/main/frontend/src/pages/instructor): `frontend/src/pages/instructor`
- [Admin dashboard](https://github.com/abdallahanass/learnlite/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`
- [Login and profile](https://github.com/abdallahanass/learnlite/tree/main/frontend/src/pages): `frontend/src/pages`

### FastAPI API

- [API route registry](https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/router.py): `backend/app/api/router.py`
- [Authentication routes](https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/auth.py): `backend/app/api/routers/auth.py`
- [Course routes](https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/courses.py): `backend/app/api/routers/courses.py`
- [Enrollment routes](https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/enrollment.py): `backend/app/api/routers/enrollment.py`
- [Quiz routes](https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/quiz.py): `backend/app/api/routers/quiz.py`
- [Review routes](https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/review.py): `backend/app/api/routers/review.py`
- [Admin routes](https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/admin.py): `backend/app/api/routers/admin.py`
- [AI assistant routes](https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/ai.py): `backend/app/api/routers/ai.py`
- [Wellness routes](https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/routers/wellness.py): `backend/app/api/routers/wellness.py`
- [Auth and service wiring](https://github.com/abdallahanass/learnlite/blob/main/backend/app/api/dependencies.py): `backend/app/api/dependencies.py`

### Learning services

- [Course management](https://github.com/abdallahanass/learnlite/blob/main/backend/app/services/course.py): `backend/app/services/course.py`
- [Enrollment and progress](https://github.com/abdallahanass/learnlite/blob/main/backend/app/services/enrollment.py): `backend/app/services/enrollment.py`
- [Quiz assessment](https://github.com/abdallahanass/learnlite/blob/main/backend/app/services/quiz.py): `backend/app/services/quiz.py`
- [Course reviews](https://github.com/abdallahanass/learnlite/blob/main/backend/app/services/review.py): `backend/app/services/review.py`
- [Accounts and analytics](https://github.com/abdallahanass/learnlite/tree/main/backend/app/services): `backend/app/services`

### AI features

- [Wellness chatbot](https://github.com/abdallahanass/learnlite/blob/main/backend/app/ai/wellness_bot.py): `backend/app/ai/wellness_bot.py`
- [Course assistant](https://github.com/abdallahanass/learnlite/tree/main/backend/app/ai): `backend/app/ai`
- [Lesson ingestion](https://github.com/abdallahanass/learnlite/blob/main/backend/app/ai/pipeline.py): `backend/app/ai/pipeline.py`
- [PDF and video extraction](https://github.com/abdallahanass/learnlite/blob/main/backend/app/ai/extractors.py): `backend/app/ai/extractors.py`
- [Text chunking](https://github.com/abdallahanass/learnlite/blob/main/backend/app/ai/chunker.py): `backend/app/ai/chunker.py`
- [Vector indexing](https://github.com/abdallahanass/learnlite/blob/main/backend/app/ai/embedder.py): `backend/app/ai/embedder.py`

### Persistence

- [Learning data models](https://github.com/abdallahanass/learnlite/blob/main/backend/app/database/models.py): `backend/app/database/models.py`
- [Database sessions](https://github.com/abdallahanass/learnlite/blob/main/backend/app/database/session.py): `backend/app/database/session.py`
- **PostgreSQL**
- [Redis token blacklist](https://github.com/abdallahanass/learnlite/blob/main/backend/app/database/redis.py): `backend/app/database/redis.py`

### Other components

- **Platform users**
- **ChromaDB vector store**
- **Groq API**

## Connections

- Platform users → Role-based routes: use (evidence: `frontend/src/App.js`)
- Role-based routes → Student learning UI: routes to (evidence: `frontend/src/App.js`)
- Role-based routes → Instructor tools: routes to (evidence: `frontend/src/App.js`)
- Role-based routes → Admin dashboard: routes to (evidence: `frontend/src/App.js`)
- Role-based routes → Login and profile: routes to (evidence: `frontend/src/App.js`)
- Student learning UI → Authenticated API client: requests via
- Instructor tools → Authenticated API client: requests via
- Admin dashboard → Authenticated API client: requests via
- Login and profile → Authenticated API client: requests via
- Authenticated API client → API route registry: HTTP REST (evidence: `README.md`)
- API route registry → Authentication routes: registers (evidence: `backend/app/api/router.py`)
- API route registry → Course routes: registers (evidence: `backend/app/api/router.py`)
- API route registry → Enrollment routes: registers (evidence: `backend/app/api/router.py`)
- API route registry → Quiz routes: registers (evidence: `backend/app/api/router.py`)
- API route registry → Review routes: registers (evidence: `backend/app/api/router.py`)
- API route registry → Admin routes: registers (evidence: `backend/app/api/router.py`)
- API route registry → AI assistant routes: registers (evidence: `backend/app/api/router.py`)
- API route registry → Wellness routes: registers (evidence: `backend/app/api/router.py`)
- Enrollment routes → Enrollment and progress: invokes (evidence: `backend/app/api/routers/enrollment.py`)
- Auth and service wiring → Course management: provides service (evidence: `backend/app/api/dependencies.py`)
- Auth and service wiring → Enrollment and progress: provides service (evidence: `backend/app/api/dependencies.py`)
- Auth and service wiring → Quiz assessment: provides service (evidence: `backend/app/api/dependencies.py`)
- Auth and service wiring → Course reviews: provides service (evidence: `backend/app/api/dependencies.py`)
- Auth and service wiring → Accounts and analytics: provides services (evidence: `backend/app/api/dependencies.py`)
- AI assistant routes → Course assistant: uses assistant modules (evidence: `backend/app/api/routers/ai.py`)
- Wellness routes → Wellness chatbot: uses service
- Lesson ingestion → PDF and video extraction: extracts text (evidence: `backend/app/ai/pipeline.py`)
- Lesson ingestion → Text chunking: chunks text (evidence: `backend/app/ai/pipeline.py`)
- Lesson ingestion → Vector indexing: indexes chunks (evidence: `backend/app/ai/pipeline.py`)
- Course assistant → ChromaDB vector store: retrieves context (evidence: `README.md`)
- Course assistant → Groq API: calls language model (evidence: `README.md`)
- Database sessions → PostgreSQL: opens sessions (evidence: `backend/app/database/session.py`)
- Database sessions → Learning data models: creates tables (evidence: `backend/app/database/session.py`)
- Auth and service wiring → Database sessions: gets session (evidence: `backend/app/api/dependencies.py`)
- Auth and service wiring → Redis token blacklist: checks blacklist (evidence: `backend/app/api/dependencies.py`)
- Enrollment and progress → Learning data models: reads and updates (evidence: `backend/app/services/enrollment.py`)
- Course reviews → Learning data models: reads and updates (evidence: `backend/app/services/review.py`)
