How jeyms-what/smart-aquarium-iot works
Smart Aquarium IoT is an in-development aquarium monitoring and equipment-control system spanning a Flutter app, Node.js API, MQTT, PostgreSQL, and ESP32 firmware. The current implemented workflow exposes latest telemetry to the app, which also maintains local telemetry history; the backend ingests device messages and publishes commands, but publication does not establish physical execution. The README documents the broader intended device-to-app path, while sampled firmware is only a safe bootstrap. Unsampled mobile feature wiring and hardware integrations are not inferred.
Main entry points: server.js REST API · mqtt.js MQTT ingestion and commands · mosquitto.conf MQTT broker · config.js Backend configuration
Components 20
Mobile application
- Flutter app
mobile/lib/app.dart - Dashboard
mobile/lib/features/dashboard/dashboard_screen.dart - Equipment control
mobile/lib/features/control/control_screen.dart - Telemetry history
mobile/lib/features/history/history_screen.dart - Settings
mobile/lib/features/settings/settings_screen.dart - Monitoring controller
mobile/lib/features/monitoring/monitoring_controller.dart - Aquarium repository
mobile/lib/data/repositories/aquarium_repository.dart - Telemetry API client
mobile/lib/data/remote/telemetry_api_client.dart - Local telemetry store
mobile/lib/data/local/telemetry_store.dart - Telemetry model
mobile/lib/data/models/telemetry_reading.dart
Backend services
- REST API
backend/src/server.js - Bearer authentication
backend/src/auth.js - Message validation
backend/src/validation.js - MQTT ingestion and commands
backend/src/mqtt.js - Backend configuration
backend/src/config.js
Device firmware
- ESP32 bootstrap
firmware/main/main.c
Messaging and storage
- MQTT broker
infra/mosquitto/mosquitto.conf - PostgreSQL
backend/migrations/001_init.sql
Other components
- Aquarium user
- Aquarium sensors
Connections 16
- Aquarium user → Flutter app: uses
README.md - Aquarium repository → Telemetry API client: requests telemetry
- Telemetry API client → REST API: fetches latest
README.md - Telemetry history → Local telemetry store: reads history
README.md - REST API → Bearer authentication: authenticates
backend/src/server.js - REST API → Message validation: validates requests
backend/src/server.js - REST API → MQTT ingestion and commands: publishes commands
backend/src/server.js - REST API → PostgreSQL: queries and records
backend/src/server.js - MQTT ingestion and commands → Message validation: validates messages
backend/src/mqtt.js - MQTT ingestion and commands → PostgreSQL: stores events and readings
backend/src/mqtt.js - MQTT ingestion and commands → MQTT broker: subscribes and publishes
README.md - Aquarium sensors → ESP32 bootstrap: provide readings
README.md - ESP32 bootstrap → MQTT broker: sends device messages
README.md - MQTT broker → MQTT ingestion and commands: forwards messages
README.md - Backend configuration → REST API: configures service
backend/src/server.js - Backend configuration → MQTT ingestion and commands: configures connection
backend/src/mqtt.js