How aries1945/tugasakhir-new works
ThermoStream is a web application for monitoring temperature sensors: users view live readings and historical detail, and can configure an MQTT broker and manage a topic subscription. The dashboard polls the temperature API; the history view requests sensor details and displays recent readings. The tree also shows Spring controllers, services, repositories, MQTT clients and sensor models, but their implementation excerpts are absent, so backend and broker links below are marked unverified. The separate backup directory is not treated as the active runtime.
Main entry points: SensorDataService.java Sensor data service · mqttController.java MQTT controls API · dashboard.js Live dashboard · history.js Sensor history
Components 19
Web interface
- Live dashboard
src/main/resources/static/js/dashboard.js - Sensor history
src/main/resources/static/js/history.js - Broker settings
src/main/resources/static/js/settings.js - Topic controls
src/main/resources/static/js/subscribe.js
Application API
- Temperature API
src/main/java/com/example/TugasAkhir/controller/SuhuController.java - Sensor data API
src/main/java/com/example/TugasAkhir/controller/SensorDataRestController.java - MQTT controls API
src/main/java/com/example/TugasAkhir/controller/mqttController.java - Dashboard API
src/main/java/com/example/TugasAkhir/controller/DashboardController.java
Sensor data
- Sensor data service
src/main/java/com/example/TugasAkhir/service/SensorDataService.java - Sensor records
src/main/java/com/example/TugasAkhir/model/SensorData.java - Sensor registry
src/main/java/com/example/TugasAkhir/model/Sensor.java - Reading repository
src/main/java/com/example/TugasAkhir/repository/SensorDataRepository.java - Sensor repository
src/main/java/com/example/TugasAkhir/repository/SensorRepository.java - PostgreSQL
src/main/resources/application.properties
MQTT integration
- MQTT client manager
src/main/java/com/example/TugasAkhir/mqtt/MqttClientManager.java - Message callback
src/main/java/com/example/TugasAkhir/mqtt/MqttCallbackHandler.java
Other components
- Operator
- Sensor publisher
- MQTT broker
Connections 19
- Operator → Live dashboard: views
src/main/resources/static/js/dashboard.js - Live dashboard → Temperature API: polls
src/main/resources/static/js/dashboard.js - Operator → Sensor history: opens
- Sensor history → Sensor data API: requests detail
src/main/resources/static/js/history.js - Operator → Broker settings: configures
- Broker settings → MQTT controls API: connects
src/main/resources/static/js/settings.js - Operator → Topic controls: manages topic
- Topic controls → MQTT controls API: subscribes
src/main/resources/static/js/subscribe.js - MQTT controls API → MQTT client manager: delegates
- MQTT client manager → MQTT broker: connects
- Sensor publisher → MQTT broker: publishes readings
- Message callback → Sensor data service: forwards readings
- Temperature API → Sensor data service: requests readings
- Sensor data API → Sensor data service: requests history
- Dashboard API → Sensor data service: requests summary
- Sensor data service → Reading repository: queries
- Sensor data service → Sensor repository: queries
- Reading repository → PostgreSQL: reads and writes
- Sensor repository → PostgreSQL: reads and writes