# naghulpranav05/online-examination-system architecture

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

- Interactive diagram: https://gitdiagram.com/naghulpranav05/online-examination-system
- Repository: https://github.com/naghulpranav05/online-examination-system

## Overview

Online Examination Portal provides admin authoring and monitoring, plus student exam-taking, coding evaluation, study materials, and results. The main flow is student authentication and exam selection, timed MCQ/coding work, submission and scoring, then result review; admins manage subjects, questions, exams, and students. The graph combines README capabilities with sampled source and SOURCE INDEX references; unsampled page and controller details limit some relationships.

Main entry points: [`frontend/src/App.jsx`](https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/App.jsx) (Portal navigation), [`frontend/src/services/api.js`](https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/services/api.js) (API client), [`backend/server.js`](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/server.js) (HTTP API server), [`backend/controllers/resultController.js`](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/resultController.js) (Submission and scoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_portal["Portal navigation<br/>[App.jsx]"]
  node_authpages["Sign-in and registration<br/>[Login.jsx]"]
  node_studentpages["Student portal"]
  node_adminpages["Admin workspace<br/>[AdminDashboard.jsx]"]
  node_examui["Timed exam interface<br/>[ExamInterface.jsx]"]
  node_codeeditor["Code editor<br/>[CodeEditor.jsx]"]
  node_proctor["Exam monitoring<br/>[FaceMonitor.jsx]"]
  node_resultui["Results review<br/>[ResultView.jsx]"]
  node_materialsui["Study materials<br/>[StudyMaterials.jsx]"]
  node_api["API client<br/>[api.js]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Authentication<br/>[authController.js]"]
  node_access["Route authorization<br/>[authMiddleware.js]"]
end

subgraph group_authoring["Exam authoring"]
  node_subjects["Subject management"]
  node_questions["Question bank and generation"]
  node_ai["AI question generation<br/>[aiService.js]"]
  node_exams["Exam management<br/>[examController.js]"]
  node_materials["Material management"]
end

subgraph group_delivery["Exam delivery"]
  node_submission["Submission and scoring"]
  node_executor["Code evaluation<br/>[codeExecutor.js]"]
  node_analytics["Results analytics"]
end

subgraph group_platform["API and persistence"]
  node_server["HTTP API server<br/>[server.js]"]
  node_authroute["Authentication routes<br/>[authRoutes.js]"]
  node_questionroute["Question routes<br/>[questionRoutes.js]"]
  node_examroute["Exam routes<br/>[examRoutes.js]"]
  node_resultroute["Result routes<br/>[resultRoutes.js]"]
  node_materialroute["Material routes<br/>[materialRoutes.js]"]
  node_database[("MongoDB records")]
  node_userdata["User records<br/>[User.js]"]
  node_questiondata["Question records<br/>[Question.js]"]
  node_examdata["Exam records<br/>[Exam.js]"]
  node_resultdata["Result records<br/>[Result.js]"]
  node_subjectdata["Subject records<br/>[Subject.js]"]
end

node_student(("Student"))
node_admin(("Administrator"))

node_student -->|"uses"| node_portal
node_admin -->|"uses"| node_portal
node_portal -->|"routes to"| node_authpages
node_portal -->|"routes to"| node_studentpages
node_portal -->|"routes to"| node_adminpages
node_portal -->|"routes to"| node_examui
node_portal -->|"routes to"| node_resultui
node_portal -->|"routes to"| node_materialsui
node_authpages -->|"calls"| node_api
node_studentpages -.->|"calls"| node_api
node_adminpages -->|"calls"| node_api
node_examui -->|"renders"| node_codeeditor
node_examui -->|"renders"| node_proctor
node_examui -->|"calls"| node_api
node_resultui -->|"calls"| node_api
node_materialsui -.->|"calls"| node_api
node_api -->|"sends API requests"| node_server
node_server -->|"mounts"| node_authroute
node_server -->|"mounts"| node_questionroute
node_server -->|"mounts"| node_examroute
node_server -->|"mounts"| node_resultroute
node_server -->|"mounts"| node_materialroute
node_authroute -->|"dispatches"| node_auth
node_authroute -->|"protects"| node_access
node_questionroute -->|"dispatches"| node_questions
node_examroute -->|"dispatches"| node_exams
node_resultroute -->|"dispatches"| node_submission
node_materialroute -->|"dispatches"| node_materials
node_materialroute -->|"protects"| node_access
node_auth -->|"reads and writes"| node_userdata
node_access -->|"loads user"| node_userdata
node_questions -->|"reads and writes"| node_questiondata
node_questions -->|"reads"| node_subjectdata
node_questions -->|"requests generation"| node_ai
node_exams -->|"reads and writes"| node_examdata
node_exams -->|"reads"| node_questiondata
node_materials -->|"persists materials"| node_database
node_submission -->|"loads exam"| node_examdata
node_submission -->|"loads questions"| node_questiondata
node_submission -->|"evaluates code"| node_executor
node_submission -->|"writes result"| node_resultdata
node_analytics -->|"aggregates"| node_resultdata
node_analytics -->|"counts students"| node_userdata
node_database -.->|"stores"| node_subjectdata

click node_portal "https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/App.jsx"
click node_authpages "https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/pages/Login.jsx"
click node_studentpages "https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/pages/StudentDashboard.jsx"
click node_adminpages "https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/pages/AdminDashboard.jsx"
click node_examui "https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/pages/ExamInterface.jsx"
click node_codeeditor "https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/components/CodeEditor.jsx"
click node_proctor "https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/components/FaceMonitor.jsx"
click node_resultui "https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/pages/ResultView.jsx"
click node_materialsui "https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/pages/StudyMaterials.jsx"
click node_api "https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/services/api.js"
click node_auth "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/authController.js"
click node_access "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/middleware/authMiddleware.js"
click node_subjects "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/subjectController.js"
click node_questions "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/questionController.js"
click node_ai "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/services/aiService.js"
click node_exams "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/examController.js"
click node_materials "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/materialController.js"
click node_submission "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/resultController.js"
click node_executor "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/services/codeExecutor.js"
click node_analytics "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/resultController.js"
click node_server "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/server.js"
click node_authroute "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/routes/authRoutes.js"
click node_questionroute "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/routes/questionRoutes.js"
click node_examroute "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/routes/examRoutes.js"
click node_resultroute "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/routes/resultRoutes.js"
click node_materialroute "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/routes/materialRoutes.js"
click node_userdata "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/models/User.js"
click node_questiondata "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/models/Question.js"
click node_examdata "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/models/Exam.js"
click node_resultdata "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/models/Result.js"
click node_subjectdata "https://github.com/naghulpranav05/online-examination-system/blob/main/backend/models/Subject.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_portal,node_authpages,node_studentpages,node_adminpages,node_examui,node_codeeditor,node_proctor,node_resultui,node_materialsui,node_api toneBlue
class node_auth,node_access toneAmber
class node_subjects,node_questions,node_ai,node_exams,node_materials toneMint
class node_submission,node_executor,node_analytics toneRose
class node_server,node_authroute,node_questionroute,node_examroute,node_resultroute,node_materialroute,node_database,node_userdata,node_questiondata,node_examdata,node_resultdata,node_subjectdata,node_student,node_admin toneIndigo
```

## Components

### Web application

- [Portal navigation](https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in and registration](https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Student portal](https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/pages/StudentDashboard.jsx): `frontend/src/pages/StudentDashboard.jsx`
- [Admin workspace](https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/pages/AdminDashboard.jsx): `frontend/src/pages/AdminDashboard.jsx`
- [Timed exam interface](https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/pages/ExamInterface.jsx): `frontend/src/pages/ExamInterface.jsx`
- [Code editor](https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/components/CodeEditor.jsx): `frontend/src/components/CodeEditor.jsx`
- [Exam monitoring](https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/components/FaceMonitor.jsx): `frontend/src/components/FaceMonitor.jsx`
- [Results review](https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/pages/ResultView.jsx): `frontend/src/pages/ResultView.jsx`
- [Study materials](https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/pages/StudyMaterials.jsx): `frontend/src/pages/StudyMaterials.jsx`
- [API client](https://github.com/naghulpranav05/online-examination-system/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Identity and access

- [Authentication](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Route authorization](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### Exam authoring

- [Subject management](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/subjectController.js): `backend/controllers/subjectController.js`
- [Question bank and generation](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/questionController.js): `backend/controllers/questionController.js`
- [AI question generation](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/services/aiService.js): `backend/services/aiService.js`
- [Exam management](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/examController.js): `backend/controllers/examController.js`
- [Material management](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/materialController.js): `backend/controllers/materialController.js`

### Exam delivery

- [Submission and scoring](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/resultController.js): `backend/controllers/resultController.js`
- [Code evaluation](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/services/codeExecutor.js): `backend/services/codeExecutor.js`
- [Results analytics](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/controllers/resultController.js): `backend/controllers/resultController.js`

### API and persistence

- [HTTP API server](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/server.js): `backend/server.js`
- [Authentication routes](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Question routes](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/routes/questionRoutes.js): `backend/routes/questionRoutes.js`
- [Exam routes](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/routes/examRoutes.js): `backend/routes/examRoutes.js`
- [Result routes](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/routes/resultRoutes.js): `backend/routes/resultRoutes.js`
- [Material routes](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/routes/materialRoutes.js): `backend/routes/materialRoutes.js`
- **MongoDB records**
- [User records](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/models/User.js): `backend/models/User.js`
- [Question records](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/models/Question.js): `backend/models/Question.js`
- [Exam records](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/models/Exam.js): `backend/models/Exam.js`
- [Result records](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/models/Result.js): `backend/models/Result.js`
- [Subject records](https://github.com/naghulpranav05/online-examination-system/blob/main/backend/models/Subject.js): `backend/models/Subject.js`

### Other components

- **Student**
- **Administrator**

## Connections

- Student → Portal navigation: uses (evidence: `README.md`)
- Administrator → Portal navigation: uses (evidence: `README.md`)
- Portal navigation → Sign-in and registration: routes to (evidence: `frontend/src/App.jsx`)
- Portal navigation → Student portal: routes to (evidence: `frontend/src/App.jsx`)
- Portal navigation → Admin workspace: routes to (evidence: `frontend/src/App.jsx`)
- Portal navigation → Timed exam interface: routes to (evidence: `frontend/src/App.jsx`)
- Portal navigation → Results review: routes to (evidence: `frontend/src/App.jsx`)
- Portal navigation → Study materials: routes to (evidence: `frontend/src/App.jsx`)
- Sign-in and registration → API client: calls (evidence: `frontend/src/pages/Login.jsx`)
- Student portal → API client: calls
- Admin workspace → API client: calls (evidence: `frontend/src/pages/AdminDashboard.jsx`)
- Timed exam interface → Code editor: renders (evidence: `frontend/src/pages/ExamInterface.jsx`)
- Timed exam interface → Exam monitoring: renders (evidence: `frontend/src/pages/ExamInterface.jsx`)
- Timed exam interface → API client: calls (evidence: `frontend/src/pages/ExamInterface.jsx`)
- Results review → API client: calls (evidence: `frontend/src/pages/ResultView.jsx`)
- Study materials → API client: calls
- API client → HTTP API server: sends API requests (evidence: `README.md`)
- HTTP API server → Authentication routes: mounts (evidence: `backend/server.js`)
- HTTP API server → Question routes: mounts (evidence: `backend/server.js`)
- HTTP API server → Exam routes: mounts (evidence: `backend/server.js`)
- HTTP API server → Result routes: mounts (evidence: `backend/server.js`)
- HTTP API server → Material routes: mounts (evidence: `backend/server.js`)
- Authentication routes → Authentication: dispatches (evidence: `backend/routes/authRoutes.js`)
- Authentication routes → Route authorization: protects (evidence: `backend/routes/authRoutes.js`)
- Question routes → Question bank and generation: dispatches (evidence: `backend/routes/questionRoutes.js`)
- Exam routes → Exam management: dispatches (evidence: `backend/routes/examRoutes.js`)
- Result routes → Submission and scoring: dispatches (evidence: `backend/routes/resultRoutes.js`)
- Material routes → Material management: dispatches (evidence: `backend/routes/materialRoutes.js`)
- Material routes → Route authorization: protects (evidence: `backend/routes/materialRoutes.js`)
- Authentication → User records: reads and writes (evidence: `backend/controllers/authController.js`)
- Route authorization → User records: loads user (evidence: `backend/middleware/authMiddleware.js`)
- Question bank and generation → Question records: reads and writes (evidence: `backend/controllers/questionController.js`)
- Question bank and generation → Subject records: reads (evidence: `backend/controllers/questionController.js`)
- Question bank and generation → AI question generation: requests generation (evidence: `backend/controllers/questionController.js`)
- Exam management → Exam records: reads and writes (evidence: `backend/controllers/examController.js`)
- Exam management → Question records: reads (evidence: `backend/controllers/examController.js`)
- Material management → MongoDB records: persists materials (evidence: `backend/controllers/materialController.js`)
- Submission and scoring → Exam records: loads exam (evidence: `backend/controllers/resultController.js`)
- Submission and scoring → Question records: loads questions (evidence: `backend/controllers/resultController.js`)
- Submission and scoring → Code evaluation: evaluates code (evidence: `backend/controllers/resultController.js`)
- Submission and scoring → Result records: writes result (evidence: `backend/controllers/resultController.js`)
- Results analytics → Result records: aggregates (evidence: `backend/controllers/resultController.js`)
- Results analytics → User records: counts students (evidence: `backend/controllers/resultController.js`)
- MongoDB records → Subject records: stores
