# janarthanankv/project_lms architecture

> Architecture diagram of the GitHub repository janarthanankv/project_lms, 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/janarthanankv/project_lms
- Repository: https://github.com/janarthanankv/project_lms

## Overview

Edemy is a learner-and-educator learning management system. Learners browse course listings and details, purchase courses, access enrolled material, and track lecture progress; educators can publish courses and review courses, earnings, and enrolled students. The client context loads shared course and user state, while the Express server mounts course, user, and educator APIs. Sampled controllers show persistence and integrations; some page and webhook internals were not sampled, so their detailed wiring is omitted.

Main entry points: [`client/src/App.jsx`](https://github.com/janarthanankv/project_lms/blob/main/client/src/App.jsx) (App routes), [`server/controllers/userController.js`](https://github.com/janarthanankv/project_lms/blob/main/server/controllers/userController.js) (Learner operations), [`server/controllers/educatorController.js`](https://github.com/janarthanankv/project_lms/blob/main/server/controllers/educatorController.js) (Educator operations), [`server/server.js`](https://github.com/janarthanankv/project_lms/blob/main/server/server.js) (Express server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Learner and educator client"]
  node_app["App routes<br/>[App.jsx]"]
  node_context["Shared client state<br/>[AppContext.jsx]"]
  node_catalog["Course catalog<br/>[CoursesList.jsx]"]
  node_courseview["Course details<br/>[CourseDetails.jsx]"]
  node_enrollments["My enrollments<br/>[MyEnrollments.jsx]"]
  node_player["Course player<br/>[Player.jsx]"]
  node_educatorui["Educator workspace<br/>[Educator.jsx]"]
  node_addcourse["Course authoring<br/>[AddCourse.jsx]"]
  node_dashboard["Educator dashboard<br/>[Dashboard.jsx]"]
  node_students["Enrolled students"]
end

subgraph group_api["API and access"]
  node_server["Express server<br/>[server.js]"]
  node_courseroutes["Course routes<br/>[courseRoutes.js]"]
  node_userroutes["User routes<br/>[userRoutes.js]"]
  node_educatorroutes["Educator routes<br/>[educatorRoutes.js]"]
  node_auth["Educator authorization<br/>[authMiddleware.js]"]
  node_webhooks["Identity and payment webhooks<br/>[webhooks.js]"]
end

subgraph group_learning["Courses and learning records"]
  node_coursectrl["Course queries"]
  node_userctrl["Learner operations<br/>[userController.js]"]
  node_educatorctrl["Educator operations"]
  node_coursemodel[("Course records<br/>[Course.js]")]
  node_usermodel[("User records<br/>[User.js]")]
  node_purchasemodel[("Purchase records<br/>[Purchase.js]")]
  node_progressmodel[("Progress records<br/>[courseProgress.js]")]
end

subgraph group_integrations["Identity and services"]
  node_mongodb[("MongoDB connection<br/>[mondodb.js]")]
  node_clerk["Clerk"]
  node_stripe["Stripe"]
  node_cloudinary["Cloudinary"]
  node_upload["Multipart upload<br/>[multer.js]"]
end

node_learner(("Learner"))
node_educator(("Educator"))

node_learner -->|"opens"| node_app
node_educator -->|"opens"| node_app
node_app -->|"routes"| node_catalog
node_app -->|"routes"| node_courseview
node_app -->|"routes"| node_enrollments
node_app -->|"routes"| node_player
node_app -->|"routes"| node_educatorui
node_educatorui -->|"routes"| node_addcourse
node_educatorui -->|"routes"| node_dashboard
node_educatorui -->|"routes"| node_students
node_context -->|"fetches catalog"| node_courseroutes
node_context -->|"fetches user data"| node_userroutes
node_enrollments -->|"requests progress"| node_userroutes
node_server -->|"mounts"| node_courseroutes
node_server -->|"mounts"| node_userroutes
node_server -->|"mounts"| node_educatorroutes
node_server -->|"dispatches webhooks"| node_webhooks
node_server -->|"connects"| node_mongodb
node_courseroutes -->|"dispatches"| node_coursectrl
node_userroutes -->|"dispatches"| node_userctrl
node_educatorroutes -->|"checks educator role"| node_auth
node_educatorroutes -->|"dispatches"| node_educatorctrl
node_educatorroutes -->|"accepts image"| node_upload
node_coursectrl -->|"queries"| node_coursemodel
node_userctrl -->|"reads course"| node_coursemodel
node_userctrl -->|"reads and updates"| node_usermodel
node_userctrl -->|"creates purchase"| node_purchasemodel
node_userctrl -->|"reads and writes"| node_progressmodel
node_educatorctrl -->|"reads and creates"| node_coursemodel
node_educatorctrl -->|"reads purchases"| node_purchasemodel
node_educatorctrl -->|"reads students"| node_usermodel
node_educatorctrl -.->|"uploads thumbnail"| node_cloudinary
node_educatorctrl -->|"updates educator role"| node_clerk
node_auth -->|"checks role"| node_clerk
node_userctrl -->|"creates checkout"| node_stripe
node_webhooks -->|"receives identity events"| node_clerk
node_webhooks -->|"receives payment events"| node_stripe

click node_app "https://github.com/janarthanankv/project_lms/blob/main/client/src/App.jsx"
click node_context "https://github.com/janarthanankv/project_lms/blob/main/client/src/context/AppContext.jsx"
click node_catalog "https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/student/CoursesList.jsx"
click node_courseview "https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/student/CourseDetails.jsx"
click node_enrollments "https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/student/MyEnrollments.jsx"
click node_player "https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/student/Player.jsx"
click node_educatorui "https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/educator/Educator.jsx"
click node_addcourse "https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/educator/AddCourse.jsx"
click node_dashboard "https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/educator/Dashboard.jsx"
click node_students "https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/educator/StudentsEnrolled.jsx"
click node_server "https://github.com/janarthanankv/project_lms/blob/main/server/server.js"
click node_courseroutes "https://github.com/janarthanankv/project_lms/blob/main/server/routes/courseRoutes.js"
click node_userroutes "https://github.com/janarthanankv/project_lms/blob/main/server/routes/userRoutes.js"
click node_educatorroutes "https://github.com/janarthanankv/project_lms/blob/main/server/routes/educatorRoutes.js"
click node_auth "https://github.com/janarthanankv/project_lms/blob/main/server/middlewares/authMiddleware.js"
click node_coursectrl "https://github.com/janarthanankv/project_lms/blob/main/server/controllers/courseController.js"
click node_userctrl "https://github.com/janarthanankv/project_lms/blob/main/server/controllers/userController.js"
click node_educatorctrl "https://github.com/janarthanankv/project_lms/blob/main/server/controllers/educatorController.js"
click node_webhooks "https://github.com/janarthanankv/project_lms/blob/main/server/controllers/webhooks.js"
click node_coursemodel "https://github.com/janarthanankv/project_lms/blob/main/server/models/Course.js"
click node_usermodel "https://github.com/janarthanankv/project_lms/blob/main/server/models/User.js"
click node_purchasemodel "https://github.com/janarthanankv/project_lms/blob/main/server/models/Purchase.js"
click node_progressmodel "https://github.com/janarthanankv/project_lms/blob/main/server/models/courseProgress.js"
click node_mongodb "https://github.com/janarthanankv/project_lms/blob/main/server/configs/mondodb.js"
click node_upload "https://github.com/janarthanankv/project_lms/blob/main/server/configs/multer.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_context,node_catalog,node_courseview,node_enrollments,node_player,node_educatorui,node_addcourse,node_dashboard,node_students toneBlue
class node_server,node_courseroutes,node_userroutes,node_educatorroutes,node_auth,node_webhooks toneAmber
class node_coursectrl,node_userctrl,node_educatorctrl,node_coursemodel,node_usermodel,node_purchasemodel,node_progressmodel toneMint
class node_mongodb,node_clerk,node_stripe,node_cloudinary,node_upload toneRose
class node_learner,node_educator toneIndigo
```

## Components

### Learner and educator client

- [App routes](https://github.com/janarthanankv/project_lms/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Shared client state](https://github.com/janarthanankv/project_lms/blob/main/client/src/context/AppContext.jsx): `client/src/context/AppContext.jsx`
- [Course catalog](https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/student/CoursesList.jsx): `client/src/pages/student/CoursesList.jsx`
- [Course details](https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/student/CourseDetails.jsx): `client/src/pages/student/CourseDetails.jsx`
- [My enrollments](https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/student/MyEnrollments.jsx): `client/src/pages/student/MyEnrollments.jsx`
- [Course player](https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/student/Player.jsx): `client/src/pages/student/Player.jsx`
- [Educator workspace](https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/educator/Educator.jsx): `client/src/pages/educator/Educator.jsx`
- [Course authoring](https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/educator/AddCourse.jsx): `client/src/pages/educator/AddCourse.jsx`
- [Educator dashboard](https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/educator/Dashboard.jsx): `client/src/pages/educator/Dashboard.jsx`
- [Enrolled students](https://github.com/janarthanankv/project_lms/blob/main/client/src/pages/educator/StudentsEnrolled.jsx): `client/src/pages/educator/StudentsEnrolled.jsx`

### API and access

- [Express server](https://github.com/janarthanankv/project_lms/blob/main/server/server.js): `server/server.js`
- [Course routes](https://github.com/janarthanankv/project_lms/blob/main/server/routes/courseRoutes.js): `server/routes/courseRoutes.js`
- [User routes](https://github.com/janarthanankv/project_lms/blob/main/server/routes/userRoutes.js): `server/routes/userRoutes.js`
- [Educator routes](https://github.com/janarthanankv/project_lms/blob/main/server/routes/educatorRoutes.js): `server/routes/educatorRoutes.js`
- [Educator authorization](https://github.com/janarthanankv/project_lms/blob/main/server/middlewares/authMiddleware.js): `server/middlewares/authMiddleware.js`
- [Identity and payment webhooks](https://github.com/janarthanankv/project_lms/blob/main/server/controllers/webhooks.js): `server/controllers/webhooks.js`

### Courses and learning records

- [Course queries](https://github.com/janarthanankv/project_lms/blob/main/server/controllers/courseController.js): `server/controllers/courseController.js`
- [Learner operations](https://github.com/janarthanankv/project_lms/blob/main/server/controllers/userController.js): `server/controllers/userController.js`
- [Educator operations](https://github.com/janarthanankv/project_lms/blob/main/server/controllers/educatorController.js): `server/controllers/educatorController.js`
- [Course records](https://github.com/janarthanankv/project_lms/blob/main/server/models/Course.js): `server/models/Course.js`
- [User records](https://github.com/janarthanankv/project_lms/blob/main/server/models/User.js): `server/models/User.js`
- [Purchase records](https://github.com/janarthanankv/project_lms/blob/main/server/models/Purchase.js): `server/models/Purchase.js`
- [Progress records](https://github.com/janarthanankv/project_lms/blob/main/server/models/courseProgress.js): `server/models/courseProgress.js`

### Identity and services

- [MongoDB connection](https://github.com/janarthanankv/project_lms/blob/main/server/configs/mondodb.js): `server/configs/mondodb.js`
- **Clerk**
- **Stripe**
- **Cloudinary**
- [Multipart upload](https://github.com/janarthanankv/project_lms/blob/main/server/configs/multer.js): `server/configs/multer.js`

### Other components

- **Learner**
- **Educator**

## Connections

- Learner → App routes: opens
- Educator → App routes: opens
- App routes → Course catalog: routes
- App routes → Course details: routes
- App routes → My enrollments: routes
- App routes → Course player: routes
- App routes → Educator workspace: routes
- Educator workspace → Course authoring: routes
- Educator workspace → Educator dashboard: routes
- Educator workspace → Enrolled students: routes
- Shared client state → Course routes: fetches catalog
- Shared client state → User routes: fetches user data
- My enrollments → User routes: requests progress
- Express server → Course routes: mounts
- Express server → User routes: mounts
- Express server → Educator routes: mounts
- Express server → Identity and payment webhooks: dispatches webhooks
- Express server → MongoDB connection: connects
- Course routes → Course queries: dispatches
- User routes → Learner operations: dispatches
- Educator routes → Educator authorization: checks educator role
- Educator routes → Educator operations: dispatches
- Educator routes → Multipart upload: accepts image
- Course queries → Course records: queries
- Learner operations → Course records: reads course
- Learner operations → User records: reads and updates
- Learner operations → Purchase records: creates purchase
- Learner operations → Progress records: reads and writes
- Educator operations → Course records: reads and creates
- Educator operations → Purchase records: reads purchases
- Educator operations → User records: reads students
- Educator operations → Cloudinary: uploads thumbnail
- Educator operations → Clerk: updates educator role
- Educator authorization → Clerk: checks role
- Learner operations → Stripe: creates checkout
- Identity and payment webhooks → Clerk: receives identity events
- Identity and payment webhooks → Stripe: receives payment events
