How iot-team-ute-n2/iot-project works
This is a multi-pump agricultural IoT monitoring and control system. A user signs in, views a fleet overview, selects a pump, and monitors its live readings and history; they can also configure watering thresholds and control pumps. Device telemetry travels through MQTT and Node-RED into InfluxDB, while the web app also receives live MQTT updates and uses the API to seed readings and retrieve history. The map follows README-described infrastructure and sampled frontend/API code; Node-RED flow details and pump-command wiring were not sampled, so those links are limited to documented behavior.
Main entry points: app.js API application · config Mosquitto MQTT · useFleetHistoryStore.js History store · apiClient.js API client
Components 22
Web dashboard
- React app
fontend_mul/src/App.jsx - Sign-in UI
fontend_mul/src/components/AuthPage.jsx - Auth provider
fontend_mul/src/components/AuthProvider.jsx - Fleet overview
fontend_mul/src/components/DeviceOverview.jsx - Pump dashboard
fontend_mul/src/components/Dashboard.jsx - History store
fontend_mul/src/hooks/useFleetHistoryStore.js - Live telemetry client
fontend_mul/src/hooks/useFleetTelemetry.js - Pump controls
fontend_mul/src/components/PumpControlPanel.jsx - Threshold form
fontend_mul/src/components/ThresholdConfigForm.jsx - API client
fontend_mul/src/lib/apiClient.js
REST API
- API application
backend/api/src/app.js - Auth routes
backend/api/src/routes/auth.js - Device routes
backend/api/src/routes/devices.js - Config routes
backend/api/src/routes/config.js - Telemetry routes
backend/api/src/routes/telemetry.js
Telemetry pipeline
- ESP32 simulator
fontend_mul/esp32-simulator.cjs - Mosquitto MQTT
backend/mosquitto/config - Node-RED flow
backend/node-red/data - InfluxDB
backend/influxdb
Accounts and state
- Device configuration
backend/api/src/store.js - MySQL accounts
backend/mysql/init
Other components
- User
Connections 32
- User → Sign-in UI: signs in
- Sign-in UI → Auth provider: submits credentials
- Auth provider → API client: calls auth API
- API client → API application: REST requests
- API application → Auth routes: dispatches auth
- Auth routes → MySQL accounts: reads/writes users
- Auth routes → Auth provider: returns session result
- Auth provider → React app: provides session
- React app → Fleet overview: shows fleet
- React app → History store: starts fleet tracking
- React app → Pump dashboard: opens selected pump
- History store → Live telemetry client: subscribes
- Live telemetry client → Mosquitto MQTT: receives live data
- Mosquitto MQTT → ESP32 simulator: accepts telemetry
- Mosquitto MQTT → Live telemetry client: publishes readings
- History store → API client: seeds latest readings
- API client → API application: requests readings
- API application → Telemetry routes: dispatches telemetry
- Telemetry routes → InfluxDB: queries measurements
- History store → Pump dashboard: supplies history
- History store → User: persists rollups locally
- ESP32 simulator → Mosquitto MQTT: publishes telemetry
- Mosquitto MQTT → Node-RED flow: forwards telemetry
- Node-RED flow → InfluxDB: writes measurements
- User → Pump controls: requests pump action
- Pump controls → Mosquitto MQTT: sends pump command
- User → Threshold form: sets thresholds
- Threshold form → API client: submits config
- API application → Config routes: dispatches config
- Config routes → Device configuration: reads/writes config
- API application → Device routes: dispatches devices
- Device routes → Device configuration: reads device list