Back to Work
01Oil & Energy

Mafuta v2

Oil Inventory & Trading Platform

NestJSTypeScriptMySQLRedisElasticsearchFirebase
Overview

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.

The Challenge

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.

The Solution

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.

Technical Approach

Engineering Decisions

1

Microservices Architecture

Separated concerns into independent NestJS services — Order Service, Inventory Service, Notification Service — enabling independent scaling and deployment with zero-downtime updates.

2

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.

3

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.

4

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.

O

Operations Director

Mafuta Trading

Key Results

60%Faster trade settlement
0Inventory discrepancies post-launch
200+Concurrent users supported
99.9%Uptime across 12 months

Tech Stack

NestJS
TypeScript
MySQL
Redis
Elasticsearch
Firebase

Build something like this?

Let’s talk about your project in a free 30-minute call.

Book a Call
Project Screenshots
Oil Inventory Management dashboard

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

Real-Time Bidding Engine

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

Microservice Architecture diagram

NestJS microservices architecture with Redis pub/sub and Elasticsearch