Inspiration
Vehari, Punjab (pop. 1M+) experiences 8-12 hours of unscheduled load shedding daily. The official MEPCO schedule has <40% accuracy. As a developer and student, I lost 3-4 hours of productivity daily - online classes drop, commits fail, UPS dies without warning.
Talking to 20+ families in Vehari, the pattern was identical: farmers can't run tube-wells, students can't study, shopkeepers close early. The problem isn't electricity generation - it's information asymmetry. No real-time ground truth exists.
We realized: If Waze can crowdsource traffic, we can crowdsource electricity.
What it does
BijliGuard is a real-time, predictive load-shedding intelligence platform for Vehari.
- 1-Click Crowdsource:Users report "Light Gayi / Light Aayi" with location. Firebase Realtime DB updates live map in <100ms.
- Live Vehari Grid Map: Leaflet-based heatmap showing Green (Power ON) / Red (Power OFF) zones across Vehari tehsils - Luddan, Mailsi, Burewala, Tibba Sultan Pur.
- AI Prediction Engine: Time-series analysis on last 14 days of crowd data + MEPCO history. Outputs: "85% probability outage tomorrow 7-9 PM. Charge devices now."
- Student/Work Mode:Optimization algorithm suggests best 2-hour window for high-power tasks based on predicted uptime and UPS battery curve.
- MEPCO vs Reality Dashboard: Data integrity layer exposing delta between official schedule and actual ground reports.
- PWA + WhatsApp Alerts: Works on 2G, offline-first, pushes alert 15 mins before predicted outage.
How we built it
Architecture (Production-Grade): Frontend: Next.js 14 (App Router) + TypeScript + Tailwind CSS + Framer Motion. Deployed on Vercel Edge with ISR for map tiles. Backend: Firebase Realtime Database for low-latency state, Firestore for analytics, Firebase Auth (anonymous for frictionless reporting). Maps: Leaflet + OpenStreetMap, custom tile layer for Vehari district boundaries. Prediction: Python microservice (FastAPI) hosted on Render - uses Exponential Moving Average + hour-of-day / day-of-week seasonality. Falls back to heuristic if cold start. Notifications: Twilio WhatsApp API + Web Push. PWA: Workbox for offline queue - reports sync when internet returns.
Data Pipeline: Crowd event -> RTDB trigger -> Cloud Function validation (spam filter, geo-fencing to Vehari bounding box 30.04N,72.35E) -> Aggregation job -> Prediction model retrain every 6 hours via Vercel Cron.
Challenges we ran into
- Cold Start Problem:No historical data on day 1. Solved with synthetic MEPCO schedule + 72-hour bootstrapping with 15 test users in Vehari.
- Spam & False Reporting:One user spamming could break map. Built trust scoring - user credibility decays if reports deviate from cluster consensus. Geo-fencing restricts to Vehari district.
- Realtime on Low Bandwidth:Firebase RTDB
Built With
- firebase
- firestore
- leaflet.js
- next.js
- react
- recharts
- tailwind-css
- typescript
Log in or sign up for Devpost to join the conversation.