How akshara-gupta23bce1325/drowsense-edge-fog-fatigue-detection works
DrowSense monitors driver drowsiness using edge camera and wearable-style vital data, computes fatigue and stages it in the fog service, then persists metrics and serves live and historical dashboard views. The dashboard also presents alert/category summaries and offers Spotify wake-up controls. Evidence is limited to the supplied excerpts and SOURCE INDEX; integrations and routes not explicitly wired there are omitted.
Main entry points: App.tsx Dashboard App · fog_server.py Fog API · main_edge.py Edge Orchestrator · camera_module.py Camera Analysis
Components 20
Edge Sensing
- Edge Orchestrator
edge/main_edge.py - Camera Analysis
edge/camera_module.py - Vital Simulator
edge/heart_rate_simulator.py - Edge WebSocket
edge/edge_ws.py
Fatigue Analysis
- Drowsiness Logic
utils/drowsiness_logic.py
Fog Services
- Fog API
fog/fog_server.py - PostgreSQL Data
databases/db_manager.py - Wake-up Playback
spotify/spotify_wakeup.py
Driver Dashboard
- Dashboard App
dashboard/src/App.tsx - Live Metrics
dashboard/src/components/RealTimeMetrics.tsx - Fatigue History
dashboard/src/components/FatigueChart.tsx - Category Summary
dashboard/src/components/CategoryDistribution.tsx - Alert Log
dashboard/src/components/AlertLog.tsx - Spotify Controls
dashboard/src/components/SpotifyController.tsx - REST Client
dashboard/src/services/api.ts - WebSocket Client
dashboard/src/services/websocket.ts - Spotify Client
dashboard/src/services/spotify.ts - Dashboard Types
dashboard/src/types/index.ts
Other components
- Driver
- Dashboard User
Connections 22
- Driver → Camera Analysis: provides video
- Edge Orchestrator → Camera Analysis: reads frames
edge/main_edge.py - Edge Orchestrator → Vital Simulator: gets vitals
edge/main_edge.py - Camera Analysis → Drowsiness Logic: uses algorithms
edge/camera_module.py - Edge Orchestrator → Fog API: posts metrics
edge/main_edge.py - Fog API → Drowsiness Logic: calculates fatigue
fog/fog_server.py - Fog API → PostgreSQL Data: stores metrics
fog/fog_server.py - Fog API → PostgreSQL Data: reads history
fog/fog_server.py - Fog API → Wake-up Playback: triggers playback
fog/fog_server.py - Dashboard User → Dashboard App: views dashboard
- Dashboard App → REST Client: requests data
- Dashboard App → WebSocket Client: subscribes live
- Dashboard App → Live Metrics: renders
dashboard/src/App.tsx - Dashboard App → Fatigue History: renders
dashboard/src/App.tsx - Dashboard App → Category Summary: renders
dashboard/src/App.tsx - Dashboard App → Alert Log: renders
dashboard/src/App.tsx - Dashboard App → Spotify Controls: renders
dashboard/src/App.tsx - Dashboard App → Dashboard Types: uses data types
dashboard/src/App.tsx - Live Metrics → Dashboard Types: uses data types
dashboard/src/components/RealTimeMetrics.tsx - Fatigue History → Dashboard Types: uses data types
dashboard/src/components/FatigueChart.tsx - Dashboard User → Spotify Controls: controls playback
- Spotify Controls → Spotify Client: invokes controls