# jeet2005/eyex architecture

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

- Interactive diagram: https://gitdiagram.com/jeet2005/eyex
- Repository: https://github.com/jeet2005/eyex

## Overview

Eye-X is a smart-attendance and classroom-behavior analytics system. Camera clients stream through WebRTC, while the server coordinates signaling, recognition, attendance records, and analytics; administrators use a dashboard to monitor results and export reports. The source index and excerpts establish the server’s service dependencies and attendance/database actions. Some client and route details are unsampled, so those relationships are shown only where the README documents them.

Main entry points: [`app.py`](https://github.com/jeet2005/eyex/blob/main/app.py) (FastAPI application), [`config.py`](https://github.com/jeet2005/eyex/blob/main/config.py) (Runtime configuration), [`services/face_recognizer.py`](https://github.com/jeet2005/eyex/blob/main/services/face_recognizer.py) (Face recognition), [`database/mongodb.py`](https://github.com/jeet2005/eyex/blob/main/database/mongodb.py) (Attendance records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Camera and dashboard clients"]
  node_camera(("Edge cameras"))
  node_dashboard["Admin dashboard<br/>[dashboard.js]"]
  node_camera_client["Camera client<br/>[webrtc-client.js]"]
  node_viewer["Stream viewer<br/>[webrtc-viewer.js]"]
end

subgraph group_server["Application and real-time services"]
  node_server["FastAPI application<br/>[app.py]"]
  node_signaling["WebRTC signaling<br/>[signaling.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_audio["Attendance announcements<br/>[audio_service.py]"]
end

subgraph group_intelligence["Recognition and behavior analysis"]
  node_face_detection["Face detection<br/>[face_detector.py]"]
  node_face_recognition["Face recognition<br/>[face_recognizer.py]"]
  node_behavior["Behavior analysis"]
end

subgraph group_data["Attendance and reporting"]
  node_attendance[("Attendance records<br/>[mongodb.py]")]
  node_analytics[("Analytics and snapshots<br/>[mongodb.py]")]
  node_exports["Report generation<br/>[export.py]"]
end

node_mongo[("MongoDB")]
node_reports(("Report consumers"))

node_camera -.->|"captures for"| node_camera_client
node_camera_client -.->|"exchanges signaling"| node_signaling
node_viewer -.->|"exchanges signaling"| node_signaling
node_dashboard -.->|"renders streams"| node_viewer
node_server -->|"routes signaling"| node_signaling
node_server -->|"uses detection"| node_face_detection
node_server -->|"uses recognition"| node_face_recognition
node_server -->|"uses analysis"| node_behavior
node_server -->|"checks and marks"| node_attendance
node_server -->|"generates reports"| node_exports
node_server -->|"uses announcements"| node_audio
node_face_recognition -->|"loads embeddings"| node_attendance
node_attendance -.->|"reads and writes"| node_mongo
node_server -->|"requests summaries"| node_analytics
node_analytics -.->|"reads and writes"| node_mongo
node_exports -.->|"produces files"| node_reports
node_config -->|"configures thresholds"| node_face_detection
node_config -->|"configures threshold"| node_face_recognition
node_config -->|"sets model path"| node_behavior

click node_dashboard "https://github.com/jeet2005/eyex/blob/main/static/js/dashboard.js"
click node_camera_client "https://github.com/jeet2005/eyex/blob/main/static/js/webrtc-client.js"
click node_viewer "https://github.com/jeet2005/eyex/blob/main/static/js/webrtc-viewer.js"
click node_server "https://github.com/jeet2005/eyex/blob/main/app.py"
click node_signaling "https://github.com/jeet2005/eyex/blob/main/services/signaling.py"
click node_config "https://github.com/jeet2005/eyex/blob/main/config.py"
click node_face_detection "https://github.com/jeet2005/eyex/blob/main/services/face_detector.py"
click node_face_recognition "https://github.com/jeet2005/eyex/blob/main/services/face_recognizer.py"
click node_behavior "https://github.com/jeet2005/eyex/blob/main/services/behavior_detector.py"
click node_attendance "https://github.com/jeet2005/eyex/blob/main/database/mongodb.py"
click node_analytics "https://github.com/jeet2005/eyex/blob/main/database/mongodb.py"
click node_exports "https://github.com/jeet2005/eyex/blob/main/services/export.py"
click node_audio "https://github.com/jeet2005/eyex/blob/main/services/audio_service.py"

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_camera,node_dashboard,node_camera_client,node_viewer toneBlue
class node_server,node_signaling,node_config,node_audio,node_mongo toneAmber
class node_face_detection,node_face_recognition,node_behavior toneMint
class node_attendance,node_analytics,node_exports toneRose
class node_reports toneIndigo
```

## Components

### Camera and dashboard clients

- **Edge cameras**
- [Admin dashboard](https://github.com/jeet2005/eyex/blob/main/static/js/dashboard.js): `static/js/dashboard.js`
- [Camera client](https://github.com/jeet2005/eyex/blob/main/static/js/webrtc-client.js): `static/js/webrtc-client.js`
- [Stream viewer](https://github.com/jeet2005/eyex/blob/main/static/js/webrtc-viewer.js): `static/js/webrtc-viewer.js`

### Application and real-time services

- [FastAPI application](https://github.com/jeet2005/eyex/blob/main/app.py): `app.py`
- [WebRTC signaling](https://github.com/jeet2005/eyex/blob/main/services/signaling.py): `services/signaling.py`
- [Runtime configuration](https://github.com/jeet2005/eyex/blob/main/config.py): `config.py`
- [Attendance announcements](https://github.com/jeet2005/eyex/blob/main/services/audio_service.py): `services/audio_service.py`

### Recognition and behavior analysis

- [Face detection](https://github.com/jeet2005/eyex/blob/main/services/face_detector.py): `services/face_detector.py`
- [Face recognition](https://github.com/jeet2005/eyex/blob/main/services/face_recognizer.py): `services/face_recognizer.py`
- [Behavior analysis](https://github.com/jeet2005/eyex/blob/main/services/behavior_detector.py): `services/behavior_detector.py`

### Attendance and reporting

- [Attendance records](https://github.com/jeet2005/eyex/blob/main/database/mongodb.py): `database/mongodb.py`
- [Analytics and snapshots](https://github.com/jeet2005/eyex/blob/main/database/mongodb.py): `database/mongodb.py`
- [Report generation](https://github.com/jeet2005/eyex/blob/main/services/export.py): `services/export.py`

### Other components

- **MongoDB**
- **Report consumers**

## Connections

- Edge cameras → Camera client: captures for (evidence: `README.md`)
- Camera client → WebRTC signaling: exchanges signaling (evidence: `README.md`)
- Stream viewer → WebRTC signaling: exchanges signaling (evidence: `README.md`)
- Admin dashboard → Stream viewer: renders streams (evidence: `README.md`)
- FastAPI application → WebRTC signaling: routes signaling (evidence: `app.py`)
- FastAPI application → Face detection: uses detection (evidence: `app.py`)
- FastAPI application → Face recognition: uses recognition (evidence: `app.py`)
- FastAPI application → Behavior analysis: uses analysis (evidence: `app.py`)
- FastAPI application → Attendance records: checks and marks (evidence: `app.py`)
- FastAPI application → Report generation: generates reports (evidence: `app.py`)
- FastAPI application → Attendance announcements: uses announcements (evidence: `app.py`)
- Face recognition → Attendance records: loads embeddings (evidence: `services/face_recognizer.py`)
- Attendance records → MongoDB: reads and writes
- FastAPI application → Analytics and snapshots: requests summaries (evidence: `app.py`)
- Analytics and snapshots → MongoDB: reads and writes
- Report generation → Report consumers: produces files (evidence: `README.md`)
- Runtime configuration → Face detection: configures thresholds (evidence: `services/face_detector.py`)
- Runtime configuration → Face recognition: configures threshold (evidence: `services/face_recognizer.py`)
- Runtime configuration → Behavior analysis: sets model path (evidence: `services/behavior_detector.py`)
