🚗 DrivePulse
01 Architecture Diagram
-End-to-end data flow: sensors → on-device processing → server → driver insights → feedback loop.
+End-to-end data flow: sensors → edge processing → server API → AI Copilot → driver insights.
Right-click → "Save image as" or screenshot this diagram to export as PNG.
@@ -232,121 +237,99 @@01 Architecture Diagram
02 Architecture Explanation
-Design decisions and engineering trade-offs.
+02 Architecture & Engineering Design
+Design decisions and system infrastructure.
-Real-Time vs. Post-Trip Processing
+Responsive UI & Glassmorphism Design
-
-
- Stress detection → real-time, on-device. RF classifier runs per 30s window in <1ms. Driver gets alerts instantly, no network needed. -
- Earnings prediction → on-device per trip. Velocity forecasting runs locally after each trip completes. -
- Aggregation → server-side. Dashboard summaries, trends, and goal tracking are computed on the server where full trip history is available. -
- Why this split? A driver in danger can't wait for a network round-trip. Safety alerts must work in tunnels and dead zones. +
- Premium Aesthetics: Built entirely with a deeply dark, frosted glassmorphism interface heavily reliant on
backdrop-blur-xlutilities.
+ - Performant Renderings: Built using Vite and React 18 for massive speed gains during compilation. State management handled cleanly to avoid chart re-renders. +
- Accessible UI: High-contrast tokens created in CSS ensure data visualisations are distinct for night-driving without causing fatigue.
Connectivity & Resilience
+Real-Time vs. Post-Trip Processing
-
-
- Both ML models run locally — no network required for predictions. -
- Queued sync — trip data and feedback stored locally, synced when connectivity returns. -
- Rule-based fallback — if model files are missing, threshold rules (motion >3.5g + audio >80 dB → CONFLICT) keep the app functional. -
- SPA frontend — once loaded, all navigation works offline; only API data calls need network. +
- Stress detection → real-time edge processing. Random Forest classifier runs per 30s window in <1ms. Driver gets alerts directly without needing continuous API polling. +
- Aggregation → Backend server. Detailed map popups, AI XAI outputs (explainable AI summaries), and history metrics load off device. +
- Why this split? A driver in a dangerous zone cannot rely on cellular reliability. Safety telemetry logic processes locally, while reporting requires sync.
Battery & Resource Management
+AI Co-Pilot & XAI Feedback
-
-
- Lightweight RF models — no GPU, <1ms inference, ~12 stress features (not hundreds). -
- 10 Hz sampling — sufficient for brakes/road events; 10× less data than high-frequency approaches. -
- 30s windows — model runs ~2×/min, not continuously. -
- dB envelope only — loudness levels, not raw audio waveforms. No FFT/spectrogram cost. -
- EMA drift correction — simple update every 10 min, not a full recalibration. +
- Explainable AI integrations — The backend automatically generates XAI "Top Features" for every identified event using feature importance arrays. +
- Integrated LLM — A Gemini-backed AI Safety Assistant takes event parameters and constructs human-readable, educational summaries of the incidents instantly. +
- Data Minimisation: The LLM handles only parsed data parameters (speeds, forces, time). Audio or geo-exact details are stripped pre-prompting for absolute privacy.
Privacy & Data Minimisation
+Battery & Resource Management
-
-
- No raw audio — mic input reduced to dB aggregates on-device. No recordings leave the phone. -
- No raw sensor logs — accelerometer data consumed in 30s windows, converted to statistical features, then discarded. -
- All audio classification on-device — server never receives audio data. -
- Minimal PII — username + city + experience level. No phone number, no payment data. -
- Feedback is opt-in — only event ID + boolean. No free-text harvested. +
- Lightweight RF models — no GPU required, minimal RAM footprint, ~12 extracted hardware features instead of deep learning arrays. +
- 30s sliding windows — Telemetry model only recalculates locally a few times a minute, minimizing continuous drain. +
- dB envelope only — For privacy and size, mic data is reduced to local Db scales. Driver voice clips are definitively never transmitted.
Key Trade-offs
| Decision | Gained | Gave Up |
|---|---|---|
| On-device inference | Zero-latency alerts, offline support | Can't use large models or cross-driver patterns |
| RandomForest over DL | Lightweight, interpretable, CPU-only | Lower accuracy on complex temporal patterns |
| dB envelope over raw audio | Privacy, low CPU, no storage | No speech-to-text or fine-grained analysis |
| In-memory store over DB | Zero setup for judges | No persistence across restarts |
| Feedback collected, not looped | Simpler system | Model doesn't self-improve (yet) |
| On-device inference | Zero-latency alerts, offline support | Can't use massive parameters or cross-fleet correlations instantaneously |
| RandomForest over DL | Lightweight, interpretable, CPU-only | Lower accuracy on complex multi-temporal event chains |
| dB envelope over raw audio | Privacy, low CPU, zero cloud bandwidth | No immediate natural language incident classification from audio |
| In-memory store (MVP) | Zero setup friction for deployments | No multi-node or persistent stability without Postgres update |
03 Deployment & Docker
-How a judge runs the full system in minutes.
+03 Deployment Architecture
+How to deploy or test the architecture.
docker-compose.yml
- so a judge can run the entire stack with a single command. DrivePulse ships two services
- (FastAPI backend + React frontend) wired together behind Nginx.
+ Infrastructure Note: DriverIntel consists of two split services: FastAPI Python Backend + Node/React Vite Frontend. They communicate natively over REST endpoints.
Containers
-
-
- Backend container: Python 3.11 + FastAPI. Runs
uvicorn main:appinside thebackend/folder so imports likefrom utils...andfrom data...match local dev. Exposes8000with all/api/*routes.
- - Frontend container: Builds the React SPA with Node + Vite, then serves the static
dist/bundle via Nginx on port80. Nginx proxies any request to/api/to the backend service.
- - Compose orchestration:
docker-compose.ymlin the repo root builds both images, creates a shared network, and publishes: --
-
http://localhost:5173→ frontend (Nginx)
- http://localhost:8000→ backend (FastAPI, e.g./api/health)
-
+ - Backend container: Python 3.11 + FastAPI. Runs
uvicorn main:appinside thebackend/folder to execute our ML + REST models. Exposes port8000.
+ - Frontend container: Builds the React SPA with Node + Vite, compiles Tailwind definitions, and serves the static
dist/bundle via a lightweight internal proxy router.
+ - Single Orchestration: Complete configuration exists in
docker-compose.yml. Runningdocker compose up --buildconstructs the necessary network bridges locally for the frontend to hit/apiproperly.
Judge Runbook
+Testing Runbook
-
-
- Prerequisite: Install Docker Desktop and ensure it is running. -
- Clone repo:
git clone ... && cd Driver-Pulse
- - One command:
-
docker compose up --buildfrom the repo root (Driver-Pulse/).
- - Open app: visit
http://localhost:5173in the browser - (no manual dependency installation required).
+ - Prerequisite: Start Docker Desktop. +
- Launch locally:
git clone ... && cd Driver-Pulse(or your repository folder).
+ - Spin up execution:
docker compose up --build.
+ - Validate app: Open
http://localhost:5173in the browser to interact via demo telemetry accounts.
- Username:
judge@uber.com · Password: hackathon2026.
+ Demo Credentials: We provide structured demo telemetry data via sample accounts.+ Username:
demo@driveintel.com · Password: demo2026.
04 Risk Maps (Frontend)
-Spatial view of per-trip stress events and a separate demo for “area risk” storytelling.
+04 Risk Maps & Visualisations
+Visual layout functionality of complex geo-spatial components.
-TripMap — segment colouring
+Dynamic Trip Map Segmenting
-
-
- Inputs:
route(lat/lng polyline),events(withoffset_secandseverity),durationSec,cursorIndexfor playback.
- - Event time → index along the route; segment boundaries merge duplicate indices and pick the stronger severity. Calm segments render with reduced opacity; event-ending segments use green / amber / red. -
- Markers at
ev.locationwith popups (escaped HTML) for label, severity, confidence %, andexplain.summarywhen available.
+ - The core
TripMap.jsxcomponent takes real coordinate polyline segments and calculates spatial risk.
+ - Coloring Logic: Calm baseline data outputs partially transparent routes. If an event timestamp triggers near a location chunk, the segment opacity scales up and colors (Amber/Green/Red) directly depending on event severity. +
- Rich Modals: Clicking event pins queries the React context layout for AI Assistant XAI explanations and model parameters without page routing.
RiskZonesPreviewMap — Predict page
+Risk Zones Prediction Map
-
-
- Standalone Leaflet map with fixed demo circles (Bangalore). Popups state clearly that overlays are illustrative. -
- No backend dependency; complements the stress prediction form as a UX prototype for future real-world risk layers. +
- Standalone Leaflet engine using mock overlay heat-circles to present future-state infrastructure of geographical "hazard clusters" identified by the application.
Hosted SPA note
-
- For a frontend on Vercel (or similar) talking to a separate API host, the client uses VITE_API_BASE (full API prefix including /api) at build time; Docker and local dev keep the default relative /api behind Nginx or the Vite proxy.
-