# koradasainithin/face_recognition architecture

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

- Interactive diagram: https://gitdiagram.com/koradasainithin/face_recognition
- Repository: https://github.com/koradasainithin/face_recognition

## Overview

FaceAttend AI is a Flask student-attendance application whose central workflow captures a kiosk webcam frame, recognizes a registered face, and records a deduplicated attendance check-in. Separate enrollment, student management, filtered reporting/CSV export, and analytics capabilities serve administrators. The backend routes requests to the vision engine and SQLite data layer; browser scripts implement the kiosk and administrative views. Relationships for unsampled pages and endpoints are included only where the README documents the capability; source excerpts provide more specific call evidence for the sampled paths.

Main entry points: [`app.py`](https://github.com/koradasainithin/face_recognition/blob/main/app.py) (Flask API), [`database.py`](https://github.com/koradasainithin/face_recognition/blob/main/database.py) (Student management), [`templates/base.html`](https://github.com/koradasainithin/face_recognition/blob/main/templates/base.html) (Shared layout), [`static/js/camera.js`](https://github.com/koradasainithin/face_recognition/blob/main/static/js/camera.js) (Live kiosk)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_kiosk["Live kiosk<br/>[camera.js]"]
  node_enrollment["Enrollment studio<br/>[register.js]"]
  node_records_ui["Records interface<br/>[records.js]"]
  node_dashboard_ui["Analytics dashboard<br/>[dashboard.js]"]
  node_shared_ui["Shared utilities<br/>[main.js]"]
  node_kiosk_view["Kiosk view<br/>[index.html]"]
  node_enrollment_view["Enrollment view<br/>[register.html]"]
  node_records_view["Records view<br/>[records.html]"]
  node_dashboard_view["Dashboard view<br/>[dashboard.html]"]
  node_layout["Shared layout<br/>[base.html]"]
end

subgraph group_attendance["Attendance workflow"]
  node_vision["Face recognition<br/>[face_engine.py]"]
  node_attendance_records["Attendance records<br/>[database.py]"]
  node_face_store[("Face snapshots")]
end

subgraph group_admin["Administration"]
  node_student_directory["Student directory<br/>[students.html]"]
  node_student_records["Student management<br/>[database.py]"]
  node_analytics_data["Analytics queries<br/>[database.py]"]
end

subgraph group_core["Backend and data"]
  node_flask_app["Flask API<br/>[app.py]"]
  node_sqlite[("SQLite database<br/>[attendance.db]")]
end

node_browser(("Browser user"))

node_browser -->|"opens"| node_kiosk_view
node_browser -->|"opens"| node_enrollment_view
node_browser -->|"opens"| node_records_view
node_browser -->|"opens"| node_dashboard_view
node_kiosk_view -.->|"uses layout"| node_layout
node_enrollment_view -.->|"uses layout"| node_layout
node_records_view -.->|"uses layout"| node_layout
node_dashboard_view -.->|"uses layout"| node_layout
node_kiosk_view -->|"hosts"| node_kiosk
node_enrollment_view -->|"hosts"| node_enrollment
node_records_view -->|"hosts"| node_records_ui
node_dashboard_view -->|"hosts"| node_dashboard_ui
node_kiosk -->|"posts frames"| node_flask_app
node_enrollment -->|"submits enrollment"| node_flask_app
node_records_ui -->|"requests filters"| node_flask_app
node_records_ui -->|"requests export"| node_flask_app
node_dashboard_ui -->|"loads statistics"| node_flask_app
node_flask_app -->|"decodes and recognizes"| node_vision
node_flask_app -->|"looks up students"| node_student_records
node_flask_app -->|"records check-ins"| node_attendance_records
node_flask_app -->|"filters and exports"| node_attendance_records
node_flask_app -.->|"requests statistics"| node_analytics_data
node_flask_app -->|"registers students"| node_student_records
node_flask_app -.->|"deletes students"| node_student_records
node_student_records -.->|"reads and writes"| node_sqlite
node_attendance_records -.->|"reads and writes"| node_sqlite
node_analytics_data -.->|"queries"| node_sqlite
node_vision -->|"loads enrollment data"| node_student_records
node_vision -->|"reads snapshots"| node_face_store
node_enrollment -->|"plays feedback"| node_shared_ui
node_kiosk -->|"plays feedback"| node_shared_ui
node_browser -->|"manages students"| node_student_directory

click node_kiosk "https://github.com/koradasainithin/face_recognition/blob/main/static/js/camera.js"
click node_enrollment "https://github.com/koradasainithin/face_recognition/blob/main/static/js/register.js"
click node_records_ui "https://github.com/koradasainithin/face_recognition/blob/main/static/js/records.js"
click node_dashboard_ui "https://github.com/koradasainithin/face_recognition/blob/main/static/js/dashboard.js"
click node_shared_ui "https://github.com/koradasainithin/face_recognition/blob/main/static/js/main.js"
click node_kiosk_view "https://github.com/koradasainithin/face_recognition/blob/main/templates/index.html"
click node_enrollment_view "https://github.com/koradasainithin/face_recognition/blob/main/templates/register.html"
click node_records_view "https://github.com/koradasainithin/face_recognition/blob/main/templates/records.html"
click node_dashboard_view "https://github.com/koradasainithin/face_recognition/blob/main/templates/dashboard.html"
click node_student_directory "https://github.com/koradasainithin/face_recognition/blob/main/templates/students.html"
click node_layout "https://github.com/koradasainithin/face_recognition/blob/main/templates/base.html"
click node_flask_app "https://github.com/koradasainithin/face_recognition/blob/main/app.py"
click node_vision "https://github.com/koradasainithin/face_recognition/blob/main/face_engine.py"
click node_student_records "https://github.com/koradasainithin/face_recognition/blob/main/database.py"
click node_attendance_records "https://github.com/koradasainithin/face_recognition/blob/main/database.py"
click node_analytics_data "https://github.com/koradasainithin/face_recognition/blob/main/database.py"
click node_face_store "https://github.com/koradasainithin/face_recognition/tree/main/data/faces"
click node_sqlite "https://github.com/koradasainithin/face_recognition/blob/main/data/attendance.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_kiosk,node_enrollment,node_records_ui,node_dashboard_ui,node_shared_ui,node_kiosk_view,node_enrollment_view,node_records_view,node_dashboard_view,node_layout,node_browser toneBlue
class node_vision,node_attendance_records,node_face_store toneAmber
class node_student_directory,node_student_records,node_analytics_data toneMint
class node_flask_app,node_sqlite toneRose
```

## Components

### Web experience

- [Live kiosk](https://github.com/koradasainithin/face_recognition/blob/main/static/js/camera.js): `static/js/camera.js`
- [Enrollment studio](https://github.com/koradasainithin/face_recognition/blob/main/static/js/register.js): `static/js/register.js`
- [Records interface](https://github.com/koradasainithin/face_recognition/blob/main/static/js/records.js): `static/js/records.js`
- [Analytics dashboard](https://github.com/koradasainithin/face_recognition/blob/main/static/js/dashboard.js): `static/js/dashboard.js`
- [Shared utilities](https://github.com/koradasainithin/face_recognition/blob/main/static/js/main.js): `static/js/main.js`
- [Kiosk view](https://github.com/koradasainithin/face_recognition/blob/main/templates/index.html): `templates/index.html`
- [Enrollment view](https://github.com/koradasainithin/face_recognition/blob/main/templates/register.html): `templates/register.html`
- [Records view](https://github.com/koradasainithin/face_recognition/blob/main/templates/records.html): `templates/records.html`
- [Dashboard view](https://github.com/koradasainithin/face_recognition/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Shared layout](https://github.com/koradasainithin/face_recognition/blob/main/templates/base.html): `templates/base.html`

### Attendance workflow

- [Face recognition](https://github.com/koradasainithin/face_recognition/blob/main/face_engine.py): `face_engine.py`
- [Attendance records](https://github.com/koradasainithin/face_recognition/blob/main/database.py): `database.py`
- [Face snapshots](https://github.com/koradasainithin/face_recognition/tree/main/data/faces): `data/faces`

### Administration

- [Student directory](https://github.com/koradasainithin/face_recognition/blob/main/templates/students.html): `templates/students.html`
- [Student management](https://github.com/koradasainithin/face_recognition/blob/main/database.py): `database.py`
- [Analytics queries](https://github.com/koradasainithin/face_recognition/blob/main/database.py): `database.py`

### Backend and data

- [Flask API](https://github.com/koradasainithin/face_recognition/blob/main/app.py): `app.py`
- [SQLite database](https://github.com/koradasainithin/face_recognition/blob/main/data/attendance.db): `data/attendance.db`

### Other components

- **Browser user**

## Connections

- Browser user → Kiosk view: opens (evidence: `README.md`)
- Browser user → Enrollment view: opens (evidence: `README.md`)
- Browser user → Records view: opens (evidence: `README.md`)
- Browser user → Dashboard view: opens (evidence: `README.md`)
- Kiosk view → Shared layout: uses layout
- Enrollment view → Shared layout: uses layout
- Records view → Shared layout: uses layout
- Dashboard view → Shared layout: uses layout
- Kiosk view → Live kiosk: hosts (evidence: `README.md`)
- Enrollment view → Enrollment studio: hosts (evidence: `README.md`)
- Records view → Records interface: hosts (evidence: `README.md`)
- Dashboard view → Analytics dashboard: hosts (evidence: `README.md`)
- Live kiosk → Flask API: posts frames (evidence: `README.md`)
- Enrollment studio → Flask API: submits enrollment (evidence: `static/js/register.js`)
- Records interface → Flask API: requests filters (evidence: `static/js/records.js`)
- Records interface → Flask API: requests export (evidence: `static/js/records.js`)
- Analytics dashboard → Flask API: loads statistics (evidence: `static/js/dashboard.js`)
- Flask API → Face recognition: decodes and recognizes (evidence: `app.py`)
- Flask API → Student management: looks up students (evidence: `app.py`)
- Flask API → Attendance records: records check-ins (evidence: `app.py`)
- Flask API → Attendance records: filters and exports (evidence: `app.py`)
- Flask API → Analytics queries: requests statistics (evidence: `README.md`)
- Flask API → Student management: registers students (evidence: `app.py`)
- Flask API → Student management: deletes students (evidence: `README.md`)
- Student management → SQLite database: reads and writes
- Attendance records → SQLite database: reads and writes
- Analytics queries → SQLite database: queries
- Face recognition → Student management: loads enrollment data (evidence: `face_engine.py`)
- Face recognition → Face snapshots: reads snapshots (evidence: `face_engine.py`)
- Enrollment studio → Shared utilities: plays feedback (evidence: `static/js/register.js`)
- Live kiosk → Shared utilities: plays feedback (evidence: `static/js/camera.js`)
- Browser user → Student directory: manages students (evidence: `README.md`)
