# nigeria-power-planner (Load Shedding Copilot)
This Clarity smart contract solution is to help Nigerians plan their electricity usage during power outages, optimize generator/solar usage, and track NEPA/PREPAY meter statistics.
## Overview
Nigeria Power Planner is a blockchain-based solution that addresses the daily challenges of power outages in Nigeria. The application helps users:
- Track and report power outages in their location
- Record and analyze electricity usage patterns
- Optimize generator and solar power usage
- Calculate cost savings from efficient power management
- Share and verify outage information with the community
## Smart Contract Features
The Clarity smart contract provides the following functionality:
1. **User Profile Management**
- Register new users with their electricity usage preferences
- Update user profiles with current information
- Store meter types (NEPA/PREPAY) and numbers
2. **Power Outage Tracking**
- Report power outages with location, date, and duration
- Confirm outages reported by other users
- Calculate average outage durations by location
3. **Electricity Usage Recording**
- Track grid, generator, and solar electricity usage
- Record costs associated with different power sources
- Monitor hours without power
4. **Optimization Recommendations**
- Generate personalized recommendations for generator runtime
- Calculate optimal solar usage based on capacity
- Estimate cost savings from following recommendations
## Getting Started
### Prerequisites
- Clarinet - Clarity development environment
- Stacks Wallet - For interacting with the deployed contract
### Installation
1. Clone the repository:
2. Install dependencies:
clarinet install
Test the contract:
clarinet test
Deployment
Deploy to the Stacks testnet:
clarinet deploy --testnet
Deploy to the Stacks mainnet (when ready):
clarinet deploy --mainnet
Usage Examples
Register a New User
(contract-call? .electricity-planner register-user
"John Doe"
"Lagos, Ike …