# priyanshuk143/ai-based-exam-proctoring architecture

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

- Interactive diagram: https://gitdiagram.com/priyanshuk143/ai-based-exam-proctoring
- Repository: https://github.com/priyanshuk143/ai-based-exam-proctoring

## Overview

This is a Flask online-exam and proctoring application. Teachers manage exams and questions; students register, take an exam, and receive scores. The main application also streams webcam frames and performs facial, gaze, and mouth checks. The graph combines sampled route and database behavior with major README capabilities; some route-level connections are documented rather than visible in the excerpts.

Main entry points: [`app.py`](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py) (Flask routes), [`logreg.db`](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/logreg.db) (Exam database), [`database.py`](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/database.py) (SQLite access), [`templates`](https://github.com/priyanshuk143/ai-based-exam-proctoring/tree/master/templates) (Web views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_flask["Flask routes<br/>[app.py]"]
  node_accounts["Account access<br/>[app.py]"]
  node_webviews["Web views"]
end

subgraph group_assessment["Exam and reporting"]
  node_examadmin["Exam management<br/>[app.py]"]
  node_testtaking["Exam attempt<br/>[app.py]"]
  node_scoring["Score reporting<br/>[app.py]"]
end

subgraph group_proctor["Video proctoring"]
  node_streamroute["Video endpoint<br/>[app.py]"]
  node_proctordetect["Behavior detection<br/>[app.py]"]
end

subgraph group_storage["Persistence"]
  node_dbhelper["SQLite access<br/>[database.py]"]
  node_examstore[("Exam database<br/>[logreg.db]")]
  node_teacherhelper["Teacher DB helper<br/>[teacherdb.py]"]
  node_teacherstore[("Teacher database<br/>[tealogreg.db]")]
end

node_student(("Student"))
node_teacher(("Teacher"))
node_webcam(("Webcam"))

node_student -->|"uses routes"| node_flask
node_teacher -->|"uses routes"| node_flask
node_flask -->|"dispatches"| node_accounts
node_flask -->|"renders"| node_webviews
node_flask -->|"dispatches"| node_examadmin
node_flask -->|"dispatches"| node_testtaking
node_flask -->|"dispatches"| node_scoring
node_flask -->|"routes to"| node_streamroute
node_streamroute -->|"generates frames"| node_proctordetect
node_webcam -->|"supplies video"| node_streamroute
node_flask -->|"uses"| node_dbhelper
node_dbhelper -->|"opens"| node_examstore
node_examadmin -->|"reads and writes"| node_examstore
node_testtaking -->|"reads questions"| node_examstore
node_scoring -->|"saves scores"| node_examstore

click node_flask "https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py"
click node_accounts "https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py"
click node_webviews "https://github.com/priyanshuk143/ai-based-exam-proctoring/tree/master/templates"
click node_examadmin "https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py"
click node_testtaking "https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py"
click node_scoring "https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py"
click node_streamroute "https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py"
click node_proctordetect "https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py"
click node_dbhelper "https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/database.py"
click node_examstore "https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/logreg.db"
click node_teacherhelper "https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/teacherdb.py"
click node_teacherstore "https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/tealogreg.db"

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_flask,node_accounts,node_webviews toneBlue
class node_examadmin,node_testtaking,node_scoring toneAmber
class node_streamroute,node_proctordetect toneMint
class node_dbhelper,node_examstore,node_teacherhelper,node_teacherstore toneRose
class node_student,node_teacher,node_webcam toneIndigo
```

## Components

### Web workflows

- [Flask routes](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py): `app.py`
- [Account access](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py): `app.py`
- [Web views](https://github.com/priyanshuk143/ai-based-exam-proctoring/tree/master/templates): `templates`

### Exam and reporting

- [Exam management](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py): `app.py`
- [Exam attempt](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py): `app.py`
- [Score reporting](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py): `app.py`

### Video proctoring

- [Video endpoint](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py): `app.py`
- [Behavior detection](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/app.py): `app.py`

### Persistence

- [SQLite access](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/database.py): `database.py`
- [Exam database](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/logreg.db): `logreg.db`
- [Teacher DB helper](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/teacherdb.py): `teacherdb.py`
- [Teacher database](https://github.com/priyanshuk143/ai-based-exam-proctoring/blob/master/tealogreg.db): `tealogreg.db`

### Other components

- **Student**
- **Teacher**
- **Webcam**

## Connections

- Student → Flask routes: uses routes (evidence: `README.md`)
- Teacher → Flask routes: uses routes (evidence: `README.md`)
- Flask routes → Account access: dispatches (evidence: `app.py`)
- Flask routes → Web views: renders (evidence: `app.py`)
- Flask routes → Exam management: dispatches (evidence: `README.md`)
- Flask routes → Exam attempt: dispatches (evidence: `README.md`)
- Flask routes → Score reporting: dispatches (evidence: `app.py`)
- Flask routes → Video endpoint: routes to (evidence: `app.py`)
- Video endpoint → Behavior detection: generates frames (evidence: `app.py`)
- Webcam → Video endpoint: supplies video (evidence: `app.py`)
- Flask routes → SQLite access: uses (evidence: `app.py`)
- SQLite access → Exam database: opens (evidence: `database.py`)
- Exam management → Exam database: reads and writes (evidence: `README.md`)
- Exam attempt → Exam database: reads questions (evidence: `app.py`)
- Score reporting → Exam database: saves scores (evidence: `app.py`)
