# jananimatheshwaran637-hub/qr-attendance-system architecture

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

- Interactive diagram: https://gitdiagram.com/jananimatheshwaran637-hub/qr-attendance-system
- Repository: https://github.com/jananimatheshwaran637-hub/qr-attendance-system

## Overview

This Flask QR attendance app lets an administrator register students, generate QR codes, scan them, and review attendance reports. Its main workflow runs through Flask handlers in app.py: registration creates a QR image and student record; scanning resolves a roll number and records attendance; reports query and display records. The separate scanner.py script is a camera client that posts scans to an API URL, but the sampled app.py excerpt does not show a matching API route. The README documents the capabilities; unsampled templates and integrations are represented only where their role is clear.

Main entry points: [`app.py`](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py) (Register student), [`dbconfig.py`](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/dbconfig.py) (Database config), [`scanner.py`](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/scanner.py) (Standalone scanner), [`templates/index.html`](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/templates/index.html) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_home["Home page<br/>[index.html]"]
  node_registration_form["Registration form<br/>[register.html]"]
  node_students["Student listing<br/>[app.py]"]
  node_students_page["Student page<br/>[students.html]"]
  node_report["Attendance report<br/>[app.py]"]
  node_report_page["Report page<br/>[report.html]"]
  node_scanner_page["Scanner page<br/>[scanner.html]"]
end

subgraph group_registration["Student registration"]
  node_register["Register student<br/>[app.py]"]
  node_qr_generation["QR generation<br/>[app.py]"]
  node_qr_files[("QR image files")]
end

subgraph group_attendance["Attendance"]
  node_camera_scan["Camera scanning<br/>[app.py]"]
  node_quick_scan["Quick scan<br/>[app.py]"]
  node_standalone_scanner["Standalone scanner<br/>[scanner.py]"]
  node_attendance_save["Save attendance<br/>[app.py]"]
end

subgraph group_storage["Persistence"]
  node_mysql[("MySQL database")]
  node_db_config["Database config<br/>[dbconfig.py]"]
end

node_admin(("Administrator"))
node_camera(("Camera"))
node_attendance_api["Attendance API"]

node_admin -->|"opens"| node_home
node_admin -->|"registers"| node_register
node_register -->|"renders"| node_registration_form
node_register -->|"generates"| node_qr_generation
node_qr_generation -->|"writes"| node_qr_files
node_register -->|"checks and inserts"| node_mysql
node_register -->|"redirects"| node_students
node_admin -->|"views"| node_students
node_students -->|"reads"| node_mysql
node_students -->|"renders"| node_students_page
node_camera -->|"provides frames"| node_camera_scan
node_admin -->|"starts scan"| node_camera_scan
node_camera_scan -->|"submits roll"| node_attendance_save
node_admin -->|"scans roll"| node_quick_scan
node_quick_scan -->|"calls"| node_attendance_save
node_attendance_save -->|"writes attendance"| node_mysql
node_camera -->|"provides frames"| node_standalone_scanner
node_standalone_scanner -->|"posts roll"| node_attendance_api
node_admin -->|"views"| node_report
node_camera_scan -->|"redirects"| node_report
node_quick_scan -->|"redirects"| node_report
node_report -->|"queries"| node_mysql
node_report -->|"renders"| node_report_page
node_admin -.->|"opens"| node_scanner_page
node_register -->|"uses settings"| node_db_config
node_students -->|"uses settings"| node_db_config
node_attendance_save -->|"uses settings"| node_db_config
node_report -->|"uses settings"| node_db_config

click node_home "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/templates/index.html"
click node_register "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py"
click node_registration_form "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/templates/register.html"
click node_qr_generation "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py"
click node_qr_files "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/tree/main/static/qr_codes"
click node_students "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py"
click node_students_page "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/templates/students.html"
click node_camera_scan "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py"
click node_quick_scan "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py"
click node_standalone_scanner "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/scanner.py"
click node_attendance_save "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py"
click node_report "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py"
click node_report_page "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/templates/report.html"
click node_scanner_page "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/templates/scanner.html"
click node_db_config "https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/dbconfig.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_home,node_registration_form,node_students,node_students_page,node_report,node_report_page,node_scanner_page toneBlue
class node_register,node_qr_generation,node_qr_files toneAmber
class node_camera_scan,node_quick_scan,node_standalone_scanner,node_attendance_save,node_attendance_api toneMint
class node_mysql,node_db_config toneRose
class node_admin,node_camera toneIndigo
```

## Components

### Web interface

- [Home page](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/templates/index.html): `templates/index.html`
- [Registration form](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/templates/register.html): `templates/register.html`
- [Student listing](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py): `app.py`
- [Student page](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/templates/students.html): `templates/students.html`
- [Attendance report](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py): `app.py`
- [Report page](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/templates/report.html): `templates/report.html`
- [Scanner page](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/templates/scanner.html): `templates/scanner.html`

### Student registration

- [Register student](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py): `app.py`
- [QR generation](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py): `app.py`
- [QR image files](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/tree/main/static/qr_codes): `static/qr_codes`

### Attendance

- [Camera scanning](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py): `app.py`
- [Quick scan](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py): `app.py`
- [Standalone scanner](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/scanner.py): `scanner.py`
- [Save attendance](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/app.py): `app.py`

### Persistence

- **MySQL database**
- [Database config](https://github.com/jananimatheshwaran637-hub/qr-attendance-system/blob/main/dbconfig.py): `dbconfig.py`

### Other components

- **Administrator**
- **Camera**
- **Attendance API**

## Connections

- Administrator → Home page: opens
- Administrator → Register student: registers (evidence: `app.py`)
- Register student → Registration form: renders (evidence: `app.py`)
- Register student → QR generation: generates (evidence: `app.py`)
- QR generation → QR image files: writes (evidence: `app.py`)
- Register student → MySQL database: checks and inserts (evidence: `app.py`)
- Register student → Student listing: redirects (evidence: `app.py`)
- Administrator → Student listing: views (evidence: `app.py`)
- Student listing → MySQL database: reads (evidence: `app.py`)
- Student listing → Student page: renders (evidence: `app.py`)
- Camera → Camera scanning: provides frames (evidence: `app.py`)
- Administrator → Camera scanning: starts scan (evidence: `app.py`)
- Camera scanning → Save attendance: submits roll (evidence: `app.py`)
- Administrator → Quick scan: scans roll (evidence: `app.py`)
- Quick scan → Save attendance: calls (evidence: `app.py`)
- Save attendance → MySQL database: writes attendance (evidence: `app.py`)
- Camera → Standalone scanner: provides frames (evidence: `scanner.py`)
- Standalone scanner → Attendance API: posts roll (evidence: `scanner.py`)
- Administrator → Attendance report: views (evidence: `app.py`)
- Camera scanning → Attendance report: redirects (evidence: `app.py`)
- Quick scan → Attendance report: redirects (evidence: `app.py`)
- Attendance report → MySQL database: queries (evidence: `app.py`)
- Attendance report → Report page: renders (evidence: `app.py`)
- Administrator → Scanner page: opens
- Register student → Database config: uses settings (evidence: `app.py`)
- Student listing → Database config: uses settings (evidence: `app.py`)
- Save attendance → Database config: uses settings (evidence: `app.py`)
- Attendance report → Database config: uses settings (evidence: `app.py`)
