# bahadurmalik82/smartvision-ai-attendance-system architecture

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

- Interactive diagram: https://gitdiagram.com/bahadurmalik82/smartvision-ai-attendance-system
- Repository: https://github.com/bahadurmalik82/smartvision-ai-attendance-system

## Overview

Attenova is a Flask attendance and student-engagement system. Teachers register, configure classes and timetables, enrol students, and start or schedule sessions; camera frames and duration tracking support attendance records. Teachers then review analytics, ML benchmarks, clusters and defaulter risks, while students use a separate portal to view attendance and timetables. The graph retains the documented security, settings, audit and alert capabilities. Some source was unsampled, so uncertain runtime links are dashed or omitted.

Main entry points: [`app/routes/analytics.py`](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/analytics.py) (Analytics), [`app/services/scheduler_service.py`](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/scheduler_service.py) (Session scheduler), [`app/services/camera_streamer.py`](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/camera_streamer.py) (Camera processing), [`app/services/attendance_alerts.py`](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/attendance_alerts.py) (Attendance alerts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_app_factory["Flask app<br/>[__init__.py]"]
  node_auth["Teacher access<br/>[auth.py]"]
  node_timetable["Timetable<br/>[timetable.py]"]
  node_students["Class enrollment<br/>[students.py]"]
  node_student_portal["Student portal<br/>[student.py]"]
  node_dashboard["Class dashboard<br/>[dashboard.py]"]
  node_cameras["Camera setup<br/>[cameras.py]"]
end

subgraph group_attendance["Attendance runtime"]
  node_feature["Face features"]
  node_liveness["Liveness checks"]
  node_streamer["Camera processing<br/>[camera_streamer.py]"]
  node_scheduler["Session scheduler"]
  node_duration["Duration tracking"]
end

subgraph group_insights["Analytics and ML"]
  node_analytics["Analytics<br/>[analytics.py]"]
  node_benchmark["Classifier benchmark"]
  node_clustering["Student clustering<br/>[clustering.py]"]
  node_defaulter["Defaulter prediction"]
end

subgraph group_operations["Data and operations"]
  node_models[("Attendance data<br/>[models.py]")]
  node_settings["Live settings<br/>[settings.py]"]
  node_audit["Audit trail<br/>[audit.py]"]
  node_alerts["Attendance alerts"]
  node_email["Email delivery<br/>[email_service.py]"]
end

node_teacher(("Teacher"))
node_student_actor(("Student"))
node_camera_device(("Classroom camera"))

node_teacher -->|"registers"| node_auth
node_teacher -->|"configures"| node_timetable
node_teacher -->|"enrols"| node_students
node_teacher -->|"starts class"| node_dashboard
node_teacher -->|"configures"| node_cameras
node_teacher -->|"reviews"| node_analytics
node_student_actor -->|"views attendance"| node_student_portal
node_app_factory -->|"starts"| node_scheduler
node_students -->|"extracts embeddings"| node_feature
node_dashboard -->|"controls sessions"| node_scheduler
node_scheduler -->|"starts tracking"| node_duration
node_camera_device -.->|"sends frames"| node_streamer
node_streamer -->|"extracts features"| node_feature
node_streamer -->|"checks liveness"| node_liveness
node_streamer -->|"uses tracking"| node_duration
node_analytics -->|"runs benchmarks"| node_benchmark
node_analytics -->|"clusters students"| node_clustering
node_analytics -->|"predicts risk"| node_defaulter
node_scheduler -.->|"triggers alerts"| node_alerts
node_alerts -->|"sends warnings"| node_email
node_alerts -->|"reads threshold"| node_settings
node_auth -->|"records actions"| node_audit
node_analytics -->|"records actions"| node_audit
node_student_portal -->|"reads attendance"| node_models
node_scheduler -->|"writes sessions"| node_models

click node_app_factory "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/__init__.py"
click node_auth "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/auth.py"
click node_timetable "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/timetable.py"
click node_students "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/students.py"
click node_student_portal "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/student.py"
click node_dashboard "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/dashboard.py"
click node_cameras "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/cameras.py"
click node_analytics "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/analytics.py"
click node_benchmark "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/ml_engine/classifier_benchmark.py"
click node_clustering "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/ml_engine/clustering.py"
click node_defaulter "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/ml_engine/defaulter_predictor.py"
click node_feature "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/ml_engine/feature_extractor.py"
click node_liveness "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/ml_engine/liveness_detector.py"
click node_streamer "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/camera_streamer.py"
click node_scheduler "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/scheduler_service.py"
click node_duration "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/ml_engine/duration_tracker.py"
click node_models "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/models.py"
click node_settings "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/settings.py"
click node_audit "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/audit.py"
click node_alerts "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/attendance_alerts.py"
click node_email "https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/email_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_app_factory,node_auth,node_timetable,node_students,node_student_portal,node_dashboard,node_cameras toneBlue
class node_feature,node_liveness,node_streamer,node_scheduler,node_duration toneAmber
class node_analytics,node_benchmark,node_clustering,node_defaulter toneMint
class node_models,node_settings,node_audit,node_alerts,node_email toneRose
class node_teacher,node_student_actor,node_camera_device toneIndigo
```

## Components

### Web workflows

- [Flask app](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/__init__.py): `app/__init__.py`
- [Teacher access](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/auth.py): `app/routes/auth.py`
- [Timetable](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/timetable.py): `app/routes/timetable.py`
- [Class enrollment](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/students.py): `app/routes/students.py`
- [Student portal](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/student.py): `app/routes/student.py`
- [Class dashboard](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/dashboard.py): `app/routes/dashboard.py`
- [Camera setup](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/cameras.py): `app/routes/cameras.py`

### Attendance runtime

- [Face features](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/ml_engine/feature_extractor.py): `app/ml_engine/feature_extractor.py`
- [Liveness checks](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/ml_engine/liveness_detector.py): `app/ml_engine/liveness_detector.py`
- [Camera processing](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/camera_streamer.py): `app/services/camera_streamer.py`
- [Session scheduler](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/scheduler_service.py): `app/services/scheduler_service.py`
- [Duration tracking](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/ml_engine/duration_tracker.py): `app/ml_engine/duration_tracker.py`

### Analytics and ML

- [Analytics](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/routes/analytics.py): `app/routes/analytics.py`
- [Classifier benchmark](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/ml_engine/classifier_benchmark.py): `app/ml_engine/classifier_benchmark.py`
- [Student clustering](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/ml_engine/clustering.py): `app/ml_engine/clustering.py`
- [Defaulter prediction](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/ml_engine/defaulter_predictor.py): `app/ml_engine/defaulter_predictor.py`

### Data and operations

- [Attendance data](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/models.py): `app/models.py`
- [Live settings](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/settings.py): `app/services/settings.py`
- [Audit trail](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/audit.py): `app/services/audit.py`
- [Attendance alerts](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/attendance_alerts.py): `app/services/attendance_alerts.py`
- [Email delivery](https://github.com/bahadurmalik82/smartvision-ai-attendance-system/blob/main/app/services/email_service.py): `app/services/email_service.py`

### Other components

- **Teacher**
- **Student**
- **Classroom camera**

## Connections

- Teacher → Teacher access: registers (evidence: `README.md`)
- Teacher → Timetable: configures (evidence: `README.md`)
- Teacher → Class enrollment: enrols (evidence: `README.md`)
- Teacher → Class dashboard: starts class (evidence: `README.md`)
- Teacher → Camera setup: configures (evidence: `README.md`)
- Teacher → Analytics: reviews (evidence: `README.md`)
- Student → Student portal: views attendance (evidence: `README.md`)
- Flask app → Session scheduler: starts (evidence: `app/__init__.py`)
- Class enrollment → Face features: extracts embeddings (evidence: `app/routes/students.py`)
- Class dashboard → Session scheduler: controls sessions (evidence: `README.md`)
- Session scheduler → Duration tracking: starts tracking (evidence: `app/services/scheduler_service.py`)
- Classroom camera → Camera processing: sends frames (evidence: `README.md`)
- Camera processing → Face features: extracts features (evidence: `app/services/camera_streamer.py`)
- Camera processing → Liveness checks: checks liveness (evidence: `app/services/camera_streamer.py`)
- Camera processing → Duration tracking: uses tracking (evidence: `app/services/camera_streamer.py`)
- Analytics → Classifier benchmark: runs benchmarks (evidence: `app/routes/analytics.py`)
- Analytics → Student clustering: clusters students (evidence: `app/routes/analytics.py`)
- Analytics → Defaulter prediction: predicts risk (evidence: `app/routes/analytics.py`)
- Session scheduler → Attendance alerts: triggers alerts (evidence: `app/services/scheduler_service.py`)
- Attendance alerts → Email delivery: sends warnings (evidence: `app/services/attendance_alerts.py`)
- Attendance alerts → Live settings: reads threshold (evidence: `app/services/attendance_alerts.py`)
- Teacher access → Audit trail: records actions (evidence: `app/routes/auth.py`)
- Analytics → Audit trail: records actions (evidence: `app/routes/analytics.py`)
- Student portal → Attendance data: reads attendance (evidence: `app/routes/student.py`)
- Session scheduler → Attendance data: writes sessions (evidence: `app/services/scheduler_service.py`)
