Detecting damage before it becomes disaster.
Built in 48 hours. Deployable to 1 billion people.
Last year in Maharashtra alone, 3,275 people died because of potholes on Indian roads. 73% of reported potholes are never fixed. ₹33,000 crore is spent annually on road repairs, but manual inspection is slow, expensive, and dangerous.
CRACKWATCH doesn't just detect damage — it predicts when it will fail, estimates the repair cost, submits the report to authorities, and publicly ranks every contractor by negligence.
Citizens report via the PWA — or WhatsApp — in under 3 seconds. Governments see the report on an inspector's map with AI-analyzed severity, cost, and a priority queue. The public sees every unfixed pothole and which contractor is responsible.
Detecting a pothole doesn't fix it. A watched government does.
|
Zero app install needed. 500M Indian WhatsApp users can report damage right now, no learning curve, no app store, no login. |
Fully offline, 757ms per image. YOLOv8s-RDD + CrackSeg + OpenCV running in parallel. Zero cloud bills. Works when internet drops. |
Contractor accountability, publicly ranked. Every unfixed report compounds their negligence score. Politicians don't want to be at the top. |
|
"This road fails in 18 days." Monsoon-adjusted damage progression model. Shows cost delta if repair delayed. |
No selfies reach the inspector. Image authenticity + GPS validation + content relevance + duplicate detection + rate limiting. |
Citizens compete to fix their city. XP, Civic Coins, 13 badges, daily streaks, AI Challenge game, Pothole Hunter leaderboard. |
┌────────────────────────────────────────────────────────────────────────┐
│ CRACKWATCH ECOSYSTEM │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌────────────────┐ │
│ │ Govt App │ │ Citizen PWA │ │ WhatsApp Bot │ │
│ │ React+Vite │ │ React+Vite │ │ (Twilio) │ │
│ │ Port 5173 │ │ Port 5175 │ │ +14155238886 │ │
│ │ HTTPS │ │ Phone-frame │ │ join code │ │
│ └──────┬───────┘ └──────┬───────┘ └────────┬───────┘ │
│ │ │ │ │
│ └──────────┬─────────┴──────────┬───────────┘ │
│ ▼ ▼ │
│ ┌───────────────┐ ┌───────────────┐ │
│ │ HTTPS :8000 │ │ HTTP :8001 │ │
│ │ Frontend API │ │ ngrok tunnel │ │
│ └───────┬───────┘ └───────┬───────┘ │
│ │ │ │
│ └──────────┬─────────┘ │
│ │ │
│ ┌───────▼────────┐ │
│ │ FastAPI │ │
│ │ (single app) │ │
│ └───────┬────────┘ │
│ │ │
│ ┌──────┬──────┬──────┬──────┼──────┬──────┬──────┬──────┐ │
│ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ │
│ YOLO Crack OpenCV Severity Cost Fraud Predict Gamify Analytics │
│ RDD Seg CV Engine INR 5-lyr X-days XP/Lvl Wall of Shame │
│ │
│ ┌──────────────┐ │
│ │ shared_store │ ← cross-process state sync │
│ │ .json │ │
│ └──────────────┘ │
└────────────────────────────────────────────────────────────────────────┘
Dual-backend design:
- Port 8000 HTTPS — serves frontends (mobile camera/GPS requires secure context)
- Port 8001 HTTP — receives Twilio WhatsApp webhooks via ngrok
- Shared state via
shared_store.json(merge-on-read/write)
| Feature | What It Does |
|---|---|
| 🤖 AI Damage Detection | Upload an image → 3-model pipeline detects 10+ damage types in 757ms |
| 📏 Severity Scoring | 0-100 composite score based on damage area × confidence × type weight |
| 💰 Cost Estimation | INR estimates calibrated to CPWD 2023 Mumbai rates + repair method + crew size |
| 📋 Repair Plan Generator | Priority-ranked daily action plan for inspectors |
| 🗺️ Reports Map | Interactive Leaflet map with admin controls (mark fixed/in-progress) |
| 🎥 Video + Live Camera | Frame-by-frame video analysis + live camera detection |
| 🔮 Predictive Analytics | "This road fails in X days" with monsoon acceleration (2.5× Jun-Sep) |
| 🔥 Wall of Shame | 6+ contractors ranked by negligence score |
| Top 5 urgent repairs with total cost projection | |
| 🏥 City Health Score | 0-100 rating per city with trend indicators |
| 🔄 Before/After | Upload 2 images → AI computes improvement % |
| 📊 Smart Heatmap | Geo-intensity visualization of damage severity |
| 🛡️ Fraud Controls | Toggle 5-layer fraud detection on/off |
| Feature | What It Does |
|---|---|
| 🗺️ Live Pothole Map | Real-time pins color-coded by status (unfixed/in-progress/fixed) |
| 📸 Photo + GPS Reporting | Tap → photo → AI classifies → auto-GPS → submit in 3 taps |
| ⬆️ Upvote System | Citizens vote which potholes matter most → priority re-rank |
| 🧭 Pothole-Aware Navigation | OSRM routing with safety scores, hazard markers, "Avoid Potholes" toggle |
| 🏆 Pothole Hunter Leaderboard | Top citizens by XP — gold/silver/bronze podium |
| 🎖️ 13 Achievement Badges | First Report → Road Warrior → City Saver → AI Master |
| 💰 Civic Coins | Virtual currency earned from reports + verifications |
| 🔥 Daily/Weekly Streaks | Bonus XP multipliers for consistent reporting |
| 🧠 AI Challenge Game | Guess damage type from scenario description (+50 XP correct) |
| 📊 Transparency Dashboard | Government performance score + fix rate + cost total |
| 💬 WhatsApp Integration | Report directly from WhatsApp, no PWA needed |
| 📱 Phone-Frame Desktop | Mobile-first design looks like a phone on desktop |
| Feature | What It Does |
|---|---|
| 🚀 Zero-Install Reporting | Send photo → get AI analysis in 3 seconds |
| 🔄 Two-Step Conversation | Stateful flow: photo first, then location share |
| 📍 Native Location Share | Uses WhatsApp's native location picker for accurate GPS |
| 🤖 AI Reply | Damage type + severity + cost + gamification rewards |
| 🛡️ No-Damage Guard | Clean photos rejected with tips (not auto-approved) |
| ⏱️ 15-min Session Expiry | Prevents stale photo + fresh location mismatch |
| 🎮 Gamification in Chat | XP, coins, new badge notifications in reply message |
|
|
- Python 3.12+
- Node.js 20+
- Git
- (Optional) ngrok for WhatsApp webhook
- (Optional) Twilio account (free trial) for WhatsApp
git clone https://github.com/SaudSatopay/CrackWatch-NirmanHackathon.git
cd CrackWatch-NirmanHackathoncd backend
pip install -r requirements.txt# Govt Dashboard
cd ..
npm install
# Public PWA
cd public-app
npm install
cd ..# Using mkcert (recommended)
mkcert -install
mkcert -cert-file certs/cert.pem -key-file certs/key.pem localhost 127.0.0.1 <your-lan-ip>
# Copy to backend too (for the API)
cp certs/cert.pem backend/cert.pem
cp certs/key.pem backend/key.pem# crackwatch/.env
VITE_API_URL=https://<your-lan-ip>:8000
# public-app/.env
VITE_API_URL=https://<your-lan-ip>:8000
# backend/.env (for WhatsApp)
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=xxxxxxxxxxxxxxx
TWILIO_WHATSAPP_FROM=whatsapp:+14155238886# Terminal 1 — Backend (HTTPS, for frontend)
cd backend
python -m uvicorn main:app --host 0.0.0.0 --port 8000 \
--ssl-keyfile key.pem --ssl-certfile cert.pem
# Terminal 2 — Backend (HTTP, for WhatsApp via ngrok)
cd backend
python -m uvicorn main:app --host 0.0.0.0 --port 8001
# Terminal 3 — Govt Dashboard
npm run dev # → https://<your-ip>:5173
# Terminal 4 — Public PWA
cd public-app
npm run dev # → https://<your-ip>:5175
# Terminal 5 — ngrok (for WhatsApp)
ngrok http http://localhost:8001
# Copy the https://*.ngrok-free.app URL to Twilio Sandbox webhook# 20 reports from real images across Mumbai + Navi Mumbai
cd backend
PYTHONIOENCODING=utf-8 python seed_from_images.py
# 10 gamification demo users
curl -k -X POST https://localhost:8000/gamification/seed-demo| Role | Username | Password | What You Get |
|---|---|---|---|
| 🏛️ Government Inspector | admin |
admin123 |
Full govt dashboard + admin controls |
| 🏛️ Municipal Officer | inspector |
inspect123 |
Same as admin, different name |
| 🏛️ NHAI Engineer | engineer |
eng123 |
Same as admin, different name |
| 📱 Demo Citizen | saud |
123 |
Pre-seeded profile: Lv.6, 3200 XP, 10 badges, 21-day streak, #1 leaderboard |
| 📱 Anonymous Citizen | any name | blank | Fresh account, starts at 0 XP |
POST /auth/login Government or citizen login → JWT
POST /auth/register Anonymous citizen registration
GET /auth/me Verify token
POST /detect Image upload → full AI pipeline
POST /detect/video Video frame-by-frame analysis
POST /detect/frame Single base64 frame (live camera)
GET /sectors Available detection sectors
POST /public/report Submit citizen report (photo + GPS)
GET /public/reports/map Lightweight map pins
GET /public/reports/map/detail Full reports with images
GET /public/reports/{id} Single report
POST /public/reports/{id}/upvote Upvote a report
GET /admin/reports/map Govt reports with admin fields
PATCH /admin/reports/{id}/status Change status (submitted/in_progress/fixed)
GET /admin/settings Read system settings
PATCH /admin/settings Toggle fraud detection
POST /admin/reports/seed-demo Seed demo reports
GET /analytics/wall-of-shame Contractor leaderboard
GET /analytics/heatmap Geo-intensity points
GET /analytics/priority-queue Top 5 urgent repairs
GET /analytics/city-health Per-city health scores
GET /analytics/forecast Predictive maintenance forecast
POST /analytics/before-after Compare before/after images
GET /gamification/leaderboard Top 20 XP holders
GET /gamification/profile/{user_id} Full user profile
GET /gamification/challenges/{user_id} Daily quests
POST /gamification/verify Community vote on report
GET /gamification/ai-challenge Random scenario
POST /gamification/ai-challenge/answer Submit guess
GET /gamification/achievements All badges
POST /gamification/seed-demo Seed 10 demo users
POST /whatsapp/webhook Twilio incoming-message handler
POST /repair-plan/generate Priority-ranked daily plan
GET /repair-plan/explain/{id} Explainable AI breakdown
- Sign up at https://www.twilio.com/try-twilio (free, no credit card)
- Navigate to Messaging → Try it out → Send a WhatsApp message
- Note your sandbox number (
+1 415 523 8886) and join code
- Run
ngrok http http://localhost:8001— copy the forwarding URL - In Twilio Sandbox → Sandbox settings:
- When a message comes in:
https://your-ngrok.ngrok-free.app/whatsapp/webhook - Method: HTTP POST
- Save
- When a message comes in:
From any WhatsApp:
join your-sandbox-code
to +1 415 523 8886
- Send a photo of damage
- Bot replies: "📸 Got your photo! Now tap 📎 → Location → Send current location"
- Share your location via WhatsApp's attachment menu
- Bot replies with AI analysis, cost, repair method, XP earned
Why local YOLO, not cloud inference?
Zero cloud bills. Sub-second latency. Works offline. Critical for rural India where connectivity is inconsistent. Municipalities can deploy on a ₹30K laptop with no recurring costs.
Why two uvicorn processes (HTTPS + HTTP)?
Frontend requires HTTPS for mobile camera/GPS (browser security). ngrok free tier can't verify self-signed upstream TLS, so Twilio webhooks need plain HTTP. Solved with a shared shared_store.json for cross-process state.
Why WhatsApp instead of another chat platform?
500M+ monthly active users in India. Zero install friction. Works on feature phones via WhatsApp Lite. Citizens already know how to send photos. No "why should I install your app?" barrier.
Why YOLOv8 and not newer models like YOLOv11?
YOLOv8s-RDD has pre-trained weights on RDD2022 (4.8K Indian road images). A newer architecture without domain-specific training scores ~14 percentage points lower on Indian damage. "Newer ≠ better" when domain data matters.
Why in-memory state instead of PostgreSQL?
Hackathon velocity. Every feature ships in 30 minutes because there's no migration overhead. shared_store.json adds persistence + cross-process sync. Production would use PostgreSQL + PostGIS for geo-queries.
Why rule-based cost estimation, not ML?
Explainability. Inspectors need to defend budget allocations. A rule-based engine calibrated to CPWD 2023 rates gives line-item accountability. ML would be a black box no government will approve.
| Metric | Value | Context |
|---|---|---|
| YOLO inference time | ~500ms | CPU only, no GPU |
| Full pipeline latency | ~757ms | YOLO + CrackSeg + OpenCV + annotation |
| WhatsApp round-trip | ~3 seconds | User's photo → bot reply |
| Reports on map load | ~50ms | 20 reports with base64 images |
| Fraud check time | ~200ms | Mostly Laplacian + FFT |
| Memory footprint | ~1.2 GB | Per uvicorn process (YOLO weights) |
| Inference accuracy | 72.6% mAP | YOLOv8s-RDD on RDD2022 test set |
- Core AI pipeline (3 models)
- Dual-platform (Govt + Citizen)
- WhatsApp integration with stateful conversations
- Gamification (13 badges, leaderboard, AI challenge)
- 5-layer fraud detection
- Predictive maintenance engine
- Wall of Shame with 6 contractors
- Pothole-aware navigation
- Demo-ready seed data (20 reports across Mumbai + Navi Mumbai)
- 15-slide presentation deck
- PostgreSQL + PostGIS migration
- Real WhatsApp Business API (no sandbox join code)
- Mobile native apps (React Native)
- Offline-first sync queue
- Multi-language (Hindi, Marathi)
- UPI-based citizen crowdfunding ("fund this fix")
- WebSocket real-time map updates
- AR live-scan camera overlay
- Voice note transcription (Whisper)
- Municipal ERP integration (SAP, custom CPGRAMS bridges)
- Passwords are plaintext in
auth.py(would be bcrypt-hashed in prod) - JWT secret is hardcoded (would be env var + rotation)
- CORS =
allow_origins=["*"](would be scoped to known frontends) - Rate limiting is in-memory (would need Redis for multi-worker)
- ✅ XML escaping in TwiML replies
- ✅ Fraud detection resilient to hostile users
- ✅ Image authenticity resists screenshot attacks (moiré detection)
- ✅ GPS bounds check rejects out-of-India coords
- ✅
.env,.pem, andshared_store.jsonare gitignored - ✅ JWT tokens expire in 24h
See CHANGELOG.md — every release documented with bullet points.
Highlights:
- v1.0.0 — Production release, dual platform
- v1.4.0 — 5-layer fraud detection
- v2.0.0 — Smart navigation with pothole avoidance
- v2.2.0 — Predictive maintenance engine
- v3.0.0 — Full gamification (12 features)
- v3.3.0 —
saud/123demo account - v3.4.0 — No-damage rejection
- v3.5.0 — WhatsApp bot
- v3.5.2 — Stateful WhatsApp two-step flow (photo + location)
- v3.6.0 — Presentation rebuild with groundbreaking features
- v3.6.1 — 20 AI-detected real-image reports across Mumbai
- v3.6.2 — Wall of Shame with 6 contractors
Event: NIRMAN 2026 — Amity University Mumbai Dates: April 15-17, 2026 (48 hours) Problem Statement: #4 — AI-based infrastructure damage detection Team: Solo — Saud Satopay
"Detecting a pothole doesn't fix it. A watched government does."
MIT — Feel free to fork, adapt, and deploy to your own municipality. Open-source infrastructure accountability should be a public good.
- RDD2022 Dataset — Pre-trained YOLO weights
- HuggingFace — Model hosting
- Twilio — WhatsApp Sandbox (free tier)
- OpenStreetMap + OSRM — Free mapping infrastructure
- Ultralytics — YOLOv8 inference framework
- Amity University Mumbai — Hosting NIRMAN 2026
- Every pothole that inspired this build. May you never trip another commuter.
Built with ☕ and zero sleep during NIRMAN Hackathon 2026.
If this helped your city, a ⭐ on GitHub means the world.