Nigeria's first decentralized health data ecosystem — patient-owned records, blockchain-anchored consent, and federated AI diagnostics built for a nation of 220 million.
# 🏥 MediLedger Nigeria
**Nigeria's first decentralized health data ecosystem**
*Patient-owned records · Blockchain-anchored consent · Zero-knowledge proof vaults · Federated AI diagnostics*
---
## Vision
Healthcare data in Nigeria is fragmented across thousands of disconnected facilities, accessible to neither patients nor the clinicians who need it most. MediLedger Nigeria flips this model: every patient controls a cryptographic health vault sealed with a zero-knowledge proof, every consent is an immutable on-chain agreement, every insurance claim carries tamper-proof multisig, and a privacy-preserving AI engine surfaces early disease risk — all without centralizing raw data.
The system is designed to meet Nigeria's **Data Protection Act 2023**, **NHIA Act 2022**, and **NDPR** requirements from day one.
---
## Repository Structure
```
mediledgerNigeria/
├── frontend/ Next.js 16 + shadcn/ui patient & provider dashboard
│ ├── app/ App Router pages (layout, auth callback, root page)
│ ├── components/mediledger/ Feature components (dashboard, landing, wallet, sidebar)
│ ├── components/ui/ shadcn/ui primitives
│ ├── contexts/ AuthContext (Supabase) · WalletContext (Hedera)
│ ├── hooks/ useWallet · useRealtimeSubscriptions
│ ├── lib/
│ │ ├── api/ Typed supabase-js clients (claims, consents, tokens …)
│ │ └── wallet/ HashPack · Blade · WalletConnect · Mock connectors
│ └── public/ Logos, icons
│
├── backend/
│ ├── supabase/
│ │ ├── migrations/ PostgreSQL schema, RLS, realtime, triggers, storage
│ │ └── functions/ Deno Edge Functions (SMS, push, HCS audit, HEAL events)
│ │
│ ├── services/
│ │ ├── api-gateway/ NestJS :3000 — rate limiting, Supabase JWT guard, USSD
│ │ ├── auth-service/ NestJS :3001 — Hedera wallet auth, custodial wallets
│ │ ├── …