๐ 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.
@@ -231,97 +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 & Visualisations
+Visual layout functionality of complex geo-spatial components.
+ +Dynamic Trip Map Segmenting
+-
+
- 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. +
Risk Zones Prediction Map
+-
+
- Standalone Leaflet engine using mock overlay heat-circles to present future-state infrastructure of geographical "hazard clusters" identified by the application. +