deployment
Deployment Guide
This document explains how to deploy the M-PESA Analytics SaaS Platform, an 11-microservice distributed fintech system designed for multi-tenant analytics workloads.
The platform supports:
- Local development deployment
- Docker Compose environments
- Production-ready Kubernetes deployment
Architecture Overview
Deployment topology:
React Dashboard ↓ API Gateway (Port 9000) ↓ Core Platform Services ↓ Analytics Pipeline Services ↓ Kafka + PostgreSQL + Redis
Local Development Deployment
Requirements
Install:
- Python 3.12
- PostgreSQL
- Redis
- Kafka
- Node.js 20+
- Docker (optional)
Clone repositories:
git clone https://github.com/Black-opps/mpesa-analytics-dashboard
git clone https://github.com/Black-opps/mpesa-api-gateway
git clone https://github.com/Black-opps/auth-service
Repeat for remaining services.
Start Infrastructure
Start PostgreSQL:
Start Redis:
Start Kafka:
Start Services (recommended order)
Start services in dependency order:
auth-service
tenant-service
payment-service
billing-service
parser-service
categorizer-service
analytics-service
cashflow-service
webhook-service
api-gateway
dashboard
Docker Compose Deployment
Recommended development environment:
Starts:
- PostgreSQL
- Redis
- Kafka
- All backend services
- API Gateway
Ports exposed:
| Service | Port |
|---|---|
| Auth | 8001 |
| Tenant | 8002 |
| Analytics | 8000 |
| Parser | 8004 |
| Cashflow | 8005 |
| Payment | 8007 |
| Billing | 8008 |
| Categorizer | 8009 |
| Webhook | 8010 |
| Gateway | 9000 |
| Dashboard | 3000 |
Production Deployment Strategy
Production architecture:
Kubernetes Deployment
Each service runs as:
Example:
Repeat per service.
Environment Variables
Required variables:
Observability Stack
Recommended production stack:
Prometheus
Grafana
Loki
OpenTelemetry
Metrics exposed via:
on each service.
Scaling Strategy
Stateless services scale horizontally:
Kafka enables async pipeline scalability.
Security Configuration
Production requirements:
TLS termination at load balancer
JWT validation at API Gateway
Secrets stored in Kubernetes Secrets
Tenant isolation enforcement
Recommended Production Topology
Minimum cluster layout:
3 API Gateway replicas
2 Auth replicas
2 Tenant replicas
2 Analytics replicas
Kafka cluster (3 brokers)
PostgreSQL primary + replica
Redis cluster
CI/CD Deployment Flow
Pipeline stages:
GitHub Actions supported.
Next Steps
See:
deployment/docker.md
deployment/kubernetes.md
deployment/ci-cd.md