# zahfathi085-glitch/student-attendance-system-using-qr-code architecture

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

- Interactive diagram: https://gitdiagram.com/zahfathi085-glitch/student-attendance-system-using-qr-code
- Repository: https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code

## Overview

AttendQR is a PHP/MySQL attendance system for students, lecturers, and administrators. Its central workflow is lecturer session creation and QR refresh, followed by student scanning, session validation, and attendance recording; students and lecturers then review attendance through their dashboards. Separate branches cover registration and role-based authentication, optional face verification, notifications, timetables, and administrator management. The README documents these capabilities and the backend/database flow. Several endpoint implementations were not sampled, so their internal calls and dashboard-to-endpoint wiring are not asserted.

Main entry points: [`student-dashboard.php`](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/student-dashboard.php) (Student dashboard), [`admin-dashboard.php`](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/admin-dashboard.php) (Administrator dashboard), [`lecturer-dashboard.php`](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/lecturer-dashboard.php) (Lecturer dashboard), [`api/_bootstrap.php`](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/api/_bootstrap.php) (API bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and identity"]
  node_landing["Public landing<br/>[index.php]"]
  node_auth_pages["Login and registration<br/>[login.php]"]
  node_auth_client["Auth client<br/>[auth.js]"]
  node_auth_api["Auth endpoints"]
end

subgraph group_attendance["QR attendance"]
  node_student_ui["Student dashboard"]
  node_lecturer_ui["Lecturer dashboard"]
  node_session_start["Start attendance session<br/>[start_session.php]"]
  node_session_tokens["Session and QR tokens"]
  node_attendance_mark["Record attendance"]
  node_attendance_views["Attendance views"]
  node_face_verification["Face verification"]
end

subgraph group_academic["Academic management"]
  node_admin_ui["Administrator dashboard"]
  node_academic_admin["Accounts and academics"]
  node_timetable["Timetable management"]
end

subgraph group_operations["Monitoring and messaging"]
  node_notifications["Notifications and messages"]
  node_activity["Activity monitoring"]
end

subgraph group_platform["Backend foundation"]
  node_api_bootstrap["API bootstrap<br/>[_bootstrap.php]"]
  node_db_config["Database connection<br/>[db.php]"]
end

node_users(("Students, lecturers, admins"))
node_mysql[("MySQL database")]

node_users -->|"visit"| node_landing
node_landing -->|"register or sign in"| node_auth_pages
node_auth_pages -->|"use auth client"| node_auth_client
node_auth_client -.->|"authenticate"| node_auth_api
node_users -->|"use student dashboard"| node_student_ui
node_users -->|"use lecturer dashboard"| node_lecturer_ui
node_users -->|"use admin dashboard"| node_admin_ui
node_lecturer_ui -->|"start session"| node_session_start
node_session_start -->|"create token"| node_session_tokens
node_student_ui -->|"retrieve session token"| node_session_tokens
node_student_ui -->|"submit scan"| node_attendance_mark
node_attendance_mark -->|"record attendance"| node_mysql
node_lecturer_ui -->|"view records"| node_attendance_views
node_student_ui -->|"view records"| node_attendance_views
node_auth_pages -->|"optional face enrollment"| node_face_verification
node_student_ui -.->|"optional face verification"| node_face_verification
node_admin_ui -->|"manage accounts and courses"| node_academic_admin
node_admin_ui -->|"manage timetables"| node_timetable
node_admin_ui -->|"send messages"| node_notifications
node_lecturer_ui -->|"send messages"| node_notifications
node_admin_ui -->|"monitor activity"| node_activity
node_api_bootstrap -->|"loads connection"| node_db_config
node_db_config -->|"connects"| node_mysql
node_auth_api -->|"uses shared bootstrap"| node_api_bootstrap
node_session_start -->|"uses shared bootstrap"| node_api_bootstrap
node_attendance_mark -.->|"uses shared bootstrap"| node_api_bootstrap

click node_landing "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/index.php"
click node_auth_pages "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/login.php"
click node_auth_client "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/auth.js"
click node_auth_api "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api"
click node_student_ui "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/student-dashboard.php"
click node_lecturer_ui "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/lecturer-dashboard.php"
click node_session_start "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/api/start_session.php"
click node_session_tokens "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api"
click node_attendance_mark "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/api/mark_attendance.php"
click node_attendance_views "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api"
click node_face_verification "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api"
click node_admin_ui "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/admin-dashboard.php"
click node_academic_admin "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api"
click node_timetable "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api"
click node_notifications "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api"
click node_activity "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api"
click node_api_bootstrap "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/api/_bootstrap.php"
click node_db_config "https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/db.php"

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_landing,node_auth_pages,node_auth_client,node_auth_api toneBlue
class node_student_ui,node_lecturer_ui,node_session_start,node_session_tokens,node_attendance_mark,node_attendance_views,node_face_verification,node_mysql toneAmber
class node_admin_ui,node_academic_admin,node_timetable toneMint
class node_notifications,node_activity toneRose
class node_api_bootstrap,node_db_config,node_users toneIndigo
```

## Components

### Entry and identity

- [Public landing](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/index.php): `index.php`
- [Login and registration](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/login.php): `login.php`
- [Auth client](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/auth.js): `auth.js`
- [Auth endpoints](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api): `api`

### QR attendance

- [Student dashboard](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/student-dashboard.php): `student-dashboard.php`
- [Lecturer dashboard](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/lecturer-dashboard.php): `lecturer-dashboard.php`
- [Start attendance session](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/api/start_session.php): `api/start_session.php`
- [Session and QR tokens](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api): `api`
- [Record attendance](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/api/mark_attendance.php): `api/mark_attendance.php`
- [Attendance views](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api): `api`
- [Face verification](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api): `api`

### Academic management

- [Administrator dashboard](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/admin-dashboard.php): `admin-dashboard.php`
- [Accounts and academics](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api): `api`
- [Timetable management](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api): `api`

### Monitoring and messaging

- [Notifications and messages](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api): `api`
- [Activity monitoring](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/tree/main/api): `api`

### Backend foundation

- [API bootstrap](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/api/_bootstrap.php): `api/_bootstrap.php`
- [Database connection](https://github.com/zahfathi085-glitch/student-attendance-system-using-qr-code/blob/main/db.php): `db.php`

### Other components

- **Students, lecturers, admins**
- **MySQL database**

## Connections

- Students, lecturers, admins → Public landing: visit (evidence: `README.md`)
- Public landing → Login and registration: register or sign in (evidence: `index.php`)
- Login and registration → Auth client: use auth client
- Auth client → Auth endpoints: authenticate
- Students, lecturers, admins → Student dashboard: use student dashboard (evidence: `README.md`)
- Students, lecturers, admins → Lecturer dashboard: use lecturer dashboard (evidence: `README.md`)
- Students, lecturers, admins → Administrator dashboard: use admin dashboard (evidence: `README.md`)
- Lecturer dashboard → Start attendance session: start session (evidence: `README.md`)
- Start attendance session → Session and QR tokens: create token (evidence: `api/start_session.php`)
- Student dashboard → Session and QR tokens: retrieve session token (evidence: `README.md`)
- Student dashboard → Record attendance: submit scan (evidence: `README.md`)
- Record attendance → MySQL database: record attendance (evidence: `README.md`)
- Lecturer dashboard → Attendance views: view records (evidence: `README.md`)
- Student dashboard → Attendance views: view records (evidence: `README.md`)
- Login and registration → Face verification: optional face enrollment
- Student dashboard → Face verification: optional face verification (evidence: `README.md`)
- Administrator dashboard → Accounts and academics: manage accounts and courses (evidence: `README.md`)
- Administrator dashboard → Timetable management: manage timetables (evidence: `README.md`)
- Administrator dashboard → Notifications and messages: send messages (evidence: `README.md`)
- Lecturer dashboard → Notifications and messages: send messages (evidence: `README.md`)
- Administrator dashboard → Activity monitoring: monitor activity (evidence: `README.md`)
- API bootstrap → Database connection: loads connection (evidence: `api/_bootstrap.php`)
- Database connection → MySQL database: connects (evidence: `db.php`)
- Auth endpoints → API bootstrap: uses shared bootstrap (evidence: `api/_bootstrap.php`)
- Start attendance session → API bootstrap: uses shared bootstrap (evidence: `api/start_session.php`)
- Record attendance → API bootstrap: uses shared bootstrap (evidence: `api/mark_attendance.php`)
