# muzammilalamx23/edunex architecture

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

- Interactive diagram: https://gitdiagram.com/muzammilalamx23/edunex
- Repository: https://github.com/muzammilalamx23/edunex

## Overview

EduNex is a gamified learning platform with course authoring and study, assessments, community, and an in-browser coding playground. Users browse courses, study lessons, complete quizzes or coding missions, and earn progress rewards; administrators manage course content. The React app calls an Express API backed by MongoDB, while playground execution can run through a Redis/BullMQ worker and return live Socket.IO events. The graph preserves documented capabilities, but several route and page implementations were not sampled, so some links rely on README documentation rather than inspected call sites.

Main entry points: [`client/src/App.jsx`](https://github.com/muzammilalamx23/edunex/blob/main/client/src/App.jsx) (Route application), [`client/src/utils/api.js`](https://github.com/muzammilalamx23/edunex/blob/main/client/src/utils/api.js) (API client), [`server/workers/playgroundWorker.js`](https://github.com/muzammilalamx23/edunex/blob/main/server/workers/playgroundWorker.js) (Execution worker), [`client/src/pages/CoursePlayer.jsx`](https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/CoursePlayer.jsx) (Course player)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Route application<br/>[App.jsx]"]
  node_authctx["Auth context<br/>[AuthContext.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
end

subgraph group_learning["Learning product"]
  node_dashboard["Learner dashboard<br/>[Dashboard.jsx]"]
  node_catalog["Course catalog<br/>[Courses.jsx]"]
  node_courseplayer["Course player<br/>[CoursePlayer.jsx]"]
  node_quizui["Quiz engine<br/>[QuizEngine.jsx]"]
  node_community["Course community<br/>[Community.jsx]"]
  node_adminui["Course administration"]
end

subgraph group_playground["Code playground"]
  node_engineui["Playground editor"]
  node_mentor["AI mentor panel<br/>[AIMentorPanel.jsx]"]
  node_worker["Execution worker"]
  node_queue["Job queue<br/>[playgroundQueue.js]"]
  node_sandbox["Code sandbox<br/>[sandboxService.js]"]
  node_socket["Live event service<br/>[socketService.js]"]
end

subgraph group_backend["API and services"]
  node_server["Express application<br/>[index.js]"]
  node_authmw["JWT authentication<br/>[auth.js]"]
  node_playroutes["Playground routes"]
  node_playcontroller["Playground controller"]
  node_progress["Progress service<br/>[progressService.js]"]
end

subgraph group_data["Persistent data"]
  node_coursemodel[("Course records<br/>[Course.js]")]
  node_usermodel[("User records<br/>[User.js]")]
  node_progressmodel[("Progress records<br/>[UserProgress.js]")]
  node_redis[("Redis<br/>[redis.js]")]
end

node_learner(("Learner"))
node_adminuser(("Administrator"))

node_learner -->|"uses"| node_app
node_adminuser -->|"uses"| node_app
node_app -->|"provides auth"| node_authctx
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_courseplayer
node_app -->|"routes to"| node_adminui
node_app -->|"routes to"| node_engineui
node_courseplayer -.->|"renders"| node_quizui
node_learner -.->|"participates"| node_community
node_adminuser -->|"manages courses"| node_adminui
node_authctx -->|"requests user"| node_api
node_engineui -->|"submits code"| node_api
node_engineui -->|"renders"| node_mentor
node_api -->|"calls API"| node_server
node_server -->|"mounts routes"| node_playroutes
node_playroutes -->|"requires auth"| node_authmw
node_playroutes -->|"dispatches"| node_playcontroller
node_playcontroller -->|"enqueues jobs"| node_queue
node_queue -->|"uses connection"| node_redis
node_worker -->|"executes code"| node_sandbox
node_worker -.->|"streams events"| node_socket
node_worker -->|"awards mission XP"| node_progress
node_progress -->|"reads and writes"| node_progressmodel
node_progress -->|"reads lessons"| node_coursemodel
node_dashboard -.->|"loads learning data"| node_api
node_courseplayer -.->|"loads lessons"| node_api
node_api -.->|"serves course data"| node_coursemodel
node_api -.->|"serves account data"| node_usermodel

click node_app "https://github.com/muzammilalamx23/edunex/blob/main/client/src/App.jsx"
click node_authctx "https://github.com/muzammilalamx23/edunex/blob/main/client/src/context/AuthContext.jsx"
click node_api "https://github.com/muzammilalamx23/edunex/blob/main/client/src/utils/api.js"
click node_navbar "https://github.com/muzammilalamx23/edunex/blob/main/client/src/components/Navbar.jsx"
click node_dashboard "https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/Dashboard.jsx"
click node_catalog "https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/Courses.jsx"
click node_courseplayer "https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/CoursePlayer.jsx"
click node_quizui "https://github.com/muzammilalamx23/edunex/blob/main/client/src/components/assessment/QuizEngine.jsx"
click node_community "https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/Community.jsx"
click node_adminui "https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/AdminCreateCourse.jsx"
click node_engineui "https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/EnginePlayground.jsx"
click node_mentor "https://github.com/muzammilalamx23/edunex/blob/main/client/src/components/playground/AIMentorPanel.jsx"
click node_server "https://github.com/muzammilalamx23/edunex/blob/main/server/index.js"
click node_authmw "https://github.com/muzammilalamx23/edunex/blob/main/server/middleware/auth.js"
click node_playroutes "https://github.com/muzammilalamx23/edunex/blob/main/server/routes/playgroundRoutes.js"
click node_playcontroller "https://github.com/muzammilalamx23/edunex/blob/main/server/controllers/playgroundController.js"
click node_worker "https://github.com/muzammilalamx23/edunex/blob/main/server/workers/playgroundWorker.js"
click node_queue "https://github.com/muzammilalamx23/edunex/blob/main/server/queues/playgroundQueue.js"
click node_sandbox "https://github.com/muzammilalamx23/edunex/blob/main/server/services/sandboxService.js"
click node_socket "https://github.com/muzammilalamx23/edunex/blob/main/server/services/socketService.js"
click node_progress "https://github.com/muzammilalamx23/edunex/blob/main/server/services/progressService.js"
click node_coursemodel "https://github.com/muzammilalamx23/edunex/blob/main/server/models/Course.js"
click node_usermodel "https://github.com/muzammilalamx23/edunex/blob/main/server/models/User.js"
click node_progressmodel "https://github.com/muzammilalamx23/edunex/blob/main/server/models/UserProgress.js"
click node_redis "https://github.com/muzammilalamx23/edunex/blob/main/server/config/redis.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_authctx,node_api,node_navbar toneBlue
class node_dashboard,node_catalog,node_courseplayer,node_quizui,node_community,node_adminui toneAmber
class node_engineui,node_mentor,node_worker,node_queue,node_sandbox,node_socket toneMint
class node_server,node_authmw,node_playroutes,node_playcontroller,node_progress toneRose
class node_coursemodel,node_usermodel,node_progressmodel,node_redis,node_learner,node_adminuser toneIndigo
```

## Components

### Web application

- [Route application](https://github.com/muzammilalamx23/edunex/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Auth context](https://github.com/muzammilalamx23/edunex/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [API client](https://github.com/muzammilalamx23/edunex/blob/main/client/src/utils/api.js): `client/src/utils/api.js`
- [Navigation](https://github.com/muzammilalamx23/edunex/blob/main/client/src/components/Navbar.jsx): `client/src/components/Navbar.jsx`

### Learning product

- [Learner dashboard](https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Course catalog](https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/Courses.jsx): `client/src/pages/Courses.jsx`
- [Course player](https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/CoursePlayer.jsx): `client/src/pages/CoursePlayer.jsx`
- [Quiz engine](https://github.com/muzammilalamx23/edunex/blob/main/client/src/components/assessment/QuizEngine.jsx): `client/src/components/assessment/QuizEngine.jsx`
- [Course community](https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/Community.jsx): `client/src/pages/Community.jsx`
- [Course administration](https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/AdminCreateCourse.jsx): `client/src/pages/AdminCreateCourse.jsx`

### Code playground

- [Playground editor](https://github.com/muzammilalamx23/edunex/blob/main/client/src/pages/EnginePlayground.jsx): `client/src/pages/EnginePlayground.jsx`
- [AI mentor panel](https://github.com/muzammilalamx23/edunex/blob/main/client/src/components/playground/AIMentorPanel.jsx): `client/src/components/playground/AIMentorPanel.jsx`
- [Execution worker](https://github.com/muzammilalamx23/edunex/blob/main/server/workers/playgroundWorker.js): `server/workers/playgroundWorker.js`
- [Job queue](https://github.com/muzammilalamx23/edunex/blob/main/server/queues/playgroundQueue.js): `server/queues/playgroundQueue.js`
- [Code sandbox](https://github.com/muzammilalamx23/edunex/blob/main/server/services/sandboxService.js): `server/services/sandboxService.js`
- [Live event service](https://github.com/muzammilalamx23/edunex/blob/main/server/services/socketService.js): `server/services/socketService.js`

### API and services

- [Express application](https://github.com/muzammilalamx23/edunex/blob/main/server/index.js): `server/index.js`
- [JWT authentication](https://github.com/muzammilalamx23/edunex/blob/main/server/middleware/auth.js): `server/middleware/auth.js`
- [Playground routes](https://github.com/muzammilalamx23/edunex/blob/main/server/routes/playgroundRoutes.js): `server/routes/playgroundRoutes.js`
- [Playground controller](https://github.com/muzammilalamx23/edunex/blob/main/server/controllers/playgroundController.js): `server/controllers/playgroundController.js`
- [Progress service](https://github.com/muzammilalamx23/edunex/blob/main/server/services/progressService.js): `server/services/progressService.js`

### Persistent data

- [Course records](https://github.com/muzammilalamx23/edunex/blob/main/server/models/Course.js): `server/models/Course.js`
- [User records](https://github.com/muzammilalamx23/edunex/blob/main/server/models/User.js): `server/models/User.js`
- [Progress records](https://github.com/muzammilalamx23/edunex/blob/main/server/models/UserProgress.js): `server/models/UserProgress.js`
- [Redis](https://github.com/muzammilalamx23/edunex/blob/main/server/config/redis.js): `server/config/redis.js`

### Other components

- **Learner**
- **Administrator**

## Connections

- Learner → Route application: uses (evidence: `client/src/App.jsx`)
- Administrator → Route application: uses (evidence: `client/src/App.jsx`)
- Route application → Auth context: provides auth (evidence: `client/src/App.jsx`)
- Route application → Learner dashboard: routes to (evidence: `client/src/App.jsx`)
- Route application → Course catalog: routes to (evidence: `client/src/App.jsx`)
- Route application → Course player: routes to (evidence: `client/src/App.jsx`)
- Route application → Course administration: routes to (evidence: `client/src/App.jsx`)
- Route application → Playground editor: routes to (evidence: `client/src/App.jsx`)
- Course player → Quiz engine: renders
- Learner → Course community: participates
- Administrator → Course administration: manages courses (evidence: `README.md`)
- Auth context → API client: requests user (evidence: `client/src/context/AuthContext.jsx`)
- Playground editor → API client: submits code (evidence: `client/src/pages/EnginePlayground.jsx`)
- Playground editor → AI mentor panel: renders (evidence: `client/src/pages/EnginePlayground.jsx`)
- API client → Express application: calls API (evidence: `README.md`)
- Express application → Playground routes: mounts routes (evidence: `server/index.js`)
- Playground routes → JWT authentication: requires auth (evidence: `server/routes/playgroundRoutes.js`)
- Playground routes → Playground controller: dispatches (evidence: `server/routes/playgroundRoutes.js`)
- Playground controller → Job queue: enqueues jobs (evidence: `server/controllers/playgroundController.js`)
- Job queue → Redis: uses connection (evidence: `server/queues/playgroundQueue.js`)
- Execution worker → Code sandbox: executes code (evidence: `server/workers/playgroundWorker.js`)
- Execution worker → Live event service: streams events
- Execution worker → Progress service: awards mission XP (evidence: `server/workers/playgroundWorker.js`)
- Progress service → Progress records: reads and writes (evidence: `server/services/progressService.js`)
- Progress service → Course records: reads lessons (evidence: `server/services/progressService.js`)
- Learner dashboard → API client: loads learning data
- Course player → API client: loads lessons
- API client → Course records: serves course data (evidence: `README.md`)
- API client → User records: serves account data (evidence: `README.md`)
