Mafuta v2
Oil Inventory & Trading Platform
Project Overview
Mafuta v2 is a modern oil inventory and trading platform built for a commodity trading firm operating across East Africa. The platform replaced a fragile network of shared spreadsheets, email threads, and phone calls with a single, real-time digital marketplace where buyers and sellers transact with full visibility.
What We Were Solving
The client was managing multi-million dollar oil trades using Excel workbooks passed over email. Inventory figures were always hours out of date, bid-ask negotiations happened over WhatsApp, and settlement errors were a monthly occurrence. They needed a system that could handle concurrent buyers and sellers, reflect live inventory, and keep a complete audit trail — all without a large in-house IT team to maintain it.
How We Built It
We designed Mafuta v2 as a microservices backend on NestJS with a PostgreSQL core and Redis caching for sub-50ms read performance. The bidirectional order flow allows both buyers and sellers to initiate trades, with real-time bid matching and status notifications via Firebase push. Elasticsearch powers instant search across grades, volumes, and counterparties. A dedicated inventory module tracks commodity grades, storage locations, and available volumes with full transactional integrity.
Engineering Decisions
Microservices Architecture
Separated concerns into independent NestJS services — Order Service, Inventory Service, Notification Service — enabling independent scaling and deployment with zero-downtime updates.
Real-Time Bidding Engine
Built a stateful order book with Redis Pub/Sub for instant bid-ask propagation. Buyers and sellers see live updates without polling, driven by WebSocket connections managed by the backend.
Elasticsearch-Powered Search
Every commodity, counterparty, and transaction is indexed in Elasticsearch, enabling full-text search with millisecond response times across hundreds of thousands of records.
Audit Trail & Compliance
Every state change in the order flow is immutably logged with timestamps, user identity, and previous state — providing a court-admissible audit trail for each transaction.
Pionetix delivered a platform that fundamentally changed how we operate. What used to take days now happens in minutes. The real-time visibility alone has saved us from several costly errors.
Key Results
Tech Stack
In Action

Real-time inventory dashboard showing commodity grades, volumes, and locations

Bidirectional order book with live bid-ask matching and WebSocket updates

NestJS microservices architecture with Redis pub/sub and Elasticsearch