# darshanmbangre2002/face-recognition-attendance-system architecture

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

- Interactive diagram: https://gitdiagram.com/darshanmbangre2002/face-recognition-attendance-system
- Repository: https://github.com/darshanmbangre2002/face-recognition-attendance-system

## Overview

AuraFace is a face-recognition attendance portal with an admin dashboard and REST API. Administrators manage employees and enroll face data; employees can be verified from camera images and checked in or out, while administrators review attendance and export reports. The backend combines JWT helpers, a configurable face engine, and SQLite/MySQL persistence. The README also documents lateness classifications, multi-angle enrollment, and optional email notifications. Some API and frontend behavior is only partially excerpted, so unverified subsystem links are omitted or marked dashed.

Main entry points: [`app.py`](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py) (REST API Routes), [`database.py`](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/database.py) (Database Access), [`static/js/app.js`](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/static/js/app.js) (Portal Interactions), [`face_engine.py`](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/face_engine.py) (Face Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Portal"]
  node_dashboard["Admin Dashboard<br/>[dashboard.html]"]
  node_webapp["Portal Interactions<br/>[app.js]"]
end

subgraph group_api["Application API"]
  node_routes["REST API Routes<br/>[app.py]"]
  node_auth["JWT Helpers<br/>[utils.py]"]
  node_employees["Employee Records<br/>[app.py]"]
  node_attendance["Attendance Operations<br/>[app.py]"]
  node_reports["Attendance Reports<br/>[app.py]"]
end

subgraph group_identity["Face Recognition"]
  node_faceengine["Face Engine<br/>[face_engine.py]"]
  node_enrollment["Face Enrollment<br/>[app.py]"]
  node_verification["Face Verification<br/>[app.py]"]
end

subgraph group_data["Persistence and Reports"]
  node_database["Database Access<br/>[database.py]"]
  node_records[("SQLite / MySQL")]
  node_exporters["CSV / PDF Exporters<br/>[utils.py]"]
  node_mailer["Email Notifications<br/>[utils.py]"]
  node_config["Runtime Configuration<br/>[config.py]"]
end

node_admin(("Administrator"))
node_employee(("Employee"))

node_admin -->|"uses"| node_dashboard
node_employee -->|"presents face"| node_webapp
node_dashboard -->|"renders"| node_webapp
node_webapp -->|"calls API"| node_routes
node_routes -->|"validates tokens"| node_auth
node_routes -->|"routes requests"| node_employees
node_routes -->|"routes requests"| node_enrollment
node_routes -->|"routes requests"| node_verification
node_routes -->|"routes requests"| node_attendance
node_routes -->|"routes requests"| node_reports
node_enrollment -->|"extracts embeddings"| node_faceengine
node_verification -->|"matches faces"| node_faceengine
node_employees -->|"queries records"| node_database
node_enrollment -->|"stores embeddings"| node_database
node_verification -->|"reads embeddings"| node_database
node_attendance -->|"reads and writes"| node_database
node_reports -->|"queries attendance"| node_database
node_database -->|"reads and writes"| node_records
node_database -->|"selects backend"| node_config
node_faceengine -->|"loads settings"| node_config
node_reports -.->|"generates files"| node_exporters
node_attendance -.->|"notifies by email"| node_mailer

click node_dashboard "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/templates/dashboard.html"
click node_webapp "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/static/js/app.js"
click node_routes "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py"
click node_auth "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/utils.py"
click node_faceengine "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/face_engine.py"
click node_employees "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py"
click node_enrollment "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py"
click node_verification "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py"
click node_attendance "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py"
click node_reports "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py"
click node_database "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/database.py"
click node_exporters "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/utils.py"
click node_mailer "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/utils.py"
click node_config "https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/config.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_webapp toneBlue
class node_routes,node_auth,node_employees,node_attendance,node_reports toneAmber
class node_faceengine,node_enrollment,node_verification toneMint
class node_database,node_records,node_exporters,node_mailer,node_config toneRose
class node_admin,node_employee toneIndigo
```

## Components

### Portal

- [Admin Dashboard](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Portal Interactions](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/static/js/app.js): `static/js/app.js`

### Application API

- [REST API Routes](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py): `app.py`
- [JWT Helpers](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/utils.py): `utils.py`
- [Employee Records](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py): `app.py`
- [Attendance Operations](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py): `app.py`
- [Attendance Reports](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py): `app.py`

### Face Recognition

- [Face Engine](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/face_engine.py): `face_engine.py`
- [Face Enrollment](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py): `app.py`
- [Face Verification](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/app.py): `app.py`

### Persistence and Reports

- [Database Access](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/database.py): `database.py`
- **SQLite / MySQL**
- [CSV / PDF Exporters](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/utils.py): `utils.py`
- [Email Notifications](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/utils.py): `utils.py`
- [Runtime Configuration](https://github.com/darshanmbangre2002/face-recognition-attendance-system/blob/main/config.py): `config.py`

### Other components

- **Administrator**
- **Employee**

## Connections

- Administrator → Admin Dashboard: uses (evidence: `README.md`)
- Employee → Portal Interactions: presents face (evidence: `README.md`)
- Admin Dashboard → Portal Interactions: renders (evidence: `static/js/app.js`)
- Portal Interactions → REST API Routes: calls API (evidence: `static/js/app.js`)
- REST API Routes → JWT Helpers: validates tokens (evidence: `app.py`)
- REST API Routes → Employee Records: routes requests (evidence: `app.py`)
- REST API Routes → Face Enrollment: routes requests (evidence: `app.py`)
- REST API Routes → Face Verification: routes requests (evidence: `README.md`)
- REST API Routes → Attendance Operations: routes requests (evidence: `app.py`)
- REST API Routes → Attendance Reports: routes requests (evidence: `app.py`)
- Face Enrollment → Face Engine: extracts embeddings (evidence: `README.md`)
- Face Verification → Face Engine: matches faces (evidence: `README.md`)
- Employee Records → Database Access: queries records (evidence: `app.py`)
- Face Enrollment → Database Access: stores embeddings (evidence: `README.md`)
- Face Verification → Database Access: reads embeddings (evidence: `README.md`)
- Attendance Operations → Database Access: reads and writes (evidence: `app.py`)
- Attendance Reports → Database Access: queries attendance (evidence: `app.py`)
- Database Access → SQLite / MySQL: reads and writes (evidence: `database.py`)
- Database Access → Runtime Configuration: selects backend (evidence: `database.py`)
- Face Engine → Runtime Configuration: loads settings (evidence: `face_engine.py`)
- Attendance Reports → CSV / PDF Exporters: generates files (evidence: `README.md`)
- Attendance Operations → Email Notifications: notifies by email (evidence: `README.md`)
