# bimalprasad328-dot/ai-face-attendance-system architecture

> Architecture diagram of the GitHub repository bimalprasad328-dot/ai-face-attendance-system, 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/bimalprasad328-dot/ai-face-attendance-system
- Repository: https://github.com/bimalprasad328-dot/ai-face-attendance-system

## Overview

FaceAttend AI is a Flask attendance application: users sign in through the dashboard, enroll students, mark attendance through face recognition, and review attendance summaries or download dated records. SQLite stores accounts, students, and attendance; role checks scope access for teachers. The README also describes an AI attendance assistant, while the sampled backend excerpt shows Groq-based insight generation. Some route implementations and frontend scripts were not sampled, so those documented links are shown as documented rather than inferred call chains.

Main entry points: [`frontend/index.html`](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/frontend/index.html) (Dashboard and Records), [`backend.py`](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py) (Dashboard Statistics), [`auth.py`](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/auth.py) (Login and Settings), [`frontend/login.html`](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/frontend/login.html) (Login Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard"]
  node_dashboard["Dashboard and Records<br/>[index.html]"]
  node_login_page["Login Page<br/>[login.html]"]
end

subgraph group_access["Access Control"]
  node_auth_routes["Login and Settings<br/>[auth.py]"]
  node_role_scope["Role-Based Access<br/>[auth.py]"]
end

subgraph group_attendance["Attendance Operations"]
  node_flask_app["Flask API<br/>[backend.py]"]
  node_student_enrollment["Student Enrollment<br/>[backend.py]"]
  node_face_capture["Face Sample Capture<br/>[data_collection.py]"]
  node_face_recognition["Face Recognition<br/>[backend.py]"]
  node_attendance_logging["Attendance Logging<br/>[backend.py]"]
  node_absence_sync["Absence Synchronization<br/>[backend.py]"]
  node_dashboard_stats["Dashboard Statistics<br/>[backend.py]"]
  node_csv_download["CSV Record Download<br/>[auth.py]"]
end

subgraph group_data["Attendance Data"]
  node_sqlite[("SQLite Database")]
  node_data_migration["Legacy Data Migration"]
end

subgraph group_assistant["AI Insights"]
  node_ai_insight["Attendance AI Insight<br/>[backend.py]"]
  node_groq["Groq Llama Service"]
end

node_user(("Admin or Teacher"))

node_user -->|"signs in"| node_login_page
node_user -->|"uses"| node_dashboard
node_login_page -->|"submits login"| node_auth_routes
node_dashboard -->|"uses API"| node_flask_app
node_flask_app -->|"registers routes"| node_auth_routes
node_auth_routes -->|"reads and writes"| node_sqlite
node_role_scope -->|"filters records"| node_sqlite
node_dashboard -->|"requests enrollment"| node_student_enrollment
node_student_enrollment -.->|"captures samples"| node_face_capture
node_face_capture -->|"captures face"| node_user
node_flask_app -->|"recognizes faces"| node_face_recognition
node_face_recognition -->|"identifies student"| node_attendance_logging
node_attendance_logging -->|"writes attendance"| node_sqlite
node_absence_sync -->|"synchronizes absences"| node_sqlite
node_dashboard -->|"requests summary"| node_dashboard_stats
node_dashboard_stats -->|"synchronizes first"| node_absence_sync
node_dashboard_stats -->|"scopes queries"| node_role_scope
node_dashboard_stats -->|"generates insight"| node_ai_insight
node_ai_insight -->|"requests summary"| node_groq
node_dashboard -->|"downloads records"| node_csv_download
node_csv_download -->|"queries records"| node_sqlite
node_data_migration -->|"creates and imports"| node_sqlite

click node_dashboard "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/frontend/index.html"
click node_login_page "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/frontend/login.html"
click node_flask_app "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py"
click node_auth_routes "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/auth.py"
click node_role_scope "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/auth.py"
click node_student_enrollment "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py"
click node_face_capture "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/data_collection.py"
click node_face_recognition "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py"
click node_attendance_logging "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py"
click node_absence_sync "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py"
click node_dashboard_stats "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py"
click node_csv_download "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/auth.py"
click node_data_migration "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/migrate_to_sqlite.py"
click node_ai_insight "https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.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_dashboard,node_login_page toneBlue
class node_auth_routes,node_role_scope toneAmber
class node_flask_app,node_student_enrollment,node_face_capture,node_face_recognition,node_attendance_logging,node_absence_sync,node_dashboard_stats,node_csv_download toneMint
class node_sqlite,node_data_migration toneRose
class node_ai_insight,node_groq,node_user toneIndigo
```

## Components

### Dashboard

- [Dashboard and Records](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/frontend/index.html): `frontend/index.html`
- [Login Page](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/frontend/login.html): `frontend/login.html`

### Access Control

- [Login and Settings](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/auth.py): `auth.py`
- [Role-Based Access](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/auth.py): `auth.py`

### Attendance Operations

- [Flask API](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py): `backend.py`
- [Student Enrollment](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py): `backend.py`
- [Face Sample Capture](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/data_collection.py): `data_collection.py`
- [Face Recognition](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py): `backend.py`
- [Attendance Logging](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py): `backend.py`
- [Absence Synchronization](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py): `backend.py`
- [Dashboard Statistics](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py): `backend.py`
- [CSV Record Download](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/auth.py): `auth.py`

### Attendance Data

- **SQLite Database**
- [Legacy Data Migration](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/migrate_to_sqlite.py): `migrate_to_sqlite.py`

### AI Insights

- [Attendance AI Insight](https://github.com/bimalprasad328-dot/ai-face-attendance-system/blob/main/backend.py): `backend.py`
- **Groq Llama Service**

### Other components

- **Admin or Teacher**

## Connections

- Admin or Teacher → Login Page: signs in (evidence: `README.md`)
- Admin or Teacher → Dashboard and Records: uses (evidence: `README.md`)
- Login Page → Login and Settings: submits login (evidence: `README.md`)
- Dashboard and Records → Flask API: uses API (evidence: `README.md`)
- Flask API → Login and Settings: registers routes (evidence: `backend.py`)
- Login and Settings → SQLite Database: reads and writes (evidence: `auth.py`)
- Role-Based Access → SQLite Database: filters records (evidence: `auth.py`)
- Dashboard and Records → Student Enrollment: requests enrollment (evidence: `README.md`)
- Student Enrollment → Face Sample Capture: captures samples
- Face Sample Capture → Admin or Teacher: captures face (evidence: `data_collection.py`)
- Flask API → Face Recognition: recognizes faces (evidence: `backend.py`)
- Face Recognition → Attendance Logging: identifies student (evidence: `backend.py`)
- Attendance Logging → SQLite Database: writes attendance (evidence: `backend.py`)
- Absence Synchronization → SQLite Database: synchronizes absences (evidence: `backend.py`)
- Dashboard and Records → Dashboard Statistics: requests summary (evidence: `README.md`)
- Dashboard Statistics → Absence Synchronization: synchronizes first (evidence: `backend.py`)
- Dashboard Statistics → Role-Based Access: scopes queries (evidence: `backend.py`)
- Dashboard Statistics → Attendance AI Insight: generates insight (evidence: `backend.py`)
- Attendance AI Insight → Groq Llama Service: requests summary (evidence: `backend.py`)
- Dashboard and Records → CSV Record Download: downloads records (evidence: `README.md`)
- CSV Record Download → SQLite Database: queries records (evidence: `auth.py`)
- Legacy Data Migration → SQLite Database: creates and imports (evidence: `migrate_to_sqlite.py`)
