# chinmoydeb/ai-exam-proctor architecture

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

- Interactive diagram: https://gitdiagram.com/chinmoydeb/ai-exam-proctor
- Repository: https://github.com/chinmoydeb/ai-exam-proctor

## Overview

This is a browser-only exam-proctoring dashboard. A candidate starts a webcam session; the application analyzes frames for face presence and attention, dispatches object detection to a worker, and presents detections and logged incidents in the dashboard. Incident evidence can be downloaded individually or exported as a ZIP. The source excerpts show the main control points, but omit some implementation details; documented capabilities are included where the README establishes them.

Main entry points: [`main.js`](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js) (Frame Loop), [`workers/yoloWorker.js`](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/workers/yoloWorker.js) (YOLO Worker), [`index.html`](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/index.html) (Dashboard UI), [`models/face_landmarker.task`](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/models/face_landmarker.task) (Face Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_session["Session and UI"]
  node_dashboard["Dashboard UI<br/>[index.html]"]
  node_session_control["Session Control<br/>[main.js]"]
  node_webcam["Webcam Stream"]
end

subgraph group_analysis["Frame Analysis"]
  node_frame_loop["Frame Loop<br/>[main.js]"]
  node_face_analysis["Face and Attention<br/>[main.js]"]
  node_object_dispatch["YOLO Dispatch<br/>[main.js]"]
  node_overlay["Detection Overlay<br/>[main.js]"]
end

subgraph group_incidents["Compliance Evidence"]
  node_violation_log["Violation Logging<br/>[main.js]"]
  node_snapshot["Evidence Snapshot<br/>[main.js]"]
  node_incident_feed["Incident Feed<br/>[index.html]"]
  node_image_download["Image Download<br/>[main.js]"]
  node_zip_export["ZIP Export<br/>[main.js]"]
end

subgraph group_runtime["Inference Runtime"]
  node_face_model["Face Model"]
  node_yolo_worker["YOLO Worker<br/>[yoloWorker.js]"]
  node_object_model["Object Model<br/>[yolo26s.onnx]"]
  node_browser_runtime["Browser Inference Runtime"]
end

node_candidate(("Candidate"))

node_candidate -->|"uses"| node_dashboard
node_dashboard -->|"starts controls"| node_session_control
node_session_control -->|"requests access"| node_webcam
node_webcam -.->|"provides frames"| node_frame_loop
node_session_control -.->|"starts loop"| node_frame_loop
node_frame_loop -->|"dispatches frames"| node_face_analysis
node_face_analysis -->|"loads model"| node_face_model
node_frame_loop -->|"dispatches frames"| node_object_dispatch
node_object_dispatch -->|"dispatches inference"| node_yolo_worker
node_yolo_worker -.->|"loads model"| node_object_model
node_yolo_worker -->|"runs inference"| node_browser_runtime
node_face_analysis -.->|"runs inference"| node_browser_runtime
node_face_analysis -->|"logs violations"| node_violation_log
node_yolo_worker -->|"returns detections"| node_object_dispatch
node_object_dispatch -.->|"logs detections"| node_violation_log
node_frame_loop -.->|"renders detections"| node_overlay
node_violation_log -->|"captures evidence"| node_snapshot
node_violation_log -->|"updates feed"| node_incident_feed
node_snapshot -->|"enables download"| node_image_download
node_incident_feed -->|"exports incidents"| node_zip_export
node_dashboard -->|"triggers export"| node_zip_export

click node_dashboard "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/index.html"
click node_session_control "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js"
click node_frame_loop "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js"
click node_face_analysis "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js"
click node_face_model "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/models/face_landmarker.task"
click node_object_dispatch "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js"
click node_yolo_worker "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/workers/yoloWorker.js"
click node_object_model "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/models/yolo26s.onnx"
click node_overlay "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js"
click node_violation_log "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js"
click node_snapshot "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js"
click node_incident_feed "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/index.html"
click node_image_download "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js"
click node_zip_export "https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.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_dashboard,node_session_control,node_webcam toneBlue
class node_frame_loop,node_face_analysis,node_object_dispatch,node_overlay toneAmber
class node_violation_log,node_snapshot,node_incident_feed,node_image_download,node_zip_export toneMint
class node_face_model,node_yolo_worker,node_object_model,node_browser_runtime toneRose
class node_candidate toneIndigo
```

## Components

### Session and UI

- [Dashboard UI](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/index.html): `index.html`
- [Session Control](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js): `main.js`
- **Webcam Stream**

### Frame Analysis

- [Frame Loop](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js): `main.js`
- [Face and Attention](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js): `main.js`
- [YOLO Dispatch](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js): `main.js`
- [Detection Overlay](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js): `main.js`

### Compliance Evidence

- [Violation Logging](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js): `main.js`
- [Evidence Snapshot](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js): `main.js`
- [Incident Feed](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/index.html): `index.html`
- [Image Download](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js): `main.js`
- [ZIP Export](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/main.js): `main.js`

### Inference Runtime

- [Face Model](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/models/face_landmarker.task): `models/face_landmarker.task`
- [YOLO Worker](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/workers/yoloWorker.js): `workers/yoloWorker.js`
- [Object Model](https://github.com/chinmoydeb/ai-exam-proctor/blob/main/models/yolo26s.onnx): `models/yolo26s.onnx`
- **Browser Inference Runtime**

### Other components

- **Candidate**

## Connections

- Candidate → Dashboard UI: uses (evidence: `README.md`)
- Dashboard UI → Session Control: starts controls (evidence: `main.js`)
- Session Control → Webcam Stream: requests access (evidence: `main.js`)
- Webcam Stream → Frame Loop: provides frames
- Session Control → Frame Loop: starts loop (evidence: `main.js`)
- Frame Loop → Face and Attention: dispatches frames (evidence: `main.js`)
- Face and Attention → Face Model: loads model (evidence: `main.js`)
- Frame Loop → YOLO Dispatch: dispatches frames (evidence: `main.js`)
- YOLO Dispatch → YOLO Worker: dispatches inference (evidence: `main.js`)
- YOLO Worker → Object Model: loads model
- YOLO Worker → Browser Inference Runtime: runs inference (evidence: `workers/yoloWorker.js`)
- Face and Attention → Browser Inference Runtime: runs inference
- Face and Attention → Violation Logging: logs violations (evidence: `README.md`)
- YOLO Worker → YOLO Dispatch: returns detections (evidence: `main.js`)
- YOLO Dispatch → Violation Logging: logs detections (evidence: `main.js`)
- Frame Loop → Detection Overlay: renders detections (evidence: `main.js`)
- Violation Logging → Evidence Snapshot: captures evidence (evidence: `main.js`)
- Violation Logging → Incident Feed: updates feed (evidence: `README.md`)
- Evidence Snapshot → Image Download: enables download (evidence: `README.md`)
- Incident Feed → ZIP Export: exports incidents (evidence: `main.js`)
- Dashboard UI → ZIP Export: triggers export (evidence: `main.js`)
