Skip to main content
Solo•Live in Production•2026 – Present

DukaSync — Offline-First Multi-Tenant Retail POS, Van-Sales & KRA eTIMS Platform

Offline-first retail POS and van-sales platform with RFC 9562 UUIDv7 sync queues, deadlock-free stock locking, and simulated KRA eTIMS 4-tier VAT compliance.

DukaSync — Offline-First Multi-Tenant Retail POS, Van-Sales & KRA eTIMS Platform
DukaSync — Offline-First Multi-Tenant Retail POS, Van-Sales & KRA eTIMS Platform Cover Banner
0%
Offline Continuity
0 Rates
Kenyan VAT Tiers
0 Roles
Tenant RBAC Roles
0mm eTIMS
Receipt Format
The Challenge

Problem & Context

Cloud-only POS tools freeze during Safaricom 4G or fiber blackouts, forcing cashiers onto paper books, while naive offline sync replays cause duplicate stock deductions or overwrite concurrent branch inventory.

A full-stack, multi-tenant offline-first Point of Sale (POS), inventory ledger, and fiscal compliance platform built for Kenyan hardware depots, wholesale distributors, and rural delivery vans across Django 5, Next.js 15, and Flutter 3.

Architecture & Delivery

Key Architectural Highlights

Built local-first checkout across Next.js IndexedDB and Flutter sqflite using time-ordered RFC 9562 UUIDv7 idempotency keys to commit sales offline and print provisional 80mm thermal receipts immediately.
Engineered deadlock-free batch synchronization in Django using deterministic SKU sorting inside transaction.atomic() before acquiring select_for_update() row locks on BranchInventory.
Designed zero-revenue-loss conflict handling: competing offline oversells commit both paid receipts and raise an auditable StockConflictIncident workflow for Store Managers to reconcile.
Implemented simulated KRA eTIMS OSCU fiscalization across 4 Kenyan VAT tiers (16%, 8%, 0%, Exempt) with HMAC-SHA256 signatures, deterministic QR payloads, and M-Pesa till reconciliation.
Enforced strict multi-tenant SaaS isolation across 5 RBAC roles (OWNER, STORE_MANAGER, CASHIER, VAN_SALES, ACCOUNTANT) with Brevo SMTP OTP verification and an ENABLE_DEMO_LOGIN sandbox toggle.
Deep Dive

Engineering Challenges & Solutions

THE HARD PROBLEM

Retrying flaky HTTP batch syncs can deduct stock twice, while concurrent multi-item baskets updating overlapping SKUs risk PostgreSQL row-lock deadlocks.

THE ARCHITECTURAL SOLUTION

Assigned client-generated UUIDv7 client_tx_id keys checked for idempotency prior to mutation, and sorted all line-item SKUs deterministically before acquiring select_for_update() locks.

Technology Stack

Tools & Technologies Used

Backend & Sync
Django 5.1DRFPostgreSQL 16select_for_update()RFC 9562 UUIDv7
Web POS
Next.js 15React 19TypeScriptTailwind CSS v4IndexedDB
Mobile & Van
Flutter 3DartsqfliteCustomPainter Thermal Receipts
Fiscal & Ops
KRA eTIMS SimM-Pesa Daraja 3.0 SimBrevo SMTPOracle Cloud ARM64
Interface Gallery

Visual Walkthrough & Captures

Offline-First POS Register & Provisional eTIMS Receipt
Offline-First POS Register & Provisional eTIMS Receipt
Offline-First POS Register & Provisional eTIMS Receipt
Inventory Balances, Split-Pane GRN Builder & Stock Ledger
Inventory Balances, Split-Pane GRN Builder & Stock Ledger
Inventory Balances, Split-Pane GRN Builder & Stock Ledger
Multi-Device Offline Stock Conflict Resolution Workbench
Multi-Device Offline Stock Conflict Resolution Workbench
Multi-Device Offline Stock Conflict Resolution Workbench