# rugved0014/vigilexam architecture

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

## Overview

VigilExam is a desktop-and-web examination platform with role-based student, proctor, and administrator workflows. Students sign in, select an assigned test, complete a pre-check, start an attempt, take the exam, and view a result; proctors monitor live candidates and can warn or terminate attempts, while administrators manage exams and review analytics. The backend exposes HTTP and Socket.IO services backed by a JSON file store. The README describes native process monitoring and kiosk lockdown, but the sampled Electron excerpts do not show their implementation or wiring.

Main entry points: [`src/App.jsx`](https://github.com/rugved0014/vigilexam/blob/main/src/App.jsx) (Role router), [`server/index.js`](https://github.com/rugved0014/vigilexam/blob/main/server/index.js) (HTTP and socket server), [`src/context/AuthContext.jsx`](https://github.com/rugved0014/vigilexam/blob/main/src/context/AuthContext.jsx) (Authentication state), [`src/pages/student/ExamKiosk.jsx`](https://github.com/rugved0014/vigilexam/blob/main/src/pages/student/ExamKiosk.jsx) (Exam kiosk)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["Role router<br/>[App.jsx]"]
  node_auth["Authentication state<br/>[AuthContext.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
  node_socketctx["Socket connection<br/>[SocketContext.jsx]"]
  node_electron["Desktop shell<br/>[main.js]"]
  node_nativeguard["OS monitoring and kiosk<br/>[main.js]"]
end

subgraph group_exam["Exam workflow"]
  node_studentdash["Student dashboard"]
  node_precheck["Pre-exam check<br/>[PreCheckRoom.jsx]"]
  node_kiosk["Exam kiosk<br/>[ExamKiosk.jsx]"]
  node_result["Exam result<br/>[ExamResult.jsx]"]
end

subgraph group_oversight["Operations and oversight"]
  node_proctordash["Live proctoring"]
  node_admindash["Admin console<br/>[AdminDashboard.jsx]"]
end

subgraph group_backend["Backend services"]
  node_api["HTTP and socket server<br/>[index.js]"]
  node_store[("JSON data store<br/>[db.js]")]
end

node_student(("Student"))
node_proctor(("Proctor"))
node_admin(("Administrator"))

node_student -->|"uses"| node_app
node_proctor -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"provides socket"| node_socketctx
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_login
node_login -->|"signs in"| node_auth
node_auth -->|"requests login"| node_api
node_app -->|"routes student"| node_studentdash
node_studentdash -->|"starts pre-check"| node_app
node_app -->|"renders pre-check"| node_precheck
node_precheck -->|"proceeds"| node_app
node_app -->|"starts attempt"| node_api
node_app -->|"renders exam"| node_kiosk
node_kiosk -->|"submits result"| node_app
node_app -->|"renders result"| node_result
node_app -->|"routes proctor"| node_proctordash
node_app -->|"routes admin"| node_admindash
node_navbar -->|"logs out"| node_auth
node_navbar -->|"shows connection"| node_socketctx
node_socketctx -->|"connects socket"| node_api
node_proctordash -.->|"monitors and acts"| node_api
node_admindash -.->|"manages exams"| node_api
node_api -->|"reads and writes"| node_store
node_api -->|"streams alerts"| node_proctordash
node_api -->|"sends termination"| node_kiosk
node_electron -.->|"hosts capability"| node_nativeguard
node_nativeguard -.->|"enforces lockdown"| node_kiosk

click node_app "https://github.com/rugved0014/vigilexam/blob/main/src/App.jsx"
click node_auth "https://github.com/rugved0014/vigilexam/blob/main/src/context/AuthContext.jsx"
click node_login "https://github.com/rugved0014/vigilexam/blob/main/src/pages/Login.jsx"
click node_navbar "https://github.com/rugved0014/vigilexam/blob/main/src/components/Navbar.jsx"
click node_socketctx "https://github.com/rugved0014/vigilexam/blob/main/src/context/SocketContext.jsx"
click node_studentdash "https://github.com/rugved0014/vigilexam/blob/main/src/pages/student/StudentDashboard.jsx"
click node_precheck "https://github.com/rugved0014/vigilexam/blob/main/src/pages/student/PreCheckRoom.jsx"
click node_kiosk "https://github.com/rugved0014/vigilexam/blob/main/src/pages/student/ExamKiosk.jsx"
click node_result "https://github.com/rugved0014/vigilexam/blob/main/src/pages/student/ExamResult.jsx"
click node_proctordash "https://github.com/rugved0014/vigilexam/blob/main/src/pages/proctor/ProctorDashboard.jsx"
click node_admindash "https://github.com/rugved0014/vigilexam/blob/main/src/pages/admin/AdminDashboard.jsx"
click node_electron "https://github.com/rugved0014/vigilexam/blob/main/electron/main.js"
click node_nativeguard "https://github.com/rugved0014/vigilexam/blob/main/electron/main.js"
click node_api "https://github.com/rugved0014/vigilexam/blob/main/server/index.js"
click node_store "https://github.com/rugved0014/vigilexam/blob/main/server/db.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_auth,node_login,node_navbar,node_socketctx,node_electron,node_nativeguard toneBlue
class node_studentdash,node_precheck,node_kiosk,node_result toneAmber
class node_proctordash,node_admindash toneMint
class node_api,node_store toneRose
class node_student,node_proctor,node_admin toneIndigo
```

## Components

### Client experience

- [Role router](https://github.com/rugved0014/vigilexam/blob/main/src/App.jsx): `src/App.jsx`
- [Authentication state](https://github.com/rugved0014/vigilexam/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Login](https://github.com/rugved0014/vigilexam/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Navigation bar](https://github.com/rugved0014/vigilexam/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Socket connection](https://github.com/rugved0014/vigilexam/blob/main/src/context/SocketContext.jsx): `src/context/SocketContext.jsx`
- [Desktop shell](https://github.com/rugved0014/vigilexam/blob/main/electron/main.js): `electron/main.js`
- [OS monitoring and kiosk](https://github.com/rugved0014/vigilexam/blob/main/electron/main.js): `electron/main.js`

### Exam workflow

- [Student dashboard](https://github.com/rugved0014/vigilexam/blob/main/src/pages/student/StudentDashboard.jsx): `src/pages/student/StudentDashboard.jsx`
- [Pre-exam check](https://github.com/rugved0014/vigilexam/blob/main/src/pages/student/PreCheckRoom.jsx): `src/pages/student/PreCheckRoom.jsx`
- [Exam kiosk](https://github.com/rugved0014/vigilexam/blob/main/src/pages/student/ExamKiosk.jsx): `src/pages/student/ExamKiosk.jsx`
- [Exam result](https://github.com/rugved0014/vigilexam/blob/main/src/pages/student/ExamResult.jsx): `src/pages/student/ExamResult.jsx`

### Operations and oversight

- [Live proctoring](https://github.com/rugved0014/vigilexam/blob/main/src/pages/proctor/ProctorDashboard.jsx): `src/pages/proctor/ProctorDashboard.jsx`
- [Admin console](https://github.com/rugved0014/vigilexam/blob/main/src/pages/admin/AdminDashboard.jsx): `src/pages/admin/AdminDashboard.jsx`

### Backend services

- [HTTP and socket server](https://github.com/rugved0014/vigilexam/blob/main/server/index.js): `server/index.js`
- [JSON data store](https://github.com/rugved0014/vigilexam/blob/main/server/db.js): `server/db.js`

### Other components

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

## Connections

- Student → Role router: uses (evidence: `src/App.jsx`)
- Proctor → Role router: uses (evidence: `src/App.jsx`)
- Administrator → Role router: uses (evidence: `src/App.jsx`)
- Role router → Authentication state: provides auth (evidence: `src/App.jsx`)
- Role router → Socket connection: provides socket (evidence: `src/App.jsx`)
- Role router → Navigation bar: renders (evidence: `src/App.jsx`)
- Role router → Login: renders (evidence: `src/App.jsx`)
- Login → Authentication state: signs in (evidence: `src/pages/Login.jsx`)
- Authentication state → HTTP and socket server: requests login (evidence: `src/context/AuthContext.jsx`)
- Role router → Student dashboard: routes student (evidence: `src/App.jsx`)
- Student dashboard → Role router: starts pre-check (evidence: `src/App.jsx`)
- Role router → Pre-exam check: renders pre-check (evidence: `src/App.jsx`)
- Pre-exam check → Role router: proceeds (evidence: `src/App.jsx`)
- Role router → HTTP and socket server: starts attempt (evidence: `src/App.jsx`)
- Role router → Exam kiosk: renders exam (evidence: `src/App.jsx`)
- Exam kiosk → Role router: submits result (evidence: `src/App.jsx`)
- Role router → Exam result: renders result (evidence: `src/App.jsx`)
- Role router → Live proctoring: routes proctor (evidence: `src/App.jsx`)
- Role router → Admin console: routes admin (evidence: `src/App.jsx`)
- Navigation bar → Authentication state: logs out (evidence: `src/components/Navbar.jsx`)
- Navigation bar → Socket connection: shows connection (evidence: `src/components/Navbar.jsx`)
- Socket connection → HTTP and socket server: connects socket (evidence: `src/context/SocketContext.jsx`)
- Live proctoring → HTTP and socket server: monitors and acts
- Admin console → HTTP and socket server: manages exams
- HTTP and socket server → JSON data store: reads and writes (evidence: `server/index.js`)
- HTTP and socket server → Live proctoring: streams alerts (evidence: `README.md`)
- HTTP and socket server → Exam kiosk: sends termination (evidence: `server/index.js`)
- Desktop shell → OS monitoring and kiosk: hosts capability (evidence: `electron/main.js`)
- OS monitoring and kiosk → Exam kiosk: enforces lockdown
