How ashishkaus04/smart-home-automation works
This repository is a smart-home system with a Flutter mobile app, MQTT-connected home devices, and optional web and Node.js interfaces. The main documented workflow is users monitoring and controlling home functions in the app, with MQTT carrying sensor updates and control messages between the app, broker, and devices. The optional backend adds HTTP and WebSocket interfaces and a mock energy-prediction endpoint. The tree omits the app’s Dart sources and firmware, so app internals and device-level wiring are represented only where documented; the simulator’s HTTP target is not shown as connected to an implemented route.
Main entry points: server.js API server · smart_home_app Home screens · hardware Home devices · App.js Web dashboard
Components 17
Mobile app
- Flutter app
mobile_app_flutter/smart_home_app - Home screens
mobile_app_flutter/smart_home_app
Home automation
- MQTT broker
- Home devices
hardware - Sensor readings
hardware/raspberry_pi/sensor_reader.py - Device control
hardware - Security system
hardware - Automation rules
mobile_app_flutter/smart_home_app
Optional backend
- API server
backend/server.js - Device routes
backend/routes/devices.js - Device model
backend/models/Device.js - Device state
backend/server.js - Web dashboard
frontend/src/App.js
Energy intelligence
- Energy views
mobile_app_flutter/smart_home_app - LSTM training
backend/ml/train_model.py - Prediction endpoint
backend/server.js
Other components
- Resident
Connections 20
- Resident → Flutter app: uses
- Flutter app → Home screens: navigates
- Home screens → MQTT broker: publishes and subscribes
- MQTT broker → Home devices: routes messages
- Home devices → MQTT broker: sends readings
- Home devices → Sensor readings: collects data
- MQTT broker → Device control: delivers commands
- Home screens → Security system: monitors and controls
- Home screens → Automation rules: configures rules
- API server → MQTT broker: subscribes and publishes
- MQTT broker → API server: delivers messages
- API server → Device state: updates
- API server → Device routes: routes API requests
- API server → Device model
- API server → Web dashboard: streams device updates
- Web dashboard → API server: uses API and sockets
- Flutter app → Energy views: shows
- LSTM training → Prediction endpoint
- API server → Prediction endpoint: serves mock predictions
- Prediction endpoint → Web dashboard: returns prediction data