The Problem
AGROCAM S.A. is a Cameroonian agro-industrial company running its entire operation — HR, accounting, procurement, client orders, and supply chain — on a monolithic legacy system. The architecture couldn't scale. Adding a new module meant risking the entire system. Field agents in remote areas had no way to log operations without an internet connection. And there was no audit trail for the supply chain — a critical requirement for compliance and quality control.
The goal: replace this with a modern, distributed information system designed for real African operational constraints.
The connectivity problem
Field agents work in areas with poor or no internet. Any system requiring a live connection would be unusable for them — and data loss in the field is unacceptable.
The compliance problem
Cameroonian law (n°2010/012) requires HR and financial data to remain on national territory. A pure cloud approach wasn't legally viable.
The traceability problem
The supply chain had no immutable audit trail. Shipment records could be modified after the fact — a liability risk for a food-grade production company.
The scalability problem
The monolithic system couldn't be updated modularly. Any change risked breaking unrelated parts of the business — development had slowed to a crawl.
What I Built
5 isolated microservices with an API Gateway as the single entry point — centralizing JWT/OAuth2, rate limiting, and acting as a reverse proxy. Business services never validate tokens directly; they trust gateway-injected headers. Each service owns its own PostgreSQL database with dedicated schemas and 17 performance indexes.
Granular RBAC (5 roles): admin, manager, comptable, agent_terrain, analyste — each with a precise access matrix enforced by shared middlewares across all services. A field agent sees only CRM and Supply Chain. An accountant sees only ERP. Zero cross-module data leakage by design.
Offline-first Supply Chain: Designed specifically for field agents in low-connectivity areas. A POST /sync/push endpoint accepts a batch of INSERT/UPDATE/DELETE operations with an offline_id for server-side deduplication. A Redis worker processes the queue every 30 seconds with retry and dead-letter mechanisms — operations logged offline sync automatically when connectivity resumes.
Immutable blockchain traceability (Hyperledger Fabric): Every shipment and supply chain checkpoint is recorded on the Fabric blockchain via a 147-line chaincode. getHistoryForKey() provides complete audit trails. A verifyChainIntegrity() function validates the entire chain — each checkpoint links to the previous via a composite index. Records cannot be altered retroactively.
BI Service (FastAPI/Python): Aggregates KPIs from all services via HTTP with 5-minute Redis cache. Exposes snapshot, trend, and dashboard endpoints — giving management real-time visibility across the entire operation without querying production databases directly.
Hybrid cloud infrastructure: AWS af-south-1 (Cape Town) for compute — ECS Fargate, RDS PostgreSQL Multi-AZ, ElastiCache Redis, ALB. Azure South Africa North for enterprise identity (Azure AD). On-premise Douala for HR and financial data (legal compliance). Entirely managed by Terraform across 8 modules, with 90-day secret rotation and GuardDuty monitoring.
CI/CD pipeline (GitHub Actions, 5 stages): Lint → Jest tests → Python lint (Ruff) → Docker multi-stage build + ECR push → ECS deploy. Separate environments for staging and production.
Impact
Zero data loss in the field
The offline-first sync architecture means field agents can work without connectivity. Operations are queued locally and synced automatically — no manual re-entry, no lost records.
Full legal compliance
HR and financial data stays on-premise in Douala (Cameroonian law n°2010/012). The hybrid architecture was designed around this constraint from day one — not retrofitted.
Immutable supply chain audit
Every shipment checkpoint is now on the blockchain. Records cannot be altered after the fact — eliminating the liability risk of mutable supply chain logs for a food-grade producer.
$465/month estimated infrastructure
A fully production-grade multi-cloud setup with monitoring, alerting, DRP (RTO 5–60 min, RPO 5 min), and autoscaling — at a cost accessible for a mid-sized Cameroonian company.
Monitoring & Observability
- Prometheus: Scrapes all 5 service health endpoints, Redis, PostgreSQL, and Kubernetes nodes
- Grafana: 7-panel dashboard (service status, CPU/memory, Redis hit ratio, PG connections, 5xx errors, recent error logs)
- CloudWatch: 10 widgets including ALB latency/p99, RDS IOPS, Redis hit/miss, estimated costs
- Alerting: 7 Prometheus rules covering ServiceDown, HighErrorRate, HighLatency, HighCPU, PGConnectionsHigh, RedisCacheMissHigh, DiskSpaceLow
What This Experience Taught Me
Designing for a Cameroonian agro-industrial company exposed me to real-world constraints that don't appear in textbook architectures: field agents without connectivity, data residency regulations, and legal traceability requirements for the food supply chain. Every technical tradeoff was dictated by the business — not by technology preferences.
I also learned to design a system deployable in three different ways (Docker Compose, Kubernetes, ECS Fargate) without changing a line of business logic — a constraint that forced cleaner separation between infrastructure and application from the start.