# ⚡ Naija Power Bot
A crowdsourced WhatsApp bot that tracks real-time power outages across Nigeria. Built for Nigerians, in the way Nigerians talk.
## 🇳🇬 The Problem
Nobody knows when NEPA/PHCN will bring light or which areas currently have power. People resort to calling neighbors, checking unstructured Facebook/WhatsApp groups, or simply waiting in the dark.
**Naija Power Bot** fixes this by turning every Nigerian's natural habit of announcing power situations into a structured, searchable, real-time database.
## 💡 How It Works
- **Reporters** message the bot when light goes or comes back in their area
- **Checkers** ask the bot about power status in any area before making decisions
- **Subscribers** get instant alerts when light goes or comes back in their area
- Reports automatically expire after 6 hours
- Data is crowdsourced — the more people use it, the more accurate it gets
---
## 🚀 Features
- ✅ Real-time power outage reporting
- ✅ Area-based status checks
- ✅ Supports English and Nigerian Pidgin
- ✅ Flexible message patterns (area first or last)
- ✅ Auto-expiring reports (6 hours TTL)
- ✅ MongoDB-backed session (survives server restarts)
- ✅ Rate limiting (10 messages/minute per user)
- ✅ Input sanitization
- ✅ Production-grade logging with Winston
- ✅ Graceful shutdown handling
- ✅ Auto-restart with PM2
- ✅ Group message filtering (DMs only)
- ✅ Area subscription alerts (instant notifications)
- ✅ Daily 7am morning broadcast to all subscribers
- ✅ Outage duration tracking ("without light for 5hrs 30mins")
- ✅ Weekly session cleanup (keeps MongoDB lean)
- ✅ Admin dashboard with real-time metrics
---
## 📱 How to Use the Bot
### Report No Light
```
no light - Yaba
no light for Surulere
Ikeja no light
NEPA take light for Lekki
light don go for Ojodu
Yaba blackout
no current for Festac
```
### Report Light Back
```
light back - Yaba
up NEPA Surulere
Ikeja light don come back
current d …