How ryle-kun/project-water-filter-system-v2 works
This is an IoT water-monitoring and distribution-control system: controller readings enter the backend, are persisted and exposed through APIs, and operators use a web dashboard to inspect status, alerts, history, schedules, and valves. The README documents serial hardware communication and real-time WebSocket updates, but cautions that physical integration is not yet verified. Some backend services and frontend components are represented by their source paths; relationships are included only where excerpts, the source index, or README support them.
Main entry points: main.py FastAPI routes · Dashboard.jsx Dashboard · models.py Water data models · serial_bridge.py Serial bridge
Components 23
Web dashboard
- App session gate
frontend/src/App.jsx - Sign in
frontend/src/pages/LoginPage.jsx - Dashboard
frontend/src/pages/Dashboard.jsx - API client
frontend/src/api.js - Tank cards
frontend/src/components/WebTankCard.jsx - Valve controls
frontend/src/components/WebValveButton.jsx - Alert badge
frontend/src/components/WebAlertBadge.jsx - History chart
frontend/src/components/WebMiniChart.jsx - Schedule rows
frontend/src/components/WebScheduleRow.jsx
Backend API
- FastAPI routes
backend/main.py - Serial bridge
backend/serial_bridge.py - WebSocket manager
backend/websocket_manager.py - Database setup
backend/database.py - API schemas
backend/schemas.py
Water services
- Sensor history
backend/services/sensor_service.py - Schedule management
backend/services/schedule_service.py - Authentication
backend/services/auth_service.py - Alert handling
backend/services/alert_service.py - Valve commands
backend/services/valve_service.py - Water data models
backend/models.py
Controller link
- Arduino controller
arduino/water_systems.ino
Other components
- Operator
- MySQL database
Connections 30
- Operator → App session gate: opens
README.md - App session gate → Sign in: shows unauthenticated
frontend/src/App.jsx - App session gate → Dashboard: shows authenticated
frontend/src/App.jsx - Sign in → FastAPI routes: posts credentials
frontend/src/pages/LoginPage.jsx - Dashboard → API client: requests data
frontend/src/pages/Dashboard.jsx - Dashboard → Tank cards: renders
frontend/src/pages/Dashboard.jsx - Dashboard → Valve controls: renders
frontend/src/pages/Dashboard.jsx - Dashboard → Alert badge: renders
frontend/src/pages/Dashboard.jsx - Dashboard → History chart: renders
frontend/src/pages/Dashboard.jsx - Dashboard → Schedule rows: renders
frontend/src/pages/Dashboard.jsx - API client → FastAPI routes: calls HTTP API
README.md - FastAPI routes → Authentication: authenticates
backend/main.py - FastAPI routes → Sensor history: reads and saves
backend/main.py - FastAPI routes → Schedule management: manages schedules
backend/main.py - FastAPI routes → Alert handling: loads active alerts
backend/main.py - FastAPI routes → Valve commands: loads valve states
backend/main.py - FastAPI routes → WebSocket manager: broadcasts updates
backend/main.py - FastAPI routes → Serial bridge: routes device data
backend/main.py - FastAPI routes → API schemas: validates payloads
backend/main.py - Database setup → MySQL database: initializes tables
backend/database.py - Database setup → Water data models: creates model tables
backend/database.py - Sensor history → Water data models: persists readings
backend/services/sensor_service.py - Schedule management → Water data models: stores schedules
backend/services/schedule_service.py - Authentication → Water data models: looks up users
- Valve commands → Water data models: stores commands
- Serial bridge → FastAPI routes: forwards readings
README.md - Arduino controller → Serial bridge: sends readings
README.md - Serial bridge → Arduino controller: queues commands
README.md - FastAPI routes → WebSocket manager: serves live updates
README.md - Dashboard → WebSocket manager: receives live updates
README.md