How ryle-kun/water-system-connected works
Barangay Water System is an offline-capable IoT monitoring and control app for a three-tank water system, with optional cloud access. The main workflow runs from Arduino sensor readings through the serial bridge and FastAPI API into stored readings and dashboard updates; users can also authenticate, review alerts and schedules, and issue valve commands. The graph preserves those documented capabilities, but several service implementations and the serial/WebSocket internals were not sampled, so uncertain links are left dashed or omitted.
Main entry points: main.py FastAPI API · models.py Domain Models · Dashboard.jsx Web Dashboard · App.jsx Web App Shell
Components 20
Sensor Ingestion
- Serial Bridge
backend/serial_bridge.py
API and Services
- FastAPI API
backend/main.py - Authentication
backend/services/auth_service.py - Sensor Service
backend/services/sensor_service.py - Valve Service
backend/services/valve_service.py - Alert Service
backend/services/alert_service.py - Schedule Service
backend/services/schedule_service.py - API Schemas
backend/schemas.py
Data and Realtime
- Database Session
backend/database.py - Domain Models
backend/models.py - WebSocket Manager
backend/websocket_manager.py
User Interfaces
- Web Dashboard
frontend/src/pages/Dashboard.jsx - Web App Shell
frontend/src/App.jsx - WebSocket Hook
frontend/src/hooks/useWebSocket.js - Mobile Dashboard
frontend-mobile/src/screens/DashboardScreen.js - Mobile App Shell
frontend-mobile/App.js - Web Login
frontend/src/pages/LoginPage.jsx
Other components
- Arduino
- Operator or Official
- Cloud VPS
Connections 24
- Arduino → Serial Bridge: sends readings
README.md - Serial Bridge → FastAPI API: posts readings
backend/main.py - Operator or Official → Web App Shell: uses
README.md - Web App Shell → Web Dashboard: renders
frontend/src/App.jsx - Web App Shell → Web Login: renders
frontend/src/App.jsx - Operator or Official → Mobile App Shell: uses
- Mobile App Shell → Mobile Dashboard: renders
frontend-mobile/App.js - FastAPI API → Sensor Service: delegates to
backend/main.py - FastAPI API → Schedule Service: delegates to
backend/main.py - FastAPI API → Database Session: opens sessions
backend/main.py - FastAPI API → API Schemas: validates with
backend/main.py - FastAPI API → Authentication: authenticates via
- FastAPI API → Valve Service: dispatches commands
- FastAPI API → Alert Service: serves alerts
- Sensor Service → Domain Models: reads and writes
backend/services/sensor_service.py - Schedule Service → Domain Models: reads and writes
backend/services/schedule_service.py - Valve Service → Domain Models: records commands
- Alert Service → Domain Models: reads alerts
- FastAPI API → WebSocket Manager: broadcasts updates
backend/main.py - Web Dashboard → WebSocket Hook: uses updates
- WebSocket Hook → WebSocket Manager: connects to
- Web Dashboard → FastAPI API: requests dashboard
- Mobile Dashboard → FastAPI API: requests data
- Cloud VPS → FastAPI API: remote access
README.md