How workvaralakshmi-sketch/helmet-app works
SmartHelmet is a browser-based rider safety dashboard backed by simulated helmet and vehicle sensors. Its core loop initializes the simulation, processes each sampled state for risk, impact, anomalies and fatigue, then updates dashboard visualizations and voice alerts. The app also presents GPS route/geofence information and emergency status. The excerpts establish these runtime links; index.html and unsampled app.js sections may wire additional controls or features, so those relationships are not inferred.
Main entry points: app.js Dashboard controller · ai.js Safety analytics · voice.js Voice alerts · sensors.js Sensor simulation
Components 17
Runtime and UI
- Dashboard controller
app.js - Sensor simulation
sensors.js - Sensor state
sensors.js
Safety analysis
- Safety analytics
ai.js - Risk scoring
ai.js - Impact detection
ai.js - Fatigue detection
ai.js - Safety events
ai.js
Rider feedback
- Live charts
charts.js - GPS map and geofence
map.js - Voice alerts
voice.js - Emergency overlay
app.js
Other components
- Rider
- Browser client
- Static file server
server.js - Web Speech API
- OpenStreetMap tiles
Connections 20
- Rider → Browser client: opens dashboard
- Browser client → Static file server: requests assets
server.js - Static file server → Browser client: serves files
server.js - Dashboard controller → Sensor simulation: initializes
app.js - Dashboard controller → Live charts: initializes
app.js - Dashboard controller → Voice alerts: initializes
app.js - Sensor simulation → Sensor state: updates
sensors.js - Dashboard controller → Sensor state: reads
app.js - Dashboard controller → Safety analytics: processes state
app.js - Safety analytics → Risk scoring: computes
ai.js - Safety analytics → Impact detection: classifies
ai.js - Safety analytics → Fatigue detection: detects
ai.js - Safety analytics → Safety events: records
ai.js - Safety analytics → Emergency overlay: triggers
ai.js - Dashboard controller → Live charts: updates
app.js - Dashboard controller → GPS map and geofence: updates GPS
- Dashboard controller → Voice alerts: checks alerts
- Voice alerts → Web Speech API: speaks
voice.js - GPS map and geofence → OpenStreetMap tiles: loads map tiles
map.js - Emergency overlay → Voice alerts: speaks alert
app.js