How rachorachelirene-beep/aquaguard works
AquaGuard combines role-based flood operations in a React portal with a local camera agent. The user workflow runs from role-scoped access to monitoring and community/response actions; the agent supplies camera telemetry, water-level estimates, and risk indicators, while cloud services provide persistent data and weather. The tree and README establish major capabilities, but many frontend pages and the agent entry point were not excerpted, so their internal call links are omitted or shown only where documentation supports them.
Main entry points: stream_api.py Stream and telemetry API · App.jsx Role-based routing · admin Admin workspace · DashboardLayout.jsx Dashboard shell
Components 23
Web portal
- Authentication and roles
src/context/AuthContext.jsx - Role-based routing
src/App.jsx - Dashboard shell
src/components/layouts/DashboardLayout.jsx - Alert audio and banners
src/context/AlertAudioContext.jsx - Realtime detection client
src/hooks/useRealtimeDetection.js - Camera agent client
src/lib/cameraAgent.js - Browser Supabase client
src/lib/supabase.js
Flood operations
- Admin workspace
src/pages/admin - Officer workspace
src/pages/officer - Responder workspace
src/pages/responder - Resident workspace
src/pages/resident
Camera agent
- Agent runtime
detector/run_camera_agent.py - Stream and telemetry API
detector/stream_api.py - YOLO flood detection
detector/stream_api.py - Virtual gauge estimation
detector/gauge.py - Flood risk rules
detector/flood_risk.py - Camera configuration
detector/camera_config.py - Agent authorization
detector/admin_auth.py - Weather synchronization
detector/weather_service.py
Cloud services
- Supabase data, auth, realtime
- Open-Meteo
Other components
- Portal user
- USB / RTSP cameras
Connections 34
- Portal user → Role-based routing: opens portal
README.md - Role-based routing → Authentication and roles: checks session
src/App.jsx - Role-based routing → Admin workspace: routes admin
src/App.jsx - Role-based routing → Officer workspace: routes officer
src/App.jsx - Role-based routing → Responder workspace: routes responder
src/App.jsx - Role-based routing → Resident workspace: routes resident
src/App.jsx - Admin workspace → Dashboard shell: renders layout
src/pages/admin/CameraSettings.jsx - Officer workspace → Dashboard shell: renders layout
src/pages/officer/OfficerDashboard.jsx - Responder workspace → Dashboard shell: renders layout
src/pages/responder/ResponderDashboard.jsx - Resident workspace → Dashboard shell: renders layout
src/pages/resident/ResidentDashboard.jsx - Dashboard shell → Alert audio and banners: reads alert state
src/components/layouts/DashboardLayout.jsx - Alert audio and banners → Supabase data, auth, realtime: subscribes to alerts
src/context/AlertAudioContext.jsx - Admin workspace → Supabase data, auth, realtime: manages system data
- Officer workspace → Supabase data, auth, realtime: coordinates operations
- Responder workspace → Supabase data, auth, realtime: records response
- Resident workspace → Supabase data, auth, realtime: reads public information
- Browser Supabase client → Supabase data, auth, realtime: connects
src/lib/supabase.js - Admin workspace → Camera agent client: configures agent
src/pages/admin/CameraSettings.jsx - Camera agent client → Agent runtime: targets local agent
README.md - Agent runtime → Stream and telemetry API: starts API
- USB / RTSP cameras → Agent runtime: provides video
README.md - Stream and telemetry API → YOLO flood detection: processes frames
README.md - Stream and telemetry API → Virtual gauge estimation: estimates level
detector/stream_api.py - Stream and telemetry API → Flood risk rules: calculates indicators
detector/stream_api.py - Stream and telemetry API → Camera configuration: loads camera settings
detector/stream_api.py - Stream and telemetry API → Agent authorization: checks admin access
detector/stream_api.py - Stream and telemetry API → Weather synchronization: starts weather worker
detector/stream_api.py - Weather synchronization → Open-Meteo: fetches conditions
detector/weather_service.py - Weather synchronization → Supabase data, auth, realtime: stores telemetry
detector/weather_service.py - Stream and telemetry API → Supabase data, auth, realtime: syncs detections
- Admin workspace → Realtime detection client: monitors detection
src/pages/admin/LiveMonitoring.jsx - Resident workspace → Realtime detection client: reads live detection
src/pages/resident/ResidentDashboard.jsx - Realtime detection client → Camera agent client: connects to agent
- Responder workspace → Camera agent client: requests risk data
src/pages/responder/ResponderDashboard.jsx