How sakshichak/smart-sensor-dashboard works
The product is a real-time temperature and humidity dashboard. Its principal workflow simulates readings, publishes them over MQTT, ingests them in the backend, and broadcasts them over Socket.IO for display in the React UI. The backend also persists readings through the SensorReading model. The graph preserves the simulator, broker, storage, gateway, and dashboard stages. Relationships are based on the excerpts or README; no historical-query or alert workflow is implemented in the shown product.
Main entry points: mqttService.js MQTT ingestion · server.js Backend server · websocket.js Socket.IO gateway · App.jsx Sensor dashboard
Components 11
Sensor simulation
- Sensor publisher
sensor-simulator/publisher.js
Backend ingestion
- Backend server
backend/server.js - Backend config
backend/config.js - MQTT ingestion
backend/mqttService.js - Reading model
backend/models/SensorReading.js
Realtime dashboard
- Socket.IO gateway
backend/websocket.js - React bootstrap
frontend/src/main.jsx - Sensor dashboard
frontend/src/App.jsx
Other components
- MQTT broker
- MongoDB
- Dashboard user
Connections 15
- Sensor publisher → MQTT broker: publishes readings
sensor-simulator/publisher.js - MQTT broker → MQTT ingestion: delivers MQTT messages
README.md - Backend server → Backend config: loads settings
backend/server.js - Backend server → MQTT ingestion: starts service
backend/server.js - Backend server → Socket.IO gateway: initializes gateway
backend/server.js - Backend server → MongoDB: connects
backend/server.js - MQTT ingestion → Backend config: reads broker settings
backend/mqttService.js - MQTT ingestion → MQTT broker: subscribes to topic
backend/mqttService.js - MQTT ingestion → Reading model: creates readings
backend/mqttService.js - Reading model → MongoDB: stores documents
backend/models/SensorReading.js - MQTT ingestion → Socket.IO gateway: emits readings
backend/mqttService.js - Sensor dashboard → Socket.IO gateway: connects and listens
frontend/src/App.jsx - Socket.IO gateway → Sensor dashboard: broadcasts sensor data
README.md - React bootstrap → Sensor dashboard: renders
frontend/src/main.jsx - Dashboard user → Sensor dashboard: views readings
README.md