@az54/backend
v1.0.0
Published
Infrastructure de paiement et back-office pour les pharmacies et acteurs médicaux d'Afrique subsaharienne.
Readme
AZ54 Payment Gateway & Back-Office API
Infrastructure de paiement et back-office pour les pharmacies et acteurs médicaux d'Afrique subsaharienne.
🏗️ Architecture
graph LR
subgraph CLIENTS["🌐 CLIENTS"]
LGO["💊 LGO Meditect<br/><small>Intégration API</small>"]
DASH["🖥️ Dashboard Web<br/><small>Back-office</small>"]
PAGE["🔗 Page Paiement<br/><small>Liens publics</small>"]
end
subgraph BACKEND["🏗️ BACKEND AZ54"]
API["🚪 API Gateway<br/><small>/api/v1 (API Key)<br/>/dashboard (JWT)</small>"]
subgraph SERVICES["⚙️ CORE SERVICES"]
PAYIN["💰 Pay-In Service<br/><small>Encaissements</small>"]
PAYOUT["💸 Pay-Out Service<br/><small>Décaissements</small>"]
AUTH["🔐 Auth Service<br/><small>JWT + API Keys</small>"]
BALANCE["📊 Balance Service<br/><small>Ledger & Soldes</small>"]
end
DB[("🗄️ PostgreSQL<br/><small>Transactions<br/>Users<br/>Balances</small>")]
end
subgraph EXTERNE["🌍 INTÉGRATIONS EXTERNES"]
PAWA["📱 Agrégateurs<br/><small>Mobile Money</small>"]
end
LGO ---|"🔑 API Key"| API
DASH ---|"🎫 JWT"| API
PAGE ---|"🌐 Public"| API
API --> PAYIN
API --> PAYOUT
API --> AUTH
PAYIN -.->|"Débit/Crédit"| BALANCE
PAYOUT -.->|"Débit/Crédit"| BALANCE
PAYIN <-->|"Pay-In<br/>Webhooks"| PAWA
PAYOUT <-->|"Pay-Out<br/>Webhooks"| PAWA
PAYIN --> DB
PAYOUT --> DB
BALANCE --> DB
AUTH --> DB
classDef clientStyle fill:#e3f2fd,stroke:#1976d2,stroke-width:3px,color:#000
classDef backendStyle fill:#e8f5e9,stroke:#388e3c,stroke-width:3px,color:#000
classDef serviceStyle fill:#fff3e0,stroke:#f57c00,stroke-width:2px,color:#000
classDef dbStyle fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#000
classDef externalStyle fill:#fff9c4,stroke:#f9a825,stroke-width:2px,color:#000
classDef apiStyle fill:#e0f2f1,stroke:#00897b,stroke-width:2px,color:#000
class LGO,DASH,PAGE clientStyle
class API apiStyle
class PAYIN,PAYOUT,AUTH,BALANCE serviceStyle
class DB dbStyle
class PAWA externalStyle🎯 Fonctionnalités
Core Payment Services ✅
- Pay-In (C2B) - Encaissements
- Pay-Out (B2C) - Décaissements
- Webhooks & polling statuts
- Multi-devises (CDF, XOF, USD)
Back-Office API 🔄
- Auth JWT (merchants)
- Dashboard metrics
- Payment Links
- API Keys management
- Transactions history
- Balance & Ledger
📁 Structure Projet
src/
├── features/
│ ├── payments/ # Pay-In logic (existant)
│ ├── payouts/ # Pay-Out logic (existant)
│ ├── callbacks/ # Webhooks agrégateurs (existant)
│ ├── auth/ # JWT auth (nouveau)
│ ├── dashboard/ # Metrics & analytics (nouveau)
│ ├── links/ # Payment links (nouveau)
│ └── apikeys/ # API keys management (nouveau)
│
├── shared/
│ ├── providers/ # Abstraction PSPs (existant)
│ ├── middlewares/ # Auth, rate-limit, etc.
│ ├── services/ # Ledger, balance, etc.
│ └── utils/
│
└── config/🔐 Authentification
Client API (existant)
- Type: API Keys (
sk_live_xxx,sk_test_xxx) - Usage: Intégrations programmatiques (LGO Meditect, etc.)
Dashboard (nouveau)
- Type: JWT (access 30min, refresh 7j)
- Usage: Interface web marchands
🚀 Tech Stack
- Runtime: Node.js 20+
- Framework: Express.js
- Database: PostgreSQL 15+
- ORM: Prisma (ou Drizzle)
- Cache: Redis (sessions, rate-limiting)
- Queue: BullMQ (webhooks retry)
📄 Licence
Propriétaire - AZ54 Ltd.
