# musipatlaharicharan/ai-exam architecture

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

## Overview

AegisProctor is a browser-based exam-proctoring simulation. Users authorize camera, microphone, and screen capture, then navigate a mock exam; simulated monitoring alerts can trigger a lockdown. The sampled code shows media acquisition, exam rendering, alert handling, and stream recovery in one client module, plus a small static-file server. The README is empty, and some app.js excerpts omit function bodies, so the graph avoids asserting unshown exam-submission or detection behavior.

Main entry points: [`app.js`](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js) (Client orchestrator), [`server.js`](https://github.com/musipatlaharicharan/ai-exam/blob/main/server.js) (Static file server), [`index.html`](https://github.com/musipatlaharicharan/ai-exam/blob/main/index.html) (Exam page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_delivery["Local delivery"]
  node_web_server["Static file server<br/>[server.js]"]
  node_page["Exam page<br/>[index.html]"]
end

subgraph group_client["Exam client"]
  node_orchestrator["Client orchestrator<br/>[app.js]"]
end

subgraph group_monitoring["Media monitoring"]
  node_media_api["Browser media APIs"]
  node_camera["Camera access<br/>[app.js]"]
  node_microphone["Microphone access<br/>[app.js]"]
  node_audio_visualizer["Audio visualizer<br/>[app.js]"]
  node_screen_share["Screen sharing<br/>[app.js]"]
  node_stream_recovery["Stream recovery<br/>[app.js]"]
  node_violation_handling["Violation handling<br/>[app.js]"]
  node_incident_console["Incident console<br/>[app.js]"]
  node_lockdown["Exam lockdown<br/>[app.js]"]
  node_permission_help["Permission troubleshooting<br/>[app.js]"]
end

subgraph group_exam["Mock exam"]
  node_exam_controls["Exam controls<br/>[app.js]"]
  node_question_rendering["Question rendering<br/>[app.js]"]
  node_answer_selection["Answer selection<br/>[app.js]"]
end

node_candidate(("Candidate"))

node_candidate -->|"requests page"| node_web_server
node_web_server -->|"serves page"| node_page
node_candidate -->|"uses controls"| node_orchestrator
node_orchestrator -->|"binds controls"| node_camera
node_orchestrator -->|"binds controls"| node_microphone
node_orchestrator -->|"binds controls"| node_screen_share
node_camera -->|"acquires stream"| node_media_api
node_microphone -->|"acquires stream"| node_media_api
node_screen_share -->|"acquires stream"| node_media_api
node_microphone -->|"initializes"| node_audio_visualizer
node_orchestrator -->|"binds controls"| node_exam_controls
node_exam_controls -->|"renders question"| node_question_rendering
node_question_rendering -->|"selects option"| node_answer_selection
node_candidate -->|"triggers test alert"| node_violation_handling
node_violation_handling -->|"logs alert"| node_incident_console
node_violation_handling -->|"locks exam"| node_lockdown
node_stream_recovery -->|"reacquires stream"| node_media_api
node_candidate -->|"closes help"| node_permission_help

click node_web_server "https://github.com/musipatlaharicharan/ai-exam/blob/main/server.js"
click node_page "https://github.com/musipatlaharicharan/ai-exam/blob/main/index.html"
click node_orchestrator "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js"
click node_camera "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js"
click node_microphone "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js"
click node_audio_visualizer "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js"
click node_screen_share "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js"
click node_stream_recovery "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js"
click node_exam_controls "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js"
click node_question_rendering "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js"
click node_answer_selection "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js"
click node_violation_handling "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js"
click node_incident_console "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js"
click node_lockdown "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js"
click node_permission_help "https://github.com/musipatlaharicharan/ai-exam/blob/main/app.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_web_server,node_page toneBlue
class node_orchestrator toneAmber
class node_media_api,node_camera,node_microphone,node_audio_visualizer,node_screen_share,node_stream_recovery,node_violation_handling,node_incident_console,node_lockdown,node_permission_help toneMint
class node_exam_controls,node_question_rendering,node_answer_selection toneRose
class node_candidate toneIndigo
```

## Components

### Local delivery

- [Static file server](https://github.com/musipatlaharicharan/ai-exam/blob/main/server.js): `server.js`
- [Exam page](https://github.com/musipatlaharicharan/ai-exam/blob/main/index.html): `index.html`

### Exam client

- [Client orchestrator](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`

### Media monitoring

- **Browser media APIs**
- [Camera access](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`
- [Microphone access](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`
- [Audio visualizer](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`
- [Screen sharing](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`
- [Stream recovery](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`
- [Violation handling](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`
- [Incident console](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`
- [Exam lockdown](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`
- [Permission troubleshooting](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`

### Mock exam

- [Exam controls](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`
- [Question rendering](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`
- [Answer selection](https://github.com/musipatlaharicharan/ai-exam/blob/main/app.js): `app.js`

### Other components

- **Candidate**

## Connections

- Candidate → Static file server: requests page (evidence: `server.js`)
- Static file server → Exam page: serves page (evidence: `server.js`)
- Candidate → Client orchestrator: uses controls (evidence: `app.js`)
- Client orchestrator → Camera access: binds controls (evidence: `app.js`)
- Client orchestrator → Microphone access: binds controls (evidence: `app.js`)
- Client orchestrator → Screen sharing: binds controls (evidence: `app.js`)
- Camera access → Browser media APIs: acquires stream (evidence: `app.js`)
- Microphone access → Browser media APIs: acquires stream (evidence: `app.js`)
- Screen sharing → Browser media APIs: acquires stream (evidence: `app.js`)
- Microphone access → Audio visualizer: initializes (evidence: `app.js`)
- Client orchestrator → Exam controls: binds controls (evidence: `app.js`)
- Exam controls → Question rendering: renders question (evidence: `app.js`)
- Question rendering → Answer selection: selects option (evidence: `app.js`)
- Candidate → Violation handling: triggers test alert (evidence: `app.js`)
- Violation handling → Incident console: logs alert (evidence: `app.js`)
- Violation handling → Exam lockdown: locks exam (evidence: `app.js`)
- Stream recovery → Browser media APIs: reacquires stream (evidence: `app.js`)
- Candidate → Permission troubleshooting: closes help (evidence: `app.js`)
