# raihanbrliantoni-arch/presentech architecture

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

## Overview

PresenTech is a school RFID/IoT attendance system: ESP32 devices submit card taps and heartbeats to a Laravel API, which records attendance and serves role-based React dashboards. Admins maintain school and device data; teachers and students view schedules and attendance, and can request corrections. The README documents automation, reporting, exports, backups, and optional MQTT. Several controllers and dashboard panels are unsampled, so those branches are represented at their existing directory paths; edges rely on README statements or visible source references.

Main entry points: [`PresenTech-Backend/routes/api.php`](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/routes/api.php) (REST routes), [`PresenTech-frontend/src/App.jsx`](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-frontend/src/App.jsx) (React app shell), [`PresenTech-Backend/app/Http/Controllers/Api/AttendanceController.php`](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/AttendanceController.php) (Attendance API), [`PresenTech-Backend/app/Http/Controllers/Api/DeviceController.php`](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/DeviceController.php) (Device API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Users and clients"]
end

subgraph group_web["Web application"]
  node_react_app["React app shell<br/>[App.jsx]"]
  node_admin_ui["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_teacher_ui["Teacher dashboard<br/>[GuruDashboard.jsx]"]
  node_student_ui["Student dashboard<br/>[SiswaDashboard.jsx]"]
  node_api_client["API clients"]
end

subgraph group_api["Laravel API"]
  node_api_routes["REST routes<br/>[api.php]"]
  node_auth["Authentication and roles<br/>[AuthController.php]"]
  node_school_admin["School management"]
end

subgraph group_attendance["Attendance domain"]
  node_attendance_api["Attendance API"]
  node_corrections["Attendance corrections"]
  node_reporting["Reports and exports"]
  node_attendance_recording["Device attendance recorder"]
  node_attendance_model[("Attendance records<br/>[Attendance.php]")]
  node_student_model[("Student records<br/>[Student.php]")]
end

subgraph group_operations["Device and operations"]
  node_device_api["Device API"]
  node_device_runtime["Device runtime<br/>[DeviceRuntime.php]"]
  node_device_model[("Device registry<br/>[Device.php]")]
  node_mqtt_bus["MQTT bridge<br/>[MqttDeviceBus.php]"]
  node_automation["Attendance and offline automation"]
  node_system_ops["System settings and backup"]
end

node_admin(("Admin"))
node_teacher(("Teacher"))
node_student_user(("Student"))
node_esp32["ESP32 RFID device"]
node_mysql[("MySQL database")]

node_admin -->|"uses"| node_react_app
node_teacher -->|"uses"| node_react_app
node_student_user -->|"uses"| node_react_app
node_esp32 -->|"sends taps and heartbeat"| node_api_routes
node_esp32 -.->|"may use MQTT"| node_mqtt_bus
node_react_app -->|"renders"| node_admin_ui
node_react_app -->|"renders"| node_teacher_ui
node_react_app -->|"renders"| node_student_ui
node_admin_ui -.->|"requests data"| node_api_client
node_teacher_ui -.->|"requests data"| node_api_client
node_student_ui -.->|"requests data"| node_api_client
node_api_client -->|"calls API"| node_api_routes
node_api_routes -->|"routes to"| node_auth
node_api_routes -->|"routes to"| node_attendance_api
node_api_routes -->|"routes to"| node_corrections
node_api_routes -->|"routes to"| node_reporting
node_api_routes -->|"routes to"| node_device_api
node_api_routes -->|"routes to"| node_school_admin
node_api_routes -->|"routes to"| node_system_ops
node_attendance_api -->|"records device taps"| node_attendance_recording
node_attendance_api -->|"reads and writes"| node_attendance_model
node_attendance_api -->|"resolves student"| node_student_model
node_reporting -->|"reads records"| node_attendance_model
node_corrections -.->|"updates attendance"| node_attendance_model
node_device_api -->|"updates device"| node_device_model
node_device_api -->|"uses runtime"| node_device_runtime
node_device_api -->|"publishes commands"| node_mqtt_bus
node_automation -->|"marks absences"| node_attendance_model
node_automation -->|"marks offline"| node_device_model
node_system_ops -->|"backs up database"| node_mysql
node_attendance_api -->|"persists attendance"| node_mysql
node_device_api -->|"persists device state"| node_mysql

click node_react_app "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-frontend/src/App.jsx"
click node_admin_ui "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-frontend/src/dashboard-admin/AdminDashboard.jsx"
click node_teacher_ui "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-frontend/src/dashboard-guru/GuruDashboard.jsx"
click node_student_ui "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-frontend/src/dashboard-siswa/SiswaDashboard.jsx"
click node_api_client "https://github.com/raihanbrliantoni-arch/presentech/tree/main/PresenTech-frontend/src/api"
click node_api_routes "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/routes/api.php"
click node_auth "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/AuthController.php"
click node_school_admin "https://github.com/raihanbrliantoni-arch/presentech/tree/main/PresenTech-Backend/app/Http/Controllers/Api"
click node_attendance_api "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/AttendanceController.php"
click node_corrections "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/AttendanceCorrectionController.php"
click node_reporting "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/ReportController.php"
click node_attendance_recording "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Support/DeviceAttendanceRecorder.php"
click node_attendance_model "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Models/Attendance.php"
click node_student_model "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Models/Student.php"
click node_device_api "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/DeviceController.php"
click node_device_runtime "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Support/DeviceRuntime.php"
click node_device_model "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Models/Device.php"
click node_mqtt_bus "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Support/MqttDeviceBus.php"
click node_automation "https://github.com/raihanbrliantoni-arch/presentech/tree/main/PresenTech-Backend/app/Console/Commands"
click node_system_ops "https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/SystemBackupController.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_react_app,node_admin_ui,node_teacher_ui,node_student_ui,node_api_client,node_mysql toneAmber
class node_api_routes,node_auth,node_school_admin toneMint
class node_attendance_api,node_corrections,node_reporting,node_attendance_recording,node_attendance_model,node_student_model toneRose
class node_device_api,node_device_runtime,node_device_model,node_mqtt_bus,node_automation,node_system_ops,node_admin,node_teacher,node_student_user,node_esp32 toneIndigo
```

## Components

### Web application

- [React app shell](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-frontend/src/App.jsx): `PresenTech-frontend/src/App.jsx`
- [Admin dashboard](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-frontend/src/dashboard-admin/AdminDashboard.jsx): `PresenTech-frontend/src/dashboard-admin/AdminDashboard.jsx`
- [Teacher dashboard](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-frontend/src/dashboard-guru/GuruDashboard.jsx): `PresenTech-frontend/src/dashboard-guru/GuruDashboard.jsx`
- [Student dashboard](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-frontend/src/dashboard-siswa/SiswaDashboard.jsx): `PresenTech-frontend/src/dashboard-siswa/SiswaDashboard.jsx`
- [API clients](https://github.com/raihanbrliantoni-arch/presentech/tree/main/PresenTech-frontend/src/api): `PresenTech-frontend/src/api`

### Laravel API

- [REST routes](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/routes/api.php): `PresenTech-Backend/routes/api.php`
- [Authentication and roles](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/AuthController.php): `PresenTech-Backend/app/Http/Controllers/Api/AuthController.php`
- [School management](https://github.com/raihanbrliantoni-arch/presentech/tree/main/PresenTech-Backend/app/Http/Controllers/Api): `PresenTech-Backend/app/Http/Controllers/Api`

### Attendance domain

- [Attendance API](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/AttendanceController.php): `PresenTech-Backend/app/Http/Controllers/Api/AttendanceController.php`
- [Attendance corrections](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/AttendanceCorrectionController.php): `PresenTech-Backend/app/Http/Controllers/Api/AttendanceCorrectionController.php`
- [Reports and exports](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/ReportController.php): `PresenTech-Backend/app/Http/Controllers/Api/ReportController.php`
- [Device attendance recorder](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Support/DeviceAttendanceRecorder.php): `PresenTech-Backend/app/Support/DeviceAttendanceRecorder.php`
- [Attendance records](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Models/Attendance.php): `PresenTech-Backend/app/Models/Attendance.php`
- [Student records](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Models/Student.php): `PresenTech-Backend/app/Models/Student.php`

### Device and operations

- [Device API](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/DeviceController.php): `PresenTech-Backend/app/Http/Controllers/Api/DeviceController.php`
- [Device runtime](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Support/DeviceRuntime.php): `PresenTech-Backend/app/Support/DeviceRuntime.php`
- [Device registry](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Models/Device.php): `PresenTech-Backend/app/Models/Device.php`
- [MQTT bridge](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Support/MqttDeviceBus.php): `PresenTech-Backend/app/Support/MqttDeviceBus.php`
- [Attendance and offline automation](https://github.com/raihanbrliantoni-arch/presentech/tree/main/PresenTech-Backend/app/Console/Commands): `PresenTech-Backend/app/Console/Commands`
- [System settings and backup](https://github.com/raihanbrliantoni-arch/presentech/blob/main/PresenTech-Backend/app/Http/Controllers/Api/SystemBackupController.php): `PresenTech-Backend/app/Http/Controllers/Api/SystemBackupController.php`

### Other components

- **Admin**
- **Teacher**
- **Student**
- **ESP32 RFID device**
- **MySQL database**

## Connections

- Admin → React app shell: uses (evidence: `README.md`)
- Teacher → React app shell: uses (evidence: `README.md`)
- Student → React app shell: uses (evidence: `README.md`)
- ESP32 RFID device → REST routes: sends taps and heartbeat (evidence: `README.md`)
- ESP32 RFID device → MQTT bridge: may use MQTT (evidence: `README.md`)
- React app shell → Admin dashboard: renders (evidence: `PresenTech-frontend/src/App.jsx`)
- React app shell → Teacher dashboard: renders (evidence: `PresenTech-frontend/src/App.jsx`)
- React app shell → Student dashboard: renders (evidence: `PresenTech-frontend/src/App.jsx`)
- Admin dashboard → API clients: requests data (evidence: `PresenTech-frontend/src/dashboard-admin/AdminDashboard.jsx`)
- Teacher dashboard → API clients: requests data (evidence: `PresenTech-frontend/src/dashboard-guru/GuruDashboard.jsx`)
- Student dashboard → API clients: requests data (evidence: `PresenTech-frontend/src/dashboard-siswa/SiswaDashboard.jsx`)
- API clients → REST routes: calls API (evidence: `README.md`)
- REST routes → Authentication and roles: routes to (evidence: `PresenTech-Backend/routes/api.php`)
- REST routes → Attendance API: routes to (evidence: `PresenTech-Backend/routes/api.php`)
- REST routes → Attendance corrections: routes to (evidence: `PresenTech-Backend/routes/api.php`)
- REST routes → Reports and exports: routes to (evidence: `PresenTech-Backend/routes/api.php`)
- REST routes → Device API: routes to (evidence: `PresenTech-Backend/routes/api.php`)
- REST routes → School management: routes to (evidence: `PresenTech-Backend/routes/api.php`)
- REST routes → System settings and backup: routes to (evidence: `PresenTech-Backend/routes/api.php`)
- Attendance API → Device attendance recorder: records device taps (evidence: `PresenTech-Backend/app/Http/Controllers/Api/AttendanceController.php`)
- Attendance API → Attendance records: reads and writes (evidence: `PresenTech-Backend/app/Http/Controllers/Api/AttendanceController.php`)
- Attendance API → Student records: resolves student (evidence: `PresenTech-Backend/app/Http/Controllers/Api/AttendanceController.php`)
- Reports and exports → Attendance records: reads records (evidence: `PresenTech-Backend/app/Http/Controllers/Api/ReportController.php`)
- Attendance corrections → Attendance records: updates attendance (evidence: `PresenTech-Backend/app/Http/Controllers/Api/AttendanceCorrectionController.php`)
- Device API → Device registry: updates device (evidence: `PresenTech-Backend/app/Http/Controllers/Api/DeviceController.php`)
- Device API → Device runtime: uses runtime (evidence: `PresenTech-Backend/app/Http/Controllers/Api/DeviceController.php`)
- Device API → MQTT bridge: publishes commands (evidence: `PresenTech-Backend/app/Http/Controllers/Api/DeviceController.php`)
- Attendance and offline automation → Attendance records: marks absences (evidence: `README.md`)
- Attendance and offline automation → Device registry: marks offline (evidence: `README.md`)
- System settings and backup → MySQL database: backs up database (evidence: `README.md`)
- Attendance API → MySQL database: persists attendance (evidence: `README.md`)
- Device API → MySQL database: persists device state (evidence: `README.md`)
