# cvafpi/id-bio-project architecture

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

- Interactive diagram: https://gitdiagram.com/cvafpi/id-bio-project
- Repository: https://github.com/cvafpi/id-bio-project

## Overview

CVAFPI Identification System is a school attendance and access-verification kiosk backed by a Flask API. The main workflow is barcode scan, student lookup and duplicate protection, then timestamped attendance logging and visual audit capture; staff manage records and review logs through the operations UI. The graph also preserves documented migration, settings/security, privacy cleanup, camera alerts, and connectivity features. Source excerpts show Flask-to-logger calls and file handling; several UI-to-API relationships and features are documented in the README but their implementation was not sampled.

Main entry points: [`app.py`](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/app.py) (Flask routes and API), [`logger.py`](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/logger.py) (Attendance and CSV logic), [`templates/scanner.html`](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/scanner.html) (Scan interface), [`static/ping.js`](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/static/ping.js) (Connectivity status)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kiosk["Kiosk experience"]
  node_scanner_ui["Scan interface<br/>[scanner.html]"]
  node_launchpad["Operations launchpad<br/>[launchpad.html]"]
  node_dialog["Kiosk dialogs<br/>[kiosk-dialog.js]"]
  node_barcode_lib["Barcode rendering<br/>[jsbarcode.js]"]
end

subgraph group_backend["Flask application"]
  node_flask["Flask routes and API<br/>[app.py]"]
end

subgraph group_records["Records and audit"]
  node_logger["Attendance and CSV logic<br/>[logger.py]"]
  node_student_data[("Student records<br/>[data.csv]")]
  node_backup_data[("Backup records<br/>[backup-data.csv]")]
  node_attendance_logs[("Attendance logs")]
  node_audit_logs[("Audit events")]
  node_snapshots[("Audit snapshots")]
end

subgraph group_operations["Operations and alerts"]
  node_database_ui["Database manager<br/>[manager.html]"]
  node_migration_ui["CSV migration<br/>[migration.html]"]
  node_logs_ui["Log review<br/>[logs-manager.html]"]
  node_audit_ui["Audit review<br/>[audit-manager.html]"]
  node_settings["Settings interface<br/>[manager.html]"]
  node_prefix["Topic prefix behavior"]
  node_connectivity["Connectivity status<br/>[ping.js]"]
end

node_staff(("Student or staff"))
node_scanner(("Barcode scanner"))
node_ntfy["ntfy.sh notifications"]
node_internet["Internet service"]

node_staff -.->|"uses"| node_scanner_ui
node_scanner -.->|"enters barcode"| node_scanner_ui
node_scanner_ui -.->|"submits scans"| node_flask
node_flask -->|"calls records logic"| node_logger
node_logger -->|"reads and writes"| node_student_data
node_logger -->|"synchronizes"| node_backup_data
node_logger -->|"writes attendance"| node_attendance_logs
node_logger -->|"records events"| node_audit_logs
node_flask -.->|"captures evidence"| node_snapshots
node_flask -->|"sends alerts"| node_ntfy
node_flask -->|"renders page"| node_scanner_ui
node_database_ui -.->|"manages records"| node_flask
node_migration_ui -.->|"imports CSV"| node_flask
node_logs_ui -.->|"reviews logs"| node_flask
node_audit_ui -.->|"reviews audits"| node_flask
node_settings -.->|"saves settings"| node_flask
node_prefix -->|"adjusts settings requests"| node_flask
node_connectivity -->|"checks reachability"| node_internet
node_dialog -->|"requests recovery"| node_flask
node_launchpad -.->|"shows status"| node_connectivity
node_flask -->|"records security events"| node_audit_logs

click node_scanner_ui "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/scanner.html"
click node_launchpad "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/launchpad.html"
click node_dialog "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/static/kiosk-dialog.js"
click node_barcode_lib "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/jsbarcode.js"
click node_flask "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/app.py"
click node_logger "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/logger.py"
click node_student_data "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/data.csv"
click node_backup_data "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/backup-data.csv"
click node_database_ui "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/manager.html"
click node_migration_ui "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/migration.html"
click node_logs_ui "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/logs-manager.html"
click node_audit_ui "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/audit-manager.html"
click node_settings "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/manager.html"
click node_prefix "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/static/notification-prefix.js"
click node_connectivity "https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/static/ping.js"

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_scanner_ui,node_launchpad,node_dialog,node_barcode_lib toneBlue
class node_flask toneAmber
class node_logger,node_student_data,node_backup_data,node_attendance_logs,node_audit_logs,node_snapshots toneMint
class node_database_ui,node_migration_ui,node_logs_ui,node_audit_ui,node_settings,node_prefix,node_connectivity toneRose
class node_staff,node_scanner,node_ntfy,node_internet toneIndigo
```

## Components

### Kiosk experience

- [Scan interface](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/scanner.html): `templates/scanner.html`
- [Operations launchpad](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/launchpad.html): `templates/launchpad.html`
- [Kiosk dialogs](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/static/kiosk-dialog.js): `static/kiosk-dialog.js`
- [Barcode rendering](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/jsbarcode.js): `jsbarcode.js`

### Flask application

- [Flask routes and API](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/app.py): `app.py`

### Records and audit

- [Attendance and CSV logic](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/logger.py): `logger.py`
- [Student records](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/data.csv): `data.csv`
- [Backup records](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/backup-data.csv): `backup-data.csv`
- **Attendance logs**
- **Audit events**
- **Audit snapshots**

### Operations and alerts

- [Database manager](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/manager.html): `templates/manager.html`
- [CSV migration](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/migration.html): `templates/migration.html`
- [Log review](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/logs-manager.html): `templates/logs-manager.html`
- [Audit review](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/audit-manager.html): `templates/audit-manager.html`
- [Settings interface](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/templates/manager.html): `templates/manager.html`
- [Topic prefix behavior](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/static/notification-prefix.js): `static/notification-prefix.js`
- [Connectivity status](https://github.com/cvafpi/id-bio-project/blob/CSV-IDBIOSYS-LINUX/static/ping.js): `static/ping.js`

### Other components

- **Student or staff**
- **Barcode scanner**
- **ntfy.sh notifications**
- **Internet service**

## Connections

- Student or staff → Scan interface: uses
- Barcode scanner → Scan interface: enters barcode
- Scan interface → Flask routes and API: submits scans (evidence: `README.md`)
- Flask routes and API → Attendance and CSV logic: calls records logic (evidence: `app.py`)
- Attendance and CSV logic → Student records: reads and writes (evidence: `logger.py`)
- Attendance and CSV logic → Backup records: synchronizes (evidence: `logger.py`)
- Attendance and CSV logic → Attendance logs: writes attendance (evidence: `logger.py`)
- Attendance and CSV logic → Audit events: records events (evidence: `logger.py`)
- Flask routes and API → Audit snapshots: captures evidence (evidence: `README.md`)
- Flask routes and API → ntfy.sh notifications: sends alerts (evidence: `app.py`)
- Flask routes and API → Scan interface: renders page (evidence: `app.py`)
- Database manager → Flask routes and API: manages records (evidence: `README.md`)
- CSV migration → Flask routes and API: imports CSV (evidence: `README.md`)
- Log review → Flask routes and API: reviews logs (evidence: `README.md`)
- Audit review → Flask routes and API: reviews audits (evidence: `README.md`)
- Settings interface → Flask routes and API: saves settings (evidence: `README.md`)
- Topic prefix behavior → Flask routes and API: adjusts settings requests (evidence: `static/notification-prefix.js`)
- Connectivity status → Internet service: checks reachability (evidence: `static/ping.js`)
- Kiosk dialogs → Flask routes and API: requests recovery (evidence: `static/kiosk-dialog.js`)
- Operations launchpad → Connectivity status: shows status (evidence: `README.md`)
- Flask routes and API → Audit events: records security events (evidence: `app.py`)
