# azimullah-6430/learnsphere-ai architecture

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

- Interactive diagram: https://gitdiagram.com/azimullah-6430/learnsphere-ai
- Repository: https://github.com/azimullah-6430/learnsphere-ai

## Overview

LearnSphere AI is an education platform for students and teachers, combining class and syllabus setup with AI-assisted assessment, personalized learning, and reporting. The main workflow runs from the learner or teacher through the web app and API to backend evaluation and persistence; users can also manage validated curricula and access learning activities and opportunities. The excerpts show several frontend imports and backend module references, but not the full HTTP routing or all feature implementations, so those connections are omitted or marked unverified.

Main entry points: [`backend/server.py`](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/server.py) (HTTP backend), [`learnsphere-ai/src/services/api.js`](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/services/api.js) (API client), [`learnsphere-ai/src/App.jsx`](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/App.jsx) (Web routes), [`backend/app/db.py`](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/db.py) (Application database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Web routes<br/>[App.jsx]"]
  node_context["Account and app state<br/>[AppContext.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_classroom["Class management"]
  node_evaluate_ui["Evaluation screen<br/>[Evaluate.jsx]"]
end

subgraph group_curriculum["Curriculum and learning"]
  node_learning_ui["Learning activities<br/>[LearnAnywhere.jsx]"]
  node_trainer_ui["Trainer<br/>[Trainer.jsx]"]
  node_syllabus_ui["Syllabus management<br/>[SyllabusModal.jsx]"]
  node_curriculum_notice["Curriculum status"]
  node_syllabus_data["Syllabus content<br/>[syllabusData.js]"]
  node_opportunities_ui["Opportunities"]
end

subgraph group_assessment["Assessment services"]
  node_evaluator["Assessment evaluation<br/>[evaluator.py]"]
  node_report["PDF reports<br/>[pdf_report.py]"]
  node_repair["Evaluation repair<br/>[repair.py]"]
  node_evaluation_store["Evaluation storage<br/>[store.py]"]
end

subgraph group_backend["Backend services"]
  node_server["HTTP backend<br/>[server.py]"]
  node_gemini["AI services<br/>[gemini_service.py]"]
  node_curriculum_validator["Curriculum validation"]
  node_trainer_validator["Trainer validation"]
  node_plagiarism["Plagiarism detection<br/>[detector.py]"]
  node_opportunities["Opportunity service"]
end

subgraph group_data["Persistence"]
  node_database[("Application database<br/>[db.py]")]
end

node_user(("Student or teacher"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_evaluate_ui
node_app -->|"routes to"| node_learning_ui
node_app -->|"routes to"| node_trainer_ui
node_app -->|"routes to"| node_opportunities_ui
node_evaluate_ui -->|"requests evaluation"| node_api
node_learning_ui -.->|"requests activities"| node_api
node_opportunities_ui -->|"requests opportunities"| node_api
node_trainer_ui -->|"uses"| node_api
node_trainer_ui -->|"reads content"| node_syllabus_data
node_learning_ui -->|"renders"| node_syllabus_ui
node_learning_ui -->|"renders"| node_curriculum_notice
node_syllabus_ui -->|"requests syllabus"| node_api
node_context -->|"requests account data"| node_api
node_context -->|"uses data"| node_syllabus_data
node_classroom -->|"updates state"| node_context
node_api -.->|"sends HTTP requests"| node_server
node_server -->|"invokes"| node_evaluator
node_server -->|"uses"| node_report
node_server -->|"uses"| node_evaluation_store
node_server -->|"uses"| node_curriculum_validator
node_server -->|"uses"| node_plagiarism
node_server -->|"uses"| node_opportunities
node_evaluator -->|"requests AI analysis"| node_gemini
node_repair -->|"reads and writes"| node_database
node_evaluation_store -->|"persists evaluations"| node_database
node_server -->|"reads and writes"| node_database
node_opportunities -->|"syncs items"| node_database
node_plagiarism -->|"uses storage"| node_database
node_trainer_ui -.->|"validation link unverified"| node_trainer_validator

click node_app "https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/App.jsx"
click node_context "https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/context/AppContext.jsx"
click node_api "https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/services/api.js"
click node_classroom "https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/components/ClassManagerModal.jsx"
click node_evaluate_ui "https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/pages/Evaluate.jsx"
click node_learning_ui "https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/pages/LearnAnywhere.jsx"
click node_trainer_ui "https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/pages/Trainer.jsx"
click node_syllabus_ui "https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/components/SyllabusModal.jsx"
click node_curriculum_notice "https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/components/CurriculumReviewNotice.jsx"
click node_syllabus_data "https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/data/syllabusData.js"
click node_opportunities_ui "https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/pages/CurrentOpportunities.jsx"
click node_server "https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/server.py"
click node_evaluator "https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/evaluation/evaluator.py"
click node_report "https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/evaluation/pdf_report.py"
click node_repair "https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/evaluation/repair.py"
click node_evaluation_store "https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/evaluation/store.py"
click node_gemini "https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/gemini_service.py"
click node_curriculum_validator "https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/curriculum_validator.py"
click node_trainer_validator "https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/trainer_validator.py"
click node_plagiarism "https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/plagiarism/detector.py"
click node_opportunities "https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/opportunities_service.py"
click node_database "https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/db.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_context,node_api,node_classroom,node_evaluate_ui toneBlue
class node_learning_ui,node_trainer_ui,node_syllabus_ui,node_curriculum_notice,node_syllabus_data,node_opportunities_ui toneAmber
class node_evaluator,node_report,node_repair,node_evaluation_store toneMint
class node_server,node_gemini,node_curriculum_validator,node_trainer_validator,node_plagiarism,node_opportunities toneRose
class node_database,node_user toneIndigo
```

## Components

### Web application

- [Web routes](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/App.jsx): `learnsphere-ai/src/App.jsx`
- [Account and app state](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/context/AppContext.jsx): `learnsphere-ai/src/context/AppContext.jsx`
- [API client](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/services/api.js): `learnsphere-ai/src/services/api.js`
- [Class management](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/components/ClassManagerModal.jsx): `learnsphere-ai/src/components/ClassManagerModal.jsx`
- [Evaluation screen](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/pages/Evaluate.jsx): `learnsphere-ai/src/pages/Evaluate.jsx`

### Curriculum and learning

- [Learning activities](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/pages/LearnAnywhere.jsx): `learnsphere-ai/src/pages/LearnAnywhere.jsx`
- [Trainer](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/pages/Trainer.jsx): `learnsphere-ai/src/pages/Trainer.jsx`
- [Syllabus management](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/components/SyllabusModal.jsx): `learnsphere-ai/src/components/SyllabusModal.jsx`
- [Curriculum status](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/components/CurriculumReviewNotice.jsx): `learnsphere-ai/src/components/CurriculumReviewNotice.jsx`
- [Syllabus content](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/data/syllabusData.js): `learnsphere-ai/src/data/syllabusData.js`
- [Opportunities](https://github.com/azimullah-6430/learnsphere-ai/blob/main/learnsphere-ai/src/pages/CurrentOpportunities.jsx): `learnsphere-ai/src/pages/CurrentOpportunities.jsx`

### Assessment services

- [Assessment evaluation](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/evaluation/evaluator.py): `backend/app/evaluation/evaluator.py`
- [PDF reports](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/evaluation/pdf_report.py): `backend/app/evaluation/pdf_report.py`
- [Evaluation repair](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/evaluation/repair.py): `backend/app/evaluation/repair.py`
- [Evaluation storage](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/evaluation/store.py): `backend/app/evaluation/store.py`

### Backend services

- [HTTP backend](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/server.py): `backend/server.py`
- [AI services](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/gemini_service.py): `backend/app/gemini_service.py`
- [Curriculum validation](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/curriculum_validator.py): `backend/app/curriculum_validator.py`
- [Trainer validation](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/trainer_validator.py): `backend/app/trainer_validator.py`
- [Plagiarism detection](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/plagiarism/detector.py): `backend/app/plagiarism/detector.py`
- [Opportunity service](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/opportunities_service.py): `backend/app/opportunities_service.py`

### Persistence

- [Application database](https://github.com/azimullah-6430/learnsphere-ai/blob/main/backend/app/db.py): `backend/app/db.py`

### Other components

- **Student or teacher**

## Connections

- Student or teacher → Web routes: uses (evidence: `learnsphere-ai/src/App.jsx`)
- Web routes → Evaluation screen: routes to (evidence: `learnsphere-ai/src/App.jsx`)
- Web routes → Learning activities: routes to (evidence: `learnsphere-ai/src/App.jsx`)
- Web routes → Trainer: routes to (evidence: `learnsphere-ai/src/App.jsx`)
- Web routes → Opportunities: routes to (evidence: `learnsphere-ai/src/App.jsx`)
- Evaluation screen → API client: requests evaluation (evidence: `learnsphere-ai/src/services/api.js`)
- Learning activities → API client: requests activities (evidence: `learnsphere-ai/src/pages/LearnAnywhere.jsx`)
- Opportunities → API client: requests opportunities (evidence: `learnsphere-ai/src/services/api.js`)
- Trainer → API client: uses (evidence: `learnsphere-ai/src/pages/Trainer.jsx`)
- Trainer → Syllabus content: reads content (evidence: `learnsphere-ai/src/pages/Trainer.jsx`)
- Learning activities → Syllabus management: renders (evidence: `learnsphere-ai/src/pages/LearnAnywhere.jsx`)
- Learning activities → Curriculum status: renders (evidence: `learnsphere-ai/src/pages/LearnAnywhere.jsx`)
- Syllabus management → API client: requests syllabus (evidence: `learnsphere-ai/src/components/SyllabusModal.jsx`)
- Account and app state → API client: requests account data (evidence: `learnsphere-ai/src/context/AppContext.jsx`)
- Account and app state → Syllabus content: uses data (evidence: `learnsphere-ai/src/context/AppContext.jsx`)
- Class management → Account and app state: updates state (evidence: `learnsphere-ai/src/components/ClassManagerModal.jsx`)
- API client → HTTP backend: sends HTTP requests
- HTTP backend → Assessment evaluation: invokes (evidence: `backend/server.py`)
- HTTP backend → PDF reports: uses (evidence: `backend/server.py`)
- HTTP backend → Evaluation storage: uses (evidence: `backend/server.py`)
- HTTP backend → Curriculum validation: uses (evidence: `backend/server.py`)
- HTTP backend → Plagiarism detection: uses (evidence: `backend/server.py`)
- HTTP backend → Opportunity service: uses (evidence: `backend/server.py`)
- Assessment evaluation → AI services: requests AI analysis (evidence: `backend/app/evaluation/evaluator.py`)
- Evaluation repair → Application database: reads and writes (evidence: `backend/app/evaluation/repair.py`)
- Evaluation storage → Application database: persists evaluations (evidence: `backend/app/evaluation/store.py`)
- HTTP backend → Application database: reads and writes (evidence: `backend/server.py`)
- Opportunity service → Application database: syncs items (evidence: `backend/app/opportunities_service.py`)
- Plagiarism detection → Application database: uses storage (evidence: `backend/app/plagiarism/detector.py`)
- Trainer → Trainer validation: validation link unverified
