# gaurav-patil-13/vigilexam architecture

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

- Interactive diagram: https://gitdiagram.com/gaurav-patil-13/vigilexam
- Repository: https://github.com/gaurav-patil-13/vigilexam

## Overview

VigilExam is a desktop exam and live-proctoring platform. A student signs in, selects an exam, completes a camera/system pre-check, then starts an attempt and takes it under biometric, network, clipboard, and kiosk monitoring. Security telemetry reaches the backend for live proctoring and audit; proctors can issue warnings or terminate attempts, while administrators review users and audit data. The graph follows documented and excerpted entry points; several capability links are documented by the README or only implied by unsampled modules, so uncertain runtime connections are omitted.

Main entry points: [`src/App.jsx`](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/App.jsx) (Role Navigation), [`src/pages/student/ExamKiosk.jsx`](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/student/ExamKiosk.jsx) (Exam Kiosk UI), [`electron/main.js`](https://github.com/gaurav-patil-13/vigilexam/blob/main/electron/main.js) (Electron Main), [`src/config/api.js`](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/config/api.js) (HTTP API Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Exam Client"]
  node_app["Role Navigation<br/>[App.jsx]"]
  node_login["Sign-in<br/>[Login.jsx]"]
  node_studentdash["Student Dashboard"]
  node_precheck["Exam Pre-check<br/>[PreCheckRoom.jsx]"]
  node_exam["Exam Kiosk UI<br/>[ExamKiosk.jsx]"]
  node_result["Exam Result<br/>[ExamResult.jsx]"]
  node_proctordash["Proctor Dashboard"]
  node_admindash["Admin Dashboard<br/>[AdminDashboard.jsx]"]
end

subgraph group_security["Security Monitoring"]
  node_face["Face Detection<br/>[faceMonitor.js]"]
  node_risk["Risk Scoring<br/>[riskEngine.js]"]
  node_clipboard["Clipboard Guard"]
  node_securityhook["Security Telemetry"]
end

subgraph group_desktop["Desktop Controls"]
  node_process["Process Monitoring<br/>[processMonitor.js]"]
  node_kiosk["Kiosk Lockdown<br/>[kioskManager.js]"]
  node_electron["Electron Main<br/>[main.js]"]
  node_display["Display Monitoring<br/>[displayMonitor.js]"]
  node_panel["Process Check Panel"]
end

subgraph group_operations["Platform Services"]
  node_auth["Authentication State<br/>[AuthContext.jsx]"]
  node_api["HTTP API Client<br/>[api.js]"]
  node_server["API and Socket Server<br/>[index.js]"]
  node_db[("Exam Data Store<br/>[db.js]")]
  node_socketctx["Socket Connection<br/>[SocketContext.jsx]"]
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 -->|"wraps"| node_auth
node_app -->|"wraps"| node_socketctx
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_studentdash
node_app -->|"routes to"| node_precheck
node_app -->|"routes to"| node_exam
node_app -->|"routes to"| node_result
node_app -->|"routes to"| node_proctordash
node_app -->|"routes to"| node_admindash
node_login -->|"authenticates via"| node_auth
node_auth -->|"calls"| node_api
node_api -->|"HTTP requests"| node_server
node_server -->|"reads/writes"| node_db
node_precheck -->|"checks camera"| node_face
node_precheck -->|"presents process check"| node_panel
node_exam -->|"enforces policy"| node_clipboard
node_exam -->|"monitors candidate"| node_face
node_exam -->|"starts telemetry"| node_securityhook
node_securityhook -->|"emits heartbeat"| node_socketctx
node_securityhook -->|"acknowledges warnings"| node_api
node_socketctx -->|"connects"| node_server
node_proctordash -->|"uses live events"| node_socketctx
node_admindash -->|"requests audit data"| node_api
node_electron -->|"dispatches scans"| node_process
node_electron -->|"configures window"| node_kiosk
node_electron -->|"configures window"| node_display
node_process -->|"returns scan results"| node_electron
node_panel -.->|"requests process check"| node_electron
node_risk -.->|"supplies risk assessment"| node_exam

click node_app "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/App.jsx"
click node_login "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/Login.jsx"
click node_studentdash "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/student/StudentDashboard.jsx"
click node_precheck "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/student/PreCheckRoom.jsx"
click node_exam "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/student/ExamKiosk.jsx"
click node_result "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/student/ExamResult.jsx"
click node_proctordash "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/proctor/ProctorDashboard.jsx"
click node_admindash "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/admin/AdminDashboard.jsx"
click node_auth "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/context/AuthContext.jsx"
click node_api "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/config/api.js"
click node_server "https://github.com/gaurav-patil-13/vigilexam/blob/main/server/index.js"
click node_db "https://github.com/gaurav-patil-13/vigilexam/blob/main/server/db.js"
click node_socketctx "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/context/SocketContext.jsx"
click node_face "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/security/faceMonitor.js"
click node_risk "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/security/riskEngine.js"
click node_clipboard "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/utils/clipboardSecurity.js"
click node_securityhook "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/hooks/useSecurityMonitor.js"
click node_process "https://github.com/gaurav-patil-13/vigilexam/blob/main/electron/processMonitor.js"
click node_kiosk "https://github.com/gaurav-patil-13/vigilexam/blob/main/electron/kioskManager.js"
click node_electron "https://github.com/gaurav-patil-13/vigilexam/blob/main/electron/main.js"
click node_display "https://github.com/gaurav-patil-13/vigilexam/blob/main/electron/displayMonitor.js"
click node_panel "https://github.com/gaurav-patil-13/vigilexam/blob/main/src/components/ProcessManagementPanel.jsx"

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_login,node_studentdash,node_precheck,node_exam,node_result,node_proctordash,node_admindash toneBlue
class node_face,node_risk,node_clipboard,node_securityhook toneAmber
class node_process,node_kiosk,node_electron,node_display,node_panel toneMint
class node_auth,node_api,node_server,node_db,node_socketctx toneRose
class node_student,node_proctor,node_admin toneIndigo
```

## Components

### Exam Client

- [Role Navigation](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/App.jsx): `src/App.jsx`
- [Sign-in](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Student Dashboard](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/student/StudentDashboard.jsx): `src/pages/student/StudentDashboard.jsx`
- [Exam Pre-check](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/student/PreCheckRoom.jsx): `src/pages/student/PreCheckRoom.jsx`
- [Exam Kiosk UI](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/student/ExamKiosk.jsx): `src/pages/student/ExamKiosk.jsx`
- [Exam Result](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/student/ExamResult.jsx): `src/pages/student/ExamResult.jsx`
- [Proctor Dashboard](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/proctor/ProctorDashboard.jsx): `src/pages/proctor/ProctorDashboard.jsx`
- [Admin Dashboard](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/pages/admin/AdminDashboard.jsx): `src/pages/admin/AdminDashboard.jsx`

### Security Monitoring

- [Face Detection](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/security/faceMonitor.js): `src/security/faceMonitor.js`
- [Risk Scoring](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/security/riskEngine.js): `src/security/riskEngine.js`
- [Clipboard Guard](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/utils/clipboardSecurity.js): `src/utils/clipboardSecurity.js`
- [Security Telemetry](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/hooks/useSecurityMonitor.js): `src/hooks/useSecurityMonitor.js`

### Desktop Controls

- [Process Monitoring](https://github.com/gaurav-patil-13/vigilexam/blob/main/electron/processMonitor.js): `electron/processMonitor.js`
- [Kiosk Lockdown](https://github.com/gaurav-patil-13/vigilexam/blob/main/electron/kioskManager.js): `electron/kioskManager.js`
- [Electron Main](https://github.com/gaurav-patil-13/vigilexam/blob/main/electron/main.js): `electron/main.js`
- [Display Monitoring](https://github.com/gaurav-patil-13/vigilexam/blob/main/electron/displayMonitor.js): `electron/displayMonitor.js`
- [Process Check Panel](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/components/ProcessManagementPanel.jsx): `src/components/ProcessManagementPanel.jsx`

### Platform Services

- [Authentication State](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [HTTP API Client](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/config/api.js): `src/config/api.js`
- [API and Socket Server](https://github.com/gaurav-patil-13/vigilexam/blob/main/server/index.js): `server/index.js`
- [Exam Data Store](https://github.com/gaurav-patil-13/vigilexam/blob/main/server/db.js): `server/db.js`
- [Socket Connection](https://github.com/gaurav-patil-13/vigilexam/blob/main/src/context/SocketContext.jsx): `src/context/SocketContext.jsx`

### Other components

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

## Connections

- Student → Role Navigation: uses (evidence: `README.md`)
- Proctor → Role Navigation: uses (evidence: `README.md`)
- Administrator → Role Navigation: uses (evidence: `README.md`)
- Role Navigation → Authentication State: wraps (evidence: `src/App.jsx`)
- Role Navigation → Socket Connection: wraps (evidence: `src/App.jsx`)
- Role Navigation → Sign-in: routes to (evidence: `src/App.jsx`)
- Role Navigation → Student Dashboard: routes to (evidence: `src/App.jsx`)
- Role Navigation → Exam Pre-check: routes to (evidence: `src/App.jsx`)
- Role Navigation → Exam Kiosk UI: routes to (evidence: `src/App.jsx`)
- Role Navigation → Exam Result: routes to (evidence: `src/App.jsx`)
- Role Navigation → Proctor Dashboard: routes to (evidence: `src/App.jsx`)
- Role Navigation → Admin Dashboard: routes to (evidence: `src/App.jsx`)
- Sign-in → Authentication State: authenticates via (evidence: `src/pages/Login.jsx`)
- Authentication State → HTTP API Client: calls (evidence: `src/context/AuthContext.jsx`)
- HTTP API Client → API and Socket Server: HTTP requests (evidence: `src/config/api.js`)
- API and Socket Server → Exam Data Store: reads/writes (evidence: `server/index.js`)
- Exam Pre-check → Face Detection: checks camera (evidence: `src/pages/student/PreCheckRoom.jsx`)
- Exam Pre-check → Process Check Panel: presents process check (evidence: `src/pages/student/PreCheckRoom.jsx`)
- Exam Kiosk UI → Clipboard Guard: enforces policy (evidence: `src/pages/student/ExamKiosk.jsx`)
- Exam Kiosk UI → Face Detection: monitors candidate (evidence: `src/pages/student/ExamKiosk.jsx`)
- Exam Kiosk UI → Security Telemetry: starts telemetry (evidence: `src/pages/student/ExamKiosk.jsx`)
- Security Telemetry → Socket Connection: emits heartbeat (evidence: `src/hooks/useSecurityMonitor.js`)
- Security Telemetry → HTTP API Client: acknowledges warnings (evidence: `src/hooks/useSecurityMonitor.js`)
- Socket Connection → API and Socket Server: connects (evidence: `src/context/SocketContext.jsx`)
- Proctor Dashboard → Socket Connection: uses live events (evidence: `src/pages/proctor/ProctorDashboard.jsx`)
- Admin Dashboard → HTTP API Client: requests audit data (evidence: `src/pages/admin/AdminDashboard.jsx`)
- Electron Main → Process Monitoring: dispatches scans (evidence: `electron/main.js`)
- Electron Main → Kiosk Lockdown: configures window (evidence: `electron/main.js`)
- Electron Main → Display Monitoring: configures window (evidence: `electron/main.js`)
- Process Monitoring → Electron Main: returns scan results (evidence: `electron/main.js`)
- Process Check Panel → Electron Main: requests process check
- Risk Scoring → Exam Kiosk UI: supplies risk assessment (evidence: `src/pages/student/ExamKiosk.jsx`)
