Enterprise AI-Powered Road Safety & Emergency Response Platform
Offline-first PWA Β· Zero-downtime AI Β· Zero infrastructure cost
Vision β’ Features β’ Tech Stack β’ Quick Start β’ Architecture β’ Full Documentation β
Built for the IIT Madras Road Safety Hackathon 2026. Offline-first PWA with zero-downtime AI fallback.
Every second counts in a road emergency. SafeVixAI puts life-saving information β nearest hospitals, traffic laws, first aid protocols β directly in the hands of citizens, officers, and first responders.
|
When rural or disaster-struck networks fail, SafeVixAI keeps working. DuckDB-Wasm + IndexedDB + Service Workers ensure full offline operation. |
A 10-provider LLM cascading chain with automatic fallback ensures the AI assistant never goes silent. |
100% open source. Infrastructure runs on free tiers (Vercel, Render, Supabase, Upstash). Accessible to every government agency. |
| Feature | Description | Enterprise Capabilities | |
|---|---|---|---|
| π¨ | Emergency Locator | Geospatial hospital, police, and fire station search | PostGIS spatial indexing, 50ms latency routing |
| π€ | AI Agentic Chatbot | Traffic law, challan calculation, and first aid guidance | Agentic RAG, 10-LLM fallback chain, ChromaDB vector store |
| π§Ύ | Challan Calculator | Deterministic MVA 2019 fine calculation with overrides | DuckDB-Wasm in-browser, zero-latency offline processing |
| πΈ | Road Reporter | Community-driven road damage reporting with geotagging | IndexedDB sync queue, background sync via Service Workers |
| π‘ | SOS + Live Tracking | Hold-to-activate emergency alert with live location | Secure WebSockets, encrypted payload streaming |
| π | Command Center | Real-time agency dashboard with incident timelines | Grafana integration, Prometheus metric scraping |
| π£οΈ | Indian Language AI | Hindi, Tamil, Telugu, Kannada + 10 Indian languages | Sarvam AI routing, IndicSeamless speech translation |
| π©Ί | First Aid Protocols | Step-by-step emergency medical guidance | Offline-available, category-filtered protocol cards |
SafeVixAI is built on a modern, cloud-native microservices architecture designed for extreme scale and fault tolerance.
| Layer | Technologies | Purpose |
|---|---|---|
| Frontend | Next.js 15 Β· React 19 Β· TypeScript 5 Β· Tailwind CSS 3 Β· MapLibre GL 5 | PWA with offline-first architecture |
| Offline Engine | WebLLM (Phi-3 Mini) Β· DuckDB-Wasm Β· IndexedDB Β· Service Workers | Zero-network AI + SQL + data persistence |
| Backend API | FastAPI Β· SQLAlchemy 2.0 Β· PostGIS Β· Redis 7 Β· DuckDB | Emergency locator, challan calc, road reporting |
| AI Service | FastAPI Β· ChromaDB Β· 10 LLM Providers Β· Sarvam AI Β· IndicSeamless | Agentic RAG chatbot with Indian language support |
| Infrastructure | Docker Compose Β· Kubernetes Β· Terraform (AWS) Β· Vercel Β· Render | Container orchestration and deployment |
| Observability | Prometheus Β· Grafana Β· Sentry Β· Structured JSON Logging | Metrics, alerts, error tracking, audit trails |
| CI/CD | GitHub Actions (34 workflows) Β· CodeQL Β· Dependabot Β· SLSA | Automated testing, security scanning, provenance |
SafeVixAI is containerized for rapid developer onboarding. Get a local instance running in minutes.
- Docker & Docker Compose (Recommended for full-stack)
- Node.js 20+ & Python 3.11+ (For bare-metal deployment)
Launch the entire stack β PostgreSQL, Redis, Backend, AI Service, Frontend β with a single command:
# Clone the repository
git clone https://github.com/SafeVixAI/SafeVixAI.git
cd SafeVixAI
# Boot the microservices
docker compose up --build -d| Service | URL | Health Check |
|---|---|---|
| Frontend | http://localhost:3000 |
PWA available |
| Backend API | http://localhost:8000 |
GET /health |
| Chatbot Service | http://localhost:8010 |
GET /health |
Click to expand step-by-step instructions
1. Backend API (Port 8000)
cd backend
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
uvicorn main:app --reload --port 80002. AI Chatbot Service (Port 8010)
cd chatbot_service
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
uvicorn main:app --reload --port 80103. Frontend PWA (Port 3000)
cd frontend
npm ci
cp .env.local.example .env.local
npm run devSafeVixAI uses a highly decoupled, cloud-native architecture. It strictly separates edge-client offline durability from heavy backend processing and AI orchestration, with a rigorous data plane optimized for spatial indexing and vector retrieval.
flowchart TB
classDef edge fill:#dbeafe,stroke:#3b82f6,stroke-width:2px,color:#1e3a5f
classDef control fill:#dcfce7,stroke:#22c55e,stroke-width:2px,color:#14532d
classDef ai fill:#f3e8ff,stroke:#a855f7,stroke-width:2px,color:#581c87
classDef data fill:#fef3c7,stroke:#f59e0b,stroke-width:2px,color:#78350f
classDef external fill:#f1f5f9,stroke:#94a3b8,stroke-width:2px,stroke-dasharray:5 5,color:#334155
subgraph EdgeTier ["Edge Tier β Offline-First PWA"]
direction LR
UI["React 19 / Next.js 15"]:::edge
SW["Service Worker"]:::edge
IDB[("IndexedDB")]:::edge
DW[("DuckDB-Wasm")]:::edge
UI <--> SW
UI <--> IDB
UI <--> DW
end
subgraph ControlPlane ["Control Plane β Backend :8000"]
direction TB
API["FastAPI Gateway"]:::control
Workers["Background Workers"]:::control
API <--> Workers
end
subgraph AIOrchestration ["AI Orchestration β Chatbot :8010"]
direction TB
Router["Agentic Router"]:::ai
LLM["10-Provider LLM Chain"]:::ai
Router --> LLM
end
subgraph DataPlane ["Data Plane"]
direction LR
PG[("PostgreSQL + PostGIS")]:::data
RD[("Redis 7")]:::data
CR[("ChromaDB")]:::data
end
subgraph ThirdParty ["External Integrations"]
direction LR
Maps["OpenStreetMap / Data.gov.in"]:::external
end
EdgeTier -- "HTTPS / WSS" --> ControlPlane
EdgeTier -- "Semantic Queries" --> AIOrchestration
ControlPlane --> PG
ControlPlane --> RD
ControlPlane -. "Geocoding" .-> Maps
AIOrchestration --> CR
AIOrchestration --> RD
sequenceDiagram
autonumber
participant U as User
participant PWA as Frontend PWA
participant GW as FastAPI Gateway
participant AI as AI Chatbot
participant DB as PostgreSQL + PostGIS
participant EXT as OpenStreetMap
U->>PWA: "Find nearest hospital"
alt Online Mode
PWA->>GW: POST /api/emergency/nearby
GW->>DB: ST_DWithin spatial query
DB-->>GW: Ranked results
GW->>EXT: Reverse geocode addresses
EXT-->>GW: Formatted addresses
GW-->>PWA: Emergency response payload
else Offline Mode
PWA->>PWA: Query DuckDB-Wasm cache
PWA->>PWA: Calculate distance via Turf.js
PWA-->>U: Cached emergency data
end
PWA-->>U: Display nearest hospitals on MapLibre
SafeVixAI maintains enterprise-grade test coverage across all three services.
| Service | Tests | Coverage | Framework |
|---|---|---|---|
| Backend | 2,908 | 100% | pytest (asyncio) |
| Chatbot | 1,819 | 97%+ | pytest (asyncio) |
| Frontend | 2,956 | 87%+ | Jest + RTL |
| E2E | 55 | β | Playwright |
| Total | 7,738 | β | β |
SafeVixAI is exhaustively documented. Our enterprise documentation portal is built with MkDocs Material and hosted on GitHub Pages.
| Section | Key Documents | |
|---|---|---|
| ποΈ | Architecture | System Design Β· Offline Architecture Β· Tech Stack |
| π§ | AI & Agents | AI System Β· RAG Pipeline Β· Memory Architecture |
| π¨βπ» | Developer Guide | Setup Β· Testing Β· Style Guide |
| π | API Reference | SDK Guide Β· Error Codes Β· Webhooks |
| π | SRE & Ops | Operations Β· Monitoring Β· Deployment |
| π‘οΈ | Security | Threat Model Β· Privacy Β· Auth |
π Full documentation portal: safevixai.github.io/SafeVixAI
We believe in the power of open source to save lives. Whether you're optimizing a PostGIS query, expanding the AI RAG corpus, or fixing a UI bug, your contributions are critical.
- Review our Code of Conduct
- Read the Contributing Guide for Git workflow standards
- Check the Good First Issues to jump right in
Security is our top priority. SafeVixAI utilizes strict SBOM tracking, CodeQL static analysis, SLSA provenance, and regular dependency audits via Dependabot.
If you discover a vulnerability, please refer to our Security Policy and report it directly to [email protected]. We adhere to responsible disclosure guidelines.
| Channel | Link |
|---|---|
| Discussions | GitHub Discussions |
| Issues | GitHub Issues |
| Support SLAs | SUPPORT.md |
| Governance | GOVERNANCE.md |
Built with β€οΈ and extreme engineering by the SafeVixAI Team for a safer tomorrow.
Released under the MIT License.