# n0ngxarm/checkclass architecture

> Architecture diagram of the GitHub repository n0ngxarm/checkclass, 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/n0ngxarm/checkclass
- Repository: https://github.com/n0ngxarm/checkclass

## Overview

Teachers use the attendance system to sign in, review class and attendance summaries, record student attendance, manage student records, and inspect daily or individual reports. The modern Next.js frontend calls a PHP JSON API backed by MySQL; a parallel server-rendered PHP interface is also present. The graph preserves the documented dashboard, attendance, student-management, and reporting capabilities. Relationships between the sampled Next.js client and API are explicit; several backend endpoints and legacy pages were not excerpted, so their internal call paths are not expanded.

Main entry points: [`frontend/lib/api.js`](https://github.com/n0ngxarm/checkclass/blob/main/frontend/lib/api.js) (API client), [`config/database.php`](https://github.com/n0ngxarm/checkclass/blob/main/config/database.php) (Database connection), [`includes/functions.php`](https://github.com/n0ngxarm/checkclass/blob/main/includes/functions.php) (PHP domain helpers), [`api/cors.php`](https://github.com/n0ngxarm/checkclass/blob/main/api/cors.php) (CORS and API auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interfaces"]
  node_next_dashboard["Analytics dashboard<br/>[page.js]"]
  node_next_attendance["Take attendance<br/>[page.js]"]
  node_next_students["Student management<br/>[page.js]"]
  node_next_reports["Daily and individual reports<br/>[page.js]"]
  node_date_picker["Date picker"]
  node_navbar["Navigation and session UI<br/>[Navbar.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_legacy_dashboard["PHP dashboard<br/>[dashboard.php]"]
  node_legacy_attendance["PHP attendance entry"]
  node_legacy_students["PHP student management<br/>[students.php]"]
  node_legacy_reports["PHP individual report"]
end

subgraph group_api["PHP API"]
  node_auth_api["Authentication endpoints<br/>[login.php]"]
  node_dashboard_api["Dashboard endpoint<br/>[dashboard.php]"]
  node_attendance_api["Attendance endpoint<br/>[attendance.php]"]
  node_students_api["Student endpoint<br/>[students.php]"]
  node_reports_api["Report endpoints<br/>[daily.php]"]
  node_classes_api["Class endpoint<br/>[classes.php]"]
end

subgraph group_domain["Attendance domain"]
end

subgraph group_data["Shared data and access"]
  node_cors_auth["CORS and API auth<br/>[cors.php]"]
  node_session_auth["PHP page auth<br/>[auth.php]"]
  node_php_helpers["PHP domain helpers<br/>[functions.php]"]
  node_database_config["Database connection<br/>[database.php]"]
  node_mysql[("MySQL database")]
end

node_teacher(("Teacher"))

node_teacher -->|"views"| node_next_dashboard
node_teacher -->|"records attendance"| node_next_attendance
node_teacher -->|"manages students"| node_next_students
node_teacher -->|"reviews reports"| node_next_reports
node_next_dashboard -.->|"requests data"| node_api_client
node_next_attendance -.->|"loads and saves"| node_api_client
node_next_students -.->|"manages via"| node_api_client
node_next_reports -->|"requests reports"| node_api_client
node_next_reports -->|"renders"| node_date_picker
node_next_dashboard -.->|"uses"| node_navbar
node_next_attendance -.->|"uses"| node_navbar
node_next_students -.->|"uses"| node_navbar
node_next_reports -->|"uses"| node_navbar
node_api_client -->|"sends auth requests"| node_auth_api
node_api_client -->|"requests dashboard"| node_dashboard_api
node_api_client -->|"loads and saves"| node_attendance_api
node_api_client -->|"manages students"| node_students_api
node_api_client -->|"requests reports"| node_reports_api
node_api_client -->|"requests classes"| node_classes_api
node_attendance_api -->|"initializes requests"| node_cors_auth
node_students_api -->|"authenticates requests"| node_cors_auth
node_auth_api -->|"uses shared API support"| node_cors_auth
node_dashboard_api -->|"uses shared API support"| node_cors_auth
node_reports_api -.->|"uses shared API support"| node_cors_auth
node_attendance_api -->|"opens connection"| node_database_config
node_students_api -->|"opens connection"| node_database_config
node_dashboard_api -->|"opens connection"| node_database_config
node_reports_api -.->|"opens connection"| node_database_config
node_database_config -->|"connects"| node_mysql
node_legacy_dashboard -->|"requires login"| node_session_auth
node_legacy_dashboard -->|"loads helpers"| node_php_helpers
node_legacy_attendance -->|"requires login"| node_session_auth
node_legacy_attendance -->|"loads helpers"| node_php_helpers
node_legacy_students -.->|"requires login"| node_session_auth
node_legacy_students -.->|"loads helpers"| node_php_helpers
node_legacy_reports -->|"requires login"| node_session_auth
node_legacy_reports -->|"loads helpers"| node_php_helpers
node_php_helpers -->|"opens connections"| node_database_config
node_legacy_dashboard -->|"queries attendance"| node_mysql

click node_next_dashboard "https://github.com/n0ngxarm/checkclass/blob/main/frontend/app/dashboard/page.js"
click node_next_attendance "https://github.com/n0ngxarm/checkclass/blob/main/frontend/app/attendance/take/page.js"
click node_next_students "https://github.com/n0ngxarm/checkclass/blob/main/frontend/app/students/page.js"
click node_next_reports "https://github.com/n0ngxarm/checkclass/blob/main/frontend/app/reports/page.js"
click node_date_picker "https://github.com/n0ngxarm/checkclass/blob/main/frontend/components/CustomDatePicker.jsx"
click node_navbar "https://github.com/n0ngxarm/checkclass/blob/main/frontend/components/Navbar.jsx"
click node_api_client "https://github.com/n0ngxarm/checkclass/blob/main/frontend/lib/api.js"
click node_legacy_dashboard "https://github.com/n0ngxarm/checkclass/blob/main/pages/dashboard.php"
click node_legacy_attendance "https://github.com/n0ngxarm/checkclass/blob/main/pages/attendance_take.php"
click node_legacy_students "https://github.com/n0ngxarm/checkclass/blob/main/pages/students.php"
click node_legacy_reports "https://github.com/n0ngxarm/checkclass/blob/main/pages/report_individual.php"
click node_auth_api "https://github.com/n0ngxarm/checkclass/blob/main/api/auth/login.php"
click node_dashboard_api "https://github.com/n0ngxarm/checkclass/blob/main/api/dashboard.php"
click node_attendance_api "https://github.com/n0ngxarm/checkclass/blob/main/api/attendance.php"
click node_students_api "https://github.com/n0ngxarm/checkclass/blob/main/api/students.php"
click node_reports_api "https://github.com/n0ngxarm/checkclass/blob/main/api/reports/daily.php"
click node_classes_api "https://github.com/n0ngxarm/checkclass/blob/main/api/classes.php"
click node_cors_auth "https://github.com/n0ngxarm/checkclass/blob/main/api/cors.php"
click node_session_auth "https://github.com/n0ngxarm/checkclass/blob/main/includes/auth.php"
click node_php_helpers "https://github.com/n0ngxarm/checkclass/blob/main/includes/functions.php"
click node_database_config "https://github.com/n0ngxarm/checkclass/blob/main/config/database.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_next_dashboard,node_next_attendance,node_next_students,node_next_reports,node_date_picker,node_navbar,node_api_client,node_legacy_dashboard,node_legacy_attendance,node_legacy_students,node_legacy_reports toneBlue
class node_auth_api,node_dashboard_api,node_attendance_api,node_students_api,node_reports_api,node_classes_api toneAmber
class node_cors_auth,node_session_auth,node_php_helpers,node_database_config,node_mysql toneRose
class node_teacher toneIndigo
```

## Components

### Web interfaces

- [Analytics dashboard](https://github.com/n0ngxarm/checkclass/blob/main/frontend/app/dashboard/page.js): `frontend/app/dashboard/page.js`
- [Take attendance](https://github.com/n0ngxarm/checkclass/blob/main/frontend/app/attendance/take/page.js): `frontend/app/attendance/take/page.js`
- [Student management](https://github.com/n0ngxarm/checkclass/blob/main/frontend/app/students/page.js): `frontend/app/students/page.js`
- [Daily and individual reports](https://github.com/n0ngxarm/checkclass/blob/main/frontend/app/reports/page.js): `frontend/app/reports/page.js`
- [Date picker](https://github.com/n0ngxarm/checkclass/blob/main/frontend/components/CustomDatePicker.jsx): `frontend/components/CustomDatePicker.jsx`
- [Navigation and session UI](https://github.com/n0ngxarm/checkclass/blob/main/frontend/components/Navbar.jsx): `frontend/components/Navbar.jsx`
- [API client](https://github.com/n0ngxarm/checkclass/blob/main/frontend/lib/api.js): `frontend/lib/api.js`
- [PHP dashboard](https://github.com/n0ngxarm/checkclass/blob/main/pages/dashboard.php): `pages/dashboard.php`
- [PHP attendance entry](https://github.com/n0ngxarm/checkclass/blob/main/pages/attendance_take.php): `pages/attendance_take.php`
- [PHP student management](https://github.com/n0ngxarm/checkclass/blob/main/pages/students.php): `pages/students.php`
- [PHP individual report](https://github.com/n0ngxarm/checkclass/blob/main/pages/report_individual.php): `pages/report_individual.php`

### PHP API

- [Authentication endpoints](https://github.com/n0ngxarm/checkclass/blob/main/api/auth/login.php): `api/auth/login.php`
- [Dashboard endpoint](https://github.com/n0ngxarm/checkclass/blob/main/api/dashboard.php): `api/dashboard.php`
- [Attendance endpoint](https://github.com/n0ngxarm/checkclass/blob/main/api/attendance.php): `api/attendance.php`
- [Student endpoint](https://github.com/n0ngxarm/checkclass/blob/main/api/students.php): `api/students.php`
- [Report endpoints](https://github.com/n0ngxarm/checkclass/blob/main/api/reports/daily.php): `api/reports/daily.php`
- [Class endpoint](https://github.com/n0ngxarm/checkclass/blob/main/api/classes.php): `api/classes.php`

### Shared data and access

- [CORS and API auth](https://github.com/n0ngxarm/checkclass/blob/main/api/cors.php): `api/cors.php`
- [PHP page auth](https://github.com/n0ngxarm/checkclass/blob/main/includes/auth.php): `includes/auth.php`
- [PHP domain helpers](https://github.com/n0ngxarm/checkclass/blob/main/includes/functions.php): `includes/functions.php`
- [Database connection](https://github.com/n0ngxarm/checkclass/blob/main/config/database.php): `config/database.php`
- **MySQL database**

### Other components

- **Teacher**

## Connections

- Teacher → Analytics dashboard: views
- Teacher → Take attendance: records attendance
- Teacher → Student management: manages students
- Teacher → Daily and individual reports: reviews reports
- Analytics dashboard → API client: requests data (evidence: `frontend/app/dashboard/page.js`)
- Take attendance → API client: loads and saves (evidence: `frontend/app/attendance/take/page.js`)
- Student management → API client: manages via (evidence: `frontend/app/students/page.js`)
- Daily and individual reports → API client: requests reports (evidence: `frontend/app/reports/page.js`)
- Daily and individual reports → Date picker: renders (evidence: `frontend/app/reports/page.js`)
- Analytics dashboard → Navigation and session UI: uses (evidence: `frontend/app/dashboard/page.js`)
- Take attendance → Navigation and session UI: uses (evidence: `frontend/app/attendance/take/page.js`)
- Student management → Navigation and session UI: uses (evidence: `frontend/app/students/page.js`)
- Daily and individual reports → Navigation and session UI: uses (evidence: `frontend/app/reports/page.js`)
- API client → Authentication endpoints: sends auth requests (evidence: `frontend/lib/api.js`)
- API client → Dashboard endpoint: requests dashboard (evidence: `frontend/lib/api.js`)
- API client → Attendance endpoint: loads and saves (evidence: `frontend/lib/api.js`)
- API client → Student endpoint: manages students (evidence: `frontend/lib/api.js`)
- API client → Report endpoints: requests reports (evidence: `frontend/lib/api.js`)
- API client → Class endpoint: requests classes (evidence: `frontend/lib/api.js`)
- Attendance endpoint → CORS and API auth: initializes requests (evidence: `api/attendance.php`)
- Student endpoint → CORS and API auth: authenticates requests (evidence: `api/students.php`)
- Authentication endpoints → CORS and API auth: uses shared API support (evidence: `api/auth/login.php`)
- Dashboard endpoint → CORS and API auth: uses shared API support (evidence: `api/dashboard.php`)
- Report endpoints → CORS and API auth: uses shared API support (evidence: `api/reports/daily.php`)
- Attendance endpoint → Database connection: opens connection (evidence: `api/attendance.php`)
- Student endpoint → Database connection: opens connection (evidence: `api/students.php`)
- Dashboard endpoint → Database connection: opens connection (evidence: `api/dashboard.php`)
- Report endpoints → Database connection: opens connection (evidence: `api/reports/daily.php`)
- Database connection → MySQL database: connects (evidence: `config/database.php`)
- PHP dashboard → PHP page auth: requires login (evidence: `pages/dashboard.php`)
- PHP dashboard → PHP domain helpers: loads helpers (evidence: `pages/dashboard.php`)
- PHP attendance entry → PHP page auth: requires login (evidence: `pages/attendance_take.php`)
- PHP attendance entry → PHP domain helpers: loads helpers (evidence: `pages/attendance_take.php`)
- PHP student management → PHP page auth: requires login (evidence: `pages/students.php`)
- PHP student management → PHP domain helpers: loads helpers (evidence: `pages/students.php`)
- PHP individual report → PHP page auth: requires login (evidence: `pages/report_individual.php`)
- PHP individual report → PHP domain helpers: loads helpers (evidence: `pages/report_individual.php`)
- PHP domain helpers → Database connection: opens connections (evidence: `includes/functions.php`)
- PHP dashboard → MySQL database: queries attendance (evidence: `pages/dashboard.php`)
