# 2k25cse2513722-maker/techexpo architecture

> Architecture diagram of the GitHub repository 2k25cse2513722-maker/techexpo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/2k25cse2513722-maker/techexpo
- Repository: https://github.com/2k25cse2513722-maker/techexpo

## Overview

CampusVision AI combines campus occupancy monitoring with a face-recognition and attendance workflow. The documented flow is camera capture → person/face analysis → backend telemetry and annotated frames → dashboard; the backend also serves authentication, room and corridor status, timetable checks, alerts, and reports. The sampled source confirms detection uploads and several backend/database interactions. README describes some capabilities whose implementation details were not sampled, so those subsystems are shown without speculative internal wiring.

Main entry points: [`main.py`](https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py) (API and workflows), [`static/js/dashboard.js`](https://github.com/2k25cse2513722-maker/techexpo/blob/main/static/js/dashboard.js) (Dashboard polling), [`detect.py`](https://github.com/2k25cse2513722-maker/techexpo/blob/main/detect.py) (YOLO detection), [`face_engine.py`](https://github.com/2k25cse2513722-maker/techexpo/blob/main/face_engine.py) (Face recognition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and Recognition"]
  node_detector["YOLO detection<br/>[detect.py]"]
  node_faces["Face recognition<br/>[face_engine.py]"]
end

subgraph group_backend["Campus Backend"]
  node_backend_app["API and workflows<br/>[main.py]"]
  node_live_state["Live AI state<br/>[ai_state.py]"]
  node_occupancy["Room occupancy<br/>[main.py]"]
  node_corridors["Corridor density<br/>[main.py]"]
  node_timetable["Timetable checks<br/>[main.py]"]
  node_alerts["Alerts and audit<br/>[main.py]"]
  node_auth["Role authentication<br/>[main.py]"]
  node_students["Student enrollment<br/>[main.py]"]
  node_attendance["Attendance<br/>[main.py]"]
end

subgraph group_data["Persistent Data"]
  node_storage[("Campus database<br/>[database.py]")]
  node_known_faces["Known face images"]
end

subgraph group_web["Dashboard"]
  node_login_page["Login interface<br/>[login.html]"]
  node_dashboard_page["Dashboard interface<br/>[dashboard.html]"]
  node_dashboard_js["Dashboard polling<br/>[dashboard.js]"]
  node_visualization["3D visualization<br/>[three-viz.js]"]
end

node_camera(("Camera"))
node_operator(("Campus user"))

node_camera -->|"provides frames"| node_detector
node_detector -->|"analyzes faces"| node_faces
node_faces -->|"loads images"| node_known_faces
node_faces -->|"looks up students"| node_storage
node_detector -->|"posts counts and frames"| node_backend_app
node_operator -->|"opens portal"| node_login_page
node_login_page -->|"submits credentials"| node_backend_app
node_backend_app -->|"checks session"| node_auth
node_auth -->|"reads users"| node_storage
node_operator -->|"views dashboard"| node_dashboard_page
node_dashboard_page -->|"loads scripts"| node_dashboard_js
node_dashboard_js -->|"polls APIs"| node_backend_app
node_dashboard_js -->|"requests camera controls"| node_backend_app
node_backend_app -->|"reads detection state"| node_live_state
node_backend_app -->|"reads and writes campus data"| node_storage
node_backend_app -->|"serves room telemetry"| node_occupancy
node_backend_app -->|"serves corridor status"| node_corridors
node_backend_app -->|"serves schedule checks"| node_timetable
node_backend_app -->|"serves alerts and logs"| node_alerts
node_backend_app -->|"handles enrollment"| node_students
node_backend_app -->|"records attendance"| node_attendance
node_dashboard_js -->|"updates visualization"| node_visualization

click node_detector "https://github.com/2k25cse2513722-maker/techexpo/blob/main/detect.py"
click node_faces "https://github.com/2k25cse2513722-maker/techexpo/blob/main/face_engine.py"
click node_backend_app "https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py"
click node_live_state "https://github.com/2k25cse2513722-maker/techexpo/blob/main/ai_state.py"
click node_occupancy "https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py"
click node_corridors "https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py"
click node_timetable "https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py"
click node_alerts "https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py"
click node_auth "https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py"
click node_students "https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py"
click node_attendance "https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py"
click node_storage "https://github.com/2k25cse2513722-maker/techexpo/blob/main/database.py"
click node_known_faces "https://github.com/2k25cse2513722-maker/techexpo/tree/main/known_faces"
click node_login_page "https://github.com/2k25cse2513722-maker/techexpo/blob/main/templates/login.html"
click node_dashboard_page "https://github.com/2k25cse2513722-maker/techexpo/blob/main/templates/dashboard.html"
click node_dashboard_js "https://github.com/2k25cse2513722-maker/techexpo/blob/main/static/js/dashboard.js"
click node_visualization "https://github.com/2k25cse2513722-maker/techexpo/blob/main/static/js/three-viz.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_detector,node_faces,node_operator toneBlue
class node_backend_app,node_live_state,node_occupancy,node_corridors,node_timetable,node_alerts,node_auth,node_students,node_attendance toneAmber
class node_storage,node_known_faces toneMint
class node_login_page,node_dashboard_page,node_dashboard_js,node_visualization toneRose
class node_camera toneIndigo
```

## Components

### Capture and Recognition

- [YOLO detection](https://github.com/2k25cse2513722-maker/techexpo/blob/main/detect.py): `detect.py`
- [Face recognition](https://github.com/2k25cse2513722-maker/techexpo/blob/main/face_engine.py): `face_engine.py`

### Campus Backend

- [API and workflows](https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py): `main.py`
- [Live AI state](https://github.com/2k25cse2513722-maker/techexpo/blob/main/ai_state.py): `ai_state.py`
- [Room occupancy](https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py): `main.py`
- [Corridor density](https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py): `main.py`
- [Timetable checks](https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py): `main.py`
- [Alerts and audit](https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py): `main.py`
- [Role authentication](https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py): `main.py`
- [Student enrollment](https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py): `main.py`
- [Attendance](https://github.com/2k25cse2513722-maker/techexpo/blob/main/main.py): `main.py`

### Persistent Data

- [Campus database](https://github.com/2k25cse2513722-maker/techexpo/blob/main/database.py): `database.py`
- [Known face images](https://github.com/2k25cse2513722-maker/techexpo/tree/main/known_faces): `known_faces`

### Dashboard

- [Login interface](https://github.com/2k25cse2513722-maker/techexpo/blob/main/templates/login.html): `templates/login.html`
- [Dashboard interface](https://github.com/2k25cse2513722-maker/techexpo/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Dashboard polling](https://github.com/2k25cse2513722-maker/techexpo/blob/main/static/js/dashboard.js): `static/js/dashboard.js`
- [3D visualization](https://github.com/2k25cse2513722-maker/techexpo/blob/main/static/js/three-viz.js): `static/js/three-viz.js`

### Other components

- **Camera**
- **Campus user**

## Connections

- Camera → YOLO detection: provides frames
- YOLO detection → Face recognition: analyzes faces
- Face recognition → Known face images: loads images
- Face recognition → Campus database: looks up students
- YOLO detection → API and workflows: posts counts and frames
- Campus user → Login interface: opens portal
- Login interface → API and workflows: submits credentials
- API and workflows → Role authentication: checks session
- Role authentication → Campus database: reads users
- Campus user → Dashboard interface: views dashboard
- Dashboard interface → Dashboard polling: loads scripts
- Dashboard polling → API and workflows: polls APIs
- Dashboard polling → API and workflows: requests camera controls
- API and workflows → Live AI state: reads detection state
- API and workflows → Campus database: reads and writes campus data
- API and workflows → Room occupancy: serves room telemetry
- API and workflows → Corridor density: serves corridor status
- API and workflows → Timetable checks: serves schedule checks
- API and workflows → Alerts and audit: serves alerts and logs
- API and workflows → Student enrollment: handles enrollment
- API and workflows → Attendance: records attendance
- Dashboard polling → 3D visualization: updates visualization
