# lxakshaseth/smart-lms architecture

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

- Interactive diagram: https://gitdiagram.com/lxakshaseth/smart-lms
- Repository: https://github.com/lxakshaseth/smart-lms

## Overview

Smart-LMS is a full-stack learning platform. Students enter through the React app, authenticate, then use study, AI tutoring, exams, planning, collaboration, and engineering-learning tools; backend APIs produce learning content, saved work, and progress. The graph preserves the major README domains and documented runtime boundaries. Several feature routes and controller implementations are unsampled, so their internal calls are not asserted; dashed links mark documented or unverified integrations.

Main entry points: [`frontend/src/app/routes.tsx`](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/routes.tsx) (Feature routes), [`frontend/src/app/lib/api.ts`](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/lib/api.ts) (API client), [`backend/src/server.js`](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/server.js) (HTTP and socket server), [`backend/src/controllers/ai.controller.js`](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/controllers/ai.controller.js) (AI and OCR handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Student experience"]
  node_app["React application<br/>[App.tsx]"]
  node_routes["Feature routes<br/>[routes.tsx]"]
  node_authui["Authentication UI<br/>[Login.tsx]"]
  node_authcontext["Session context<br/>[AuthContext.tsx]"]
  node_api["API client<br/>[api.ts]"]
end

subgraph group_learning["Study and exams"]
  node_tutor["AI tutor<br/>[AITutor.tsx]"]
  node_study["Study mode<br/>[StudyMode.tsx]"]
  node_upload["Study uploads<br/>[UploadMaterial.tsx]"]
  node_notes["Notes and sharing<br/>[Notes.tsx]"]
  node_examtools["Exam tools"]
  node_lab["Practical lab"]
  node_quiz["Quizzes<br/>[Quiz.tsx]"]
  node_codepilot["CodePilot suite"]
  node_planner["Study planner<br/>[Planner.tsx]"]
  node_youtube["Video learning<br/>[YouTube.tsx]"]
end

subgraph group_engagement["Progress and community"]
  node_brain["Brain puzzles"]
  node_friends["Social collaboration<br/>[Friends.tsx]"]
  node_dashboard["Learning dashboard<br/>[Dashboard.tsx]"]
end

subgraph group_backend["API and services"]
  node_server["HTTP and socket server<br/>[server.js]"]
  node_authmw["JWT protection<br/>[auth.middleware.js]"]
  node_ai["AI and OCR handlers<br/>[ai.controller.js]"]
  node_codecontroller["CodePilot handlers"]
  node_groupcontroller["Group handlers"]
  node_ytservice["Video service<br/>[youtube.service.js]"]
  node_mockroutes["Mock test API<br/>[mock.routes.js]"]
  node_noteroutes["Notes API<br/>[notes.routes.js]"]
  node_plannercontroller["Planner handlers"]
end

subgraph group_data["Persistent state"]
  node_db[("MongoDB<br/>[db.js]")]
  node_user[("User and progress<br/>[user.model.js]")]
  node_notesmodel[("Notes<br/>[note.model.js]")]
  node_plannerdata[("Planner state<br/>[planner.model.js]")]
  node_socialdata[("Social messages and groups<br/>[group.model.js]")]
end

node_student(("Student"))

node_student -->|"uses"| node_app
node_app -->|"loads router"| node_routes
node_routes -->|"routes to"| node_authui
node_routes -->|"routes to"| node_tutor
node_routes -->|"routes to"| node_study
node_routes -->|"routes to"| node_upload
node_routes -->|"routes to"| node_notes
node_routes -->|"routes to"| node_examtools
node_routes -->|"routes to"| node_lab
node_routes -->|"routes to"| node_quiz
node_routes -->|"routes to"| node_codepilot
node_routes -->|"routes to"| node_planner
node_routes -->|"routes to"| node_brain
node_routes -->|"routes to"| node_friends
node_routes -->|"routes to"| node_youtube
node_routes -->|"routes to"| node_dashboard
node_authui -.->|"authenticates via"| node_authcontext
node_authcontext -->|"requests session"| node_api
node_tutor -->|"requests AI help"| node_api
node_notes -->|"requests notes"| node_api
node_friends -->|"requests collaboration"| node_api
node_lab -->|"requests services"| node_api
node_api -.->|"sends API requests"| node_server
node_server -.->|"protects endpoints"| node_authmw
node_server -->|"connects database"| node_db
node_ai -->|"updates progress"| node_user
node_ai -->|"saves study notes"| node_notesmodel
node_codecontroller -->|"reads learner"| node_user
node_groupcontroller -->|"reads and writes"| node_socialdata
node_groupcontroller -->|"looks up members"| node_user
node_noteroutes -->|"creates notes"| node_notesmodel
node_noteroutes -->|"reads attachments"| node_socialdata
node_mockroutes -->|"updates mastery"| node_plannerdata
node_plannercontroller -.->|"manages schedule"| node_plannerdata
node_youtube -.->|"fetches videos"| node_ytservice
node_mockroutes -->|"generates questions"| node_ai

click node_app "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/App.tsx"
click node_routes "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/routes.tsx"
click node_authui "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/auth/Login.tsx"
click node_authcontext "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/context/AuthContext.tsx"
click node_api "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/lib/api.ts"
click node_tutor "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/tutor/AITutor.tsx"
click node_study "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/study/StudyMode.tsx"
click node_upload "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/upload/UploadMaterial.tsx"
click node_notes "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/notes/Notes.tsx"
click node_examtools "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/exam-tools/ExamSpecialTools.tsx"
click node_lab "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/exam-tools/VirtualPracticalLab.tsx"
click node_quiz "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/quiz/Quiz.tsx"
click node_codepilot "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/codepilot/CodePilotContainer.tsx"
click node_planner "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/planner/Planner.tsx"
click node_brain "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/critical/CriticalThinking.tsx"
click node_friends "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/friends/Friends.tsx"
click node_youtube "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/youtube/YouTube.tsx"
click node_dashboard "https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/dashboard/Dashboard.tsx"
click node_server "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/server.js"
click node_authmw "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/middleware/auth.middleware.js"
click node_ai "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/controllers/ai.controller.js"
click node_codecontroller "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/controllers/codepilot.controller.js"
click node_groupcontroller "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/controllers/group.controller.js"
click node_ytservice "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/services/youtube.service.js"
click node_mockroutes "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/routes/mock.routes.js"
click node_noteroutes "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/routes/notes.routes.js"
click node_plannercontroller "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/controllers/planner.controller.js"
click node_db "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/config/db.js"
click node_user "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/models/user.model.js"
click node_notesmodel "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/models/note.model.js"
click node_plannerdata "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/models/planner.model.js"
click node_socialdata "https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/models/group.model.js"

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_routes,node_authui,node_authcontext,node_api toneBlue
class node_tutor,node_study,node_upload,node_notes,node_examtools,node_lab,node_quiz,node_codepilot,node_planner,node_youtube toneAmber
class node_brain,node_friends,node_dashboard toneMint
class node_server,node_authmw,node_ai,node_codecontroller,node_groupcontroller,node_ytservice,node_mockroutes,node_noteroutes,node_plannercontroller toneRose
class node_db,node_user,node_notesmodel,node_plannerdata,node_socialdata,node_student toneIndigo
```

## Components

### Student experience

- [React application](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/App.tsx): `frontend/src/app/App.tsx`
- [Feature routes](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/routes.tsx): `frontend/src/app/routes.tsx`
- [Authentication UI](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/auth/Login.tsx): `frontend/src/app/components/auth/Login.tsx`
- [Session context](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/context/AuthContext.tsx): `frontend/src/app/context/AuthContext.tsx`
- [API client](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/lib/api.ts): `frontend/src/app/lib/api.ts`

### Study and exams

- [AI tutor](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/tutor/AITutor.tsx): `frontend/src/app/components/tutor/AITutor.tsx`
- [Study mode](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/study/StudyMode.tsx): `frontend/src/app/components/study/StudyMode.tsx`
- [Study uploads](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/upload/UploadMaterial.tsx): `frontend/src/app/components/upload/UploadMaterial.tsx`
- [Notes and sharing](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/notes/Notes.tsx): `frontend/src/app/components/notes/Notes.tsx`
- [Exam tools](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/exam-tools/ExamSpecialTools.tsx): `frontend/src/app/components/exam-tools/ExamSpecialTools.tsx`
- [Practical lab](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/exam-tools/VirtualPracticalLab.tsx): `frontend/src/app/components/exam-tools/VirtualPracticalLab.tsx`
- [Quizzes](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/quiz/Quiz.tsx): `frontend/src/app/components/quiz/Quiz.tsx`
- [CodePilot suite](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/codepilot/CodePilotContainer.tsx): `frontend/src/app/components/codepilot/CodePilotContainer.tsx`
- [Study planner](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/planner/Planner.tsx): `frontend/src/app/components/planner/Planner.tsx`
- [Video learning](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/youtube/YouTube.tsx): `frontend/src/app/components/youtube/YouTube.tsx`

### Progress and community

- [Brain puzzles](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/critical/CriticalThinking.tsx): `frontend/src/app/components/critical/CriticalThinking.tsx`
- [Social collaboration](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/friends/Friends.tsx): `frontend/src/app/components/friends/Friends.tsx`
- [Learning dashboard](https://github.com/lxakshaseth/smart-lms/blob/main/frontend/src/app/components/dashboard/Dashboard.tsx): `frontend/src/app/components/dashboard/Dashboard.tsx`

### API and services

- [HTTP and socket server](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/server.js): `backend/src/server.js`
- [JWT protection](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/middleware/auth.middleware.js): `backend/src/middleware/auth.middleware.js`
- [AI and OCR handlers](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/controllers/ai.controller.js): `backend/src/controllers/ai.controller.js`
- [CodePilot handlers](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/controllers/codepilot.controller.js): `backend/src/controllers/codepilot.controller.js`
- [Group handlers](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/controllers/group.controller.js): `backend/src/controllers/group.controller.js`
- [Video service](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/services/youtube.service.js): `backend/src/services/youtube.service.js`
- [Mock test API](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/routes/mock.routes.js): `backend/src/routes/mock.routes.js`
- [Notes API](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/routes/notes.routes.js): `backend/src/routes/notes.routes.js`
- [Planner handlers](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/controllers/planner.controller.js): `backend/src/controllers/planner.controller.js`

### Persistent state

- [MongoDB](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- [User and progress](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/models/user.model.js): `backend/src/models/user.model.js`
- [Notes](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/models/note.model.js): `backend/src/models/note.model.js`
- [Planner state](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/models/planner.model.js): `backend/src/models/planner.model.js`
- [Social messages and groups](https://github.com/lxakshaseth/smart-lms/blob/main/backend/src/models/group.model.js): `backend/src/models/group.model.js`

### Other components

- **Student**

## Connections

- Student → React application: uses
- React application → Feature routes: loads router (evidence: `frontend/src/app/App.tsx`)
- Feature routes → Authentication UI: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → AI tutor: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → Study mode: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → Study uploads: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → Notes and sharing: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → Exam tools: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → Practical lab: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → Quizzes: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → CodePilot suite: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → Study planner: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → Brain puzzles: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → Social collaboration: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → Video learning: routes to (evidence: `frontend/src/app/routes.tsx`)
- Feature routes → Learning dashboard: routes to (evidence: `frontend/src/app/routes.tsx`)
- Authentication UI → Session context: authenticates via
- Session context → API client: requests session (evidence: `frontend/src/app/context/AuthContext.tsx`)
- AI tutor → API client: requests AI help (evidence: `frontend/src/app/lib/api.ts`)
- Notes and sharing → API client: requests notes (evidence: `frontend/src/app/lib/api.ts`)
- Social collaboration → API client: requests collaboration (evidence: `frontend/src/app/lib/api.ts`)
- Practical lab → API client: requests services (evidence: `frontend/src/app/lib/api.ts`)
- API client → HTTP and socket server: sends API requests
- HTTP and socket server → JWT protection: protects endpoints
- HTTP and socket server → MongoDB: connects database (evidence: `backend/src/server.js`)
- AI and OCR handlers → User and progress: updates progress (evidence: `backend/src/controllers/ai.controller.js`)
- AI and OCR handlers → Notes: saves study notes (evidence: `backend/src/controllers/ai.controller.js`)
- CodePilot handlers → User and progress: reads learner (evidence: `backend/src/controllers/codepilot.controller.js`)
- Group handlers → Social messages and groups: reads and writes (evidence: `backend/src/controllers/group.controller.js`)
- Group handlers → User and progress: looks up members (evidence: `backend/src/controllers/group.controller.js`)
- Notes API → Notes: creates notes (evidence: `backend/src/routes/notes.routes.js`)
- Notes API → Social messages and groups: reads attachments (evidence: `backend/src/routes/notes.routes.js`)
- Mock test API → Planner state: updates mastery (evidence: `backend/src/routes/mock.routes.js`)
- Planner handlers → Planner state: manages schedule
- Video learning → Video service: fetches videos
- Mock test API → AI and OCR handlers: generates questions (evidence: `backend/src/routes/mock.routes.js`)
