How to Calculate & Reduce Your ECG Electricity Units (kWh) in Ghana to Save Money
# PowerCalc GH — React Native Expo App
## ECG Prepaid Electricity Estimator for Ghanaians
---
## Quick Start
```bash
# 1. Create the Expo project (run this first)
npx create-expo-app@latest PowerCalcGH --template tabs
cd PowerCalcGH
# 2. Install required dependencies
npx expo install @react-native-async-storage/async-storage
npx expo install @react-native-community/slider
npx expo install react-native-safe-area-context
npx expo install expo-sharing
npx expo install expo-notifications
# 3. Copy all files from this scaffold into the project
# (types/, constants/, hooks/, store/, components/, app/)
# 4. Start dev server
npx expo start
```
---
## Project Structure
```
PowerCalcGH/
│
├── types/
│ └── index.ts ← All TypeScript interfaces
│
├── constants/
│ ├── tariffs.ts ← PURC tariff rates (update quarterly)
│ └── appliances.ts ← All 25+ appliances with Ghana defaults
│
├── hooks/
│ └── useCalculator.ts ← Core calculation logic + formatters
│
├── store/
│ └── historyStore.ts ← AsyncStorage credit history
│
├── components/
│ ├── ApplianceCard.tsx ← Tap-to-toggle appliance tile
│ └── ResultCard.tsx ← Days-left result + breakdown bars
│
└── app/
└── (tabs)/
└── index.tsx ← Calculator home screen
```
---
## Tariff Update Process (every quarter)
PURC adjusts tariffs quarterly via the Automatic Adjustment Formula (AAF).
When a new rate is announced, **only update `constants/tariffs.ts`**:
1. Check:
purc.com.gh → Tariffs → Current Electricity Tariffs
2. Update `ratePerKwh` values in the `TARIFFS` object
3. Update `lastUpdated` date string
4. Submit an OTA update via `eas update` — no App Store review needed
```ts
// Example: updating residential band
residential: {
bands: [
{ minKwh: 0, maxKwh: 30, ratePerKwh: 0.8690, ... }, // lifeline
{ minKwh: 30, maxKwh: 300, ratePerKwh: 1.9688, ... }, // ← update this
{ minKwh: 300, maxKwh: null, ratePerKwh: 2.1500, ... }, // ← and th …