# fadilsnt/iot-7k architecture

> Architecture diagram of the GitHub repository fadilsnt/iot-7k, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fadilsnt/iot-7k
- Repository: https://github.com/fadilsnt/iot-7k

## Overview

IoT TKHS is a Laravel monitoring application for temperature, moisture, and machine/RPM telemetry. In the primary workflow, IoT devices submit sensor readings; the API stores readings and updates sensor condition, and the dashboard presents recent status and trends. The product also documents alert history, threshold and sensor administration, filtered logs and exports, and profile management. Machine/RPM reporting is represented separately based on sampled controllers and the source index. Some routes and UI wiring were not sampled, so their connections are omitted.

Main entry points: [`app/Models/Sensor.php`](https://github.com/fadilsnt/iot-7k/blob/main/app/Models/Sensor.php) (Sensors and thresholds), [`app/Http/Controllers/Api/SensorReadingController.php`](https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/Api/SensorReadingController.php) (Reading API), [`app/Http/Controllers/MachineController.php`](https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/MachineController.php) (Machine reports), [`app/Http/Controllers/RpmController.php`](https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/RpmController.php) (RPM reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["IoT ingestion"]
  node_sensor_api["Reading API"]
  node_device_model["Devices<br/>[Device.php]"]
  node_sensor_model["Sensors and thresholds<br/>[Sensor.php]"]
  node_reading_model[("Sensor readings<br/>[SensorReading.php]")]
end

subgraph group_monitoring["Monitoring and alerts"]
  node_dashboard_api["Dashboard data API"]
  node_dashboard_controller["Dashboard queries"]
  node_dashboard_view["Live dashboard"]
  node_notification_log[("Notification history")]
  node_activity_log["Activity log"]
  node_condition_job["Condition updates"]
end

subgraph group_reporting["Machine reporting"]
  node_machine_controller["Machine reports"]
  node_machine_readings[("Machine readings<br/>[MachineReading.php]")]
  node_rpm_controller["RPM reports<br/>[RpmController.php]"]
  node_rpm_readings[("RPM readings<br/>[RpmReadings.php]")]
  node_history_export["History export"]
  node_report_export["Machine report export"]
end

subgraph group_access["Administration and access"]
  node_sensor_admin["Sensor management"]
  node_user_model[("User accounts<br/>[User.php]")]
  node_registration["Registration"]
  node_auth_routes["Authentication routes<br/>[auth.php]"]
end

node_iot(("IoT devices"))

node_iot -->|"submits readings"| node_sensor_api
node_sensor_api -->|"looks up device"| node_device_model
node_sensor_api -->|"resolves sensor"| node_sensor_model
node_sensor_api -->|"stores readings"| node_reading_model
node_sensor_api -->|"updates condition"| node_sensor_model
node_sensor_model -->|"relates readings"| node_reading_model
node_sensor_model -.->|"creates alerts"| node_notification_log
node_dashboard_controller -->|"queries sensors"| node_sensor_model
node_dashboard_controller -->|"queries readings"| node_reading_model
node_dashboard_view -.->|"refreshes data"| node_dashboard_api
node_dashboard_view -.->|"renders dashboard"| node_dashboard_controller
node_activity_log -.->|"lists history"| node_notification_log
node_condition_job -.->|"updates conditions"| node_sensor_model
node_machine_controller -->|"queries readings"| node_machine_readings
node_machine_controller -->|"downloads history"| node_history_export
node_machine_controller -->|"downloads report"| node_report_export
node_rpm_controller -->|"queries readings"| node_rpm_readings
node_rpm_controller -->|"downloads history"| node_history_export
node_rpm_controller -.->|"downloads report"| node_report_export
node_sensor_admin -.->|"manages sensors"| node_sensor_model
node_registration -->|"creates account"| node_user_model
node_auth_routes -->|"routes registration"| node_registration

click node_sensor_api "https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/Api/SensorReadingController.php"
click node_device_model "https://github.com/fadilsnt/iot-7k/blob/main/app/Models/Device.php"
click node_sensor_model "https://github.com/fadilsnt/iot-7k/blob/main/app/Models/Sensor.php"
click node_reading_model "https://github.com/fadilsnt/iot-7k/blob/main/app/Models/SensorReading.php"
click node_dashboard_api "https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/Api/DashboardDataController.php"
click node_dashboard_controller "https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/DashboardController.php"
click node_dashboard_view "https://github.com/fadilsnt/iot-7k/blob/main/resources/views/dashboard.blade.php"
click node_notification_log "https://github.com/fadilsnt/iot-7k/blob/main/app/Models/NotificationLog.php"
click node_activity_log "https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/ActivityLogController.php"
click node_condition_job "https://github.com/fadilsnt/iot-7k/blob/main/app/Console/Commands/UpdateSensorConditions.php"
click node_machine_controller "https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/MachineController.php"
click node_machine_readings "https://github.com/fadilsnt/iot-7k/blob/main/app/Models/MachineReading.php"
click node_rpm_controller "https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/RpmController.php"
click node_rpm_readings "https://github.com/fadilsnt/iot-7k/blob/main/app/Models/RpmReadings.php"
click node_history_export "https://github.com/fadilsnt/iot-7k/blob/main/app/Exports/MachineHistoryExport.php"
click node_report_export "https://github.com/fadilsnt/iot-7k/blob/main/app/Exports/MachineReportExport.php"
click node_sensor_admin "https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/SensorController.php"
click node_user_model "https://github.com/fadilsnt/iot-7k/blob/main/app/Models/User.php"
click node_registration "https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_auth_routes "https://github.com/fadilsnt/iot-7k/blob/main/routes/auth.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_sensor_api,node_device_model,node_sensor_model,node_reading_model toneBlue
class node_dashboard_api,node_dashboard_controller,node_dashboard_view,node_notification_log,node_activity_log,node_condition_job toneAmber
class node_machine_controller,node_machine_readings,node_rpm_controller,node_rpm_readings,node_history_export,node_report_export toneMint
class node_sensor_admin,node_user_model,node_registration,node_auth_routes toneRose
class node_iot toneIndigo
```

## Components

### IoT ingestion

- [Reading API](https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/Api/SensorReadingController.php): `app/Http/Controllers/Api/SensorReadingController.php`
- [Devices](https://github.com/fadilsnt/iot-7k/blob/main/app/Models/Device.php): `app/Models/Device.php`
- [Sensors and thresholds](https://github.com/fadilsnt/iot-7k/blob/main/app/Models/Sensor.php): `app/Models/Sensor.php`
- [Sensor readings](https://github.com/fadilsnt/iot-7k/blob/main/app/Models/SensorReading.php): `app/Models/SensorReading.php`

### Monitoring and alerts

- [Dashboard data API](https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/Api/DashboardDataController.php): `app/Http/Controllers/Api/DashboardDataController.php`
- [Dashboard queries](https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Live dashboard](https://github.com/fadilsnt/iot-7k/blob/main/resources/views/dashboard.blade.php): `resources/views/dashboard.blade.php`
- [Notification history](https://github.com/fadilsnt/iot-7k/blob/main/app/Models/NotificationLog.php): `app/Models/NotificationLog.php`
- [Activity log](https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/ActivityLogController.php): `app/Http/Controllers/ActivityLogController.php`
- [Condition updates](https://github.com/fadilsnt/iot-7k/blob/main/app/Console/Commands/UpdateSensorConditions.php): `app/Console/Commands/UpdateSensorConditions.php`

### Machine reporting

- [Machine reports](https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/MachineController.php): `app/Http/Controllers/MachineController.php`
- [Machine readings](https://github.com/fadilsnt/iot-7k/blob/main/app/Models/MachineReading.php): `app/Models/MachineReading.php`
- [RPM reports](https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/RpmController.php): `app/Http/Controllers/RpmController.php`
- [RPM readings](https://github.com/fadilsnt/iot-7k/blob/main/app/Models/RpmReadings.php): `app/Models/RpmReadings.php`
- [History export](https://github.com/fadilsnt/iot-7k/blob/main/app/Exports/MachineHistoryExport.php): `app/Exports/MachineHistoryExport.php`
- [Machine report export](https://github.com/fadilsnt/iot-7k/blob/main/app/Exports/MachineReportExport.php): `app/Exports/MachineReportExport.php`

### Administration and access

- [Sensor management](https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/SensorController.php): `app/Http/Controllers/SensorController.php`
- [User accounts](https://github.com/fadilsnt/iot-7k/blob/main/app/Models/User.php): `app/Models/User.php`
- [Registration](https://github.com/fadilsnt/iot-7k/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php): `app/Http/Controllers/Auth/RegisteredUserController.php`
- [Authentication routes](https://github.com/fadilsnt/iot-7k/blob/main/routes/auth.php): `routes/auth.php`

### Other components

- **IoT devices**

## Connections

- IoT devices → Reading API: submits readings (evidence: `app/Http/Controllers/Api/SensorReadingController.php`)
- Reading API → Devices: looks up device (evidence: `app/Http/Controllers/Api/SensorReadingController.php`)
- Reading API → Sensors and thresholds: resolves sensor (evidence: `app/Http/Controllers/Api/SensorReadingController.php`)
- Reading API → Sensor readings: stores readings (evidence: `app/Http/Controllers/Api/SensorReadingController.php`)
- Reading API → Sensors and thresholds: updates condition (evidence: `app/Http/Controllers/Api/SensorReadingController.php`)
- Sensors and thresholds → Sensor readings: relates readings (evidence: `app/Models/Sensor.php`)
- Sensors and thresholds → Notification history: creates alerts
- Dashboard queries → Sensors and thresholds: queries sensors (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard queries → Sensor readings: queries readings (evidence: `app/Http/Controllers/DashboardController.php`)
- Live dashboard → Dashboard data API: refreshes data
- Live dashboard → Dashboard queries: renders dashboard (evidence: `README.md`)
- Activity log → Notification history: lists history (evidence: `README.md`)
- Condition updates → Sensors and thresholds: updates conditions
- Machine reports → Machine readings: queries readings (evidence: `app/Http/Controllers/MachineController.php`)
- Machine reports → History export: downloads history (evidence: `app/Http/Controllers/MachineController.php`)
- Machine reports → Machine report export: downloads report (evidence: `app/Http/Controllers/MachineController.php`)
- RPM reports → RPM readings: queries readings (evidence: `app/Http/Controllers/RpmController.php`)
- RPM reports → History export: downloads history (evidence: `app/Http/Controllers/RpmController.php`)
- RPM reports → Machine report export: downloads report (evidence: `app/Http/Controllers/RpmController.php`)
- Sensor management → Sensors and thresholds: manages sensors (evidence: `README.md`)
- Registration → User accounts: creates account (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- Authentication routes → Registration: routes registration (evidence: `routes/auth.php`)
