You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SAMRAKSHA — Police Crime Monitoring & Case Management Platform
Integrated AI-assisted law enforcement platform for Ahmedabad City Police.
Real-time CCTV analytics · Predictive patrolling · FIR/case management · Legal AI assistant · Multi-language support
SAMRAKSHA is a production-grade full-stack police operations platform built for Ahmedabad City Police. It integrates real-time surveillance, AI-powered crime prediction, case management (FIR lifecycle), patrol coordination, legal intelligence, and multi-language document generation into a single unified dashboard.
All data is live — no mock data. Every UI element fetches from the live FastAPI backend backed by PostgreSQL/PostGIS and Redis.
Features
🗂️ Case Management (FIR)
Create, update, and track FIRs through full lifecycle
Case diary entry system with evidence attachments
Accused/victim profile management with linking
CCTNS integration for national crime database sync
AI-powered case similarity and pattern matching
📹 CCTV Intelligence
Live feed grid with 46+ cameras across Ahmedabad zones
AI crowd density detection and loitering alerts
ANPR (automatic number plate recognition) matching against active FIRs
Alert escalation with zone-level severity scoring
🚔 Patrol Management
Real-time patrol unit tracking with GPS telemetry
AI-optimized route planning via OSRM engine
Unit status management (available / deployed / responding)
PCR (Police Control Room) incident dispatch integration
Hourly / weekly / monthly trend charts from live incident data
Festival/event simulation for proactive deployment planning
Hotspot surge detection with 3-hour forward projection
🤖 Legal AI Assistant
Natural language query interface for Indian Penal Code / BNS 2024
Legal section search with context extraction
Multi-language support (Gujarati, Hindi, English via IndicTrans2)
Voice-to-text query input (OpenAI Whisper)
📄 Document Generation
One-click generation of legal documents from case data:
Chargesheet (BNS 2024) · Medical Letter · Remand Request (BNSS) ·
Seizure Receipt · Court Custody · Panchanama · Face ID Report
.docx templates with live case data injection
👥 Admin & RBAC
Officer profile management with role-based access control
Model: XGBoost trained on 3-year Ahmedabad incident data
Features: Hour of day, day of week, ward, crime type, festival calendar
Output: Risk score 0–100 per ward/hour slot → zone_risk_scores table
Patrol Routing (services/routing.py)
Engine: Google OR-Tools VRP solver
Input: Active patrol units, open incidents, hotspots
Output: Optimized routes per unit via OSRM road network
Legal AI Assistant (services/assistant.py)
LLM: Llama.cpp local inference (no external API calls)
Index: BNS 2024 + IPC sections with embedding search
Languages: English / Hindi / Gujarati (IndicTrans2)
CCTV Vision (services/vision.py)
Framework: MediaPipe + OpenCV
Detections: Crowd density, loitering duration, face landmarks
ANPR: Number plate extraction + FIR database matching
Voice Input (services/voice.py)
Engine: OpenAI Whisper (local, base model)
Languages: English, Hindi, Gujarati
Output: Transcribed text → assistant query pipeline
Security
Implemented Hardening
Control
Implementation
Authentication
JWT HS256, python-jose, bcrypt passwords
Authorization
Per-endpoint require_permission() RBAC
Rate Limiting
SlowAPI on AI/document/search endpoints
WebSocket Auth
JWT validation on connect, 1008 close on failure
API Keys
100% from env vars — no hardcoded defaults
SQL Injection
Parameterized asyncpg queries throughout
CORS
Configurable via ALLOWED_ORIGINS env var
Gunicorn
Pinned >=22.0.0 (fixes HTTP smuggling CVEs)
Vite
Upgraded to 6.4.3 (patches all known Vite CVEs)
Resolved CVEs
CVE / Advisory
Package
Fix
GHSA-jgfp-53c3-624m
gunicorn
Pinned >=22.0.0 in requirements.txt
GHSA-w3h3-4rj7-4ph4
gunicorn
Pinned >=22.0.0 in requirements.txt
Vite arbitrary file read via WebSocket
vite
Upgraded to 6.4.3
Vite server.fs.deny bypass (Windows)
vite
Upgraded to 6.4.3
Vite path traversal in .map handling
vite
Upgraded to 6.4.3
Vite public dir name collision
vite
Upgraded to 6.4.3
React Router RCE / XSS / DoS / CSRF
react-router
Not used — removed with frontend_new/
Note: All React Router vulnerabilities were detected in frontend_new/package.json. That directory was deleted as part of the project reorganization. The active frontend (frontend/) does not use React Router.