# β‘ 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 β¦