Modelling the physical world
A pallet is a real object that moves through factories, containers, and ships. Explicit status machines with guarded transitions (a container can't dispatch before it's loaded) kept the data honest against reality.
Case study · 2025 · Live in production
A two-country supply-chain platform for a ceramic tile exporter — factory QC in India to customer delivery in Dubai, one traceable pipeline.
Role
Freelance fullstack engineer
Type
Client project · Supply-chain platform
Year
2025
Links

India operations portal — role-scoped login
Overview
Meganea imports ceramic tiles manufactured in India and sells them from Dubai. The physical pipeline — factory, quality check, pallets, containers, sea freight, warehouse, customer — existed only in WhatsApp threads and spreadsheets split across two countries.
I built their whole digital operation: two role-scoped React apps (India operations, Dubai sales) on one Express/MongoDB API, so a tile can be traced from the factory that fired it to the customer who bought it.
49K
Lines of code
3
Apps — India, Dubai, API
19
API resource modules
6
User roles
Stock in this business isn't one number — a tile design can be available in Dubai, booked by a customer, being restocked, sitting in a factory, or on the water. Decisions like 'can I promise this order?' need all five buckets, per design, in real time.
And the two sides work differently: India thinks in purchase orders, QC passes, pallets and containers; Dubai thinks in bookings, LPOs, and deliveries. One interface for both would have served neither.
One API, two tailored frontends, and a status machine for every physical object in the pipeline:
Factories, purchase orders with embedded QC history, a Draft→Manufacturing→QC→Packing status machine
Pallets and khatlis as trackable units, loading plans, container lifecycle from Empty to Delivered
Customer companies, salesman bookings with LPO numbers, partial dispatches with proof images
Dubai raises restock requests that become India purchase orders, with per-item transit tracking
Activity logs for every create/update/status change, reconciliation module, role-based access for 6 roles
Dashboards with charts per country, Excel and PDF exports
Each tile tracks available / booked / restocking / in-factory / in-transit quantities separately, so both countries see truthful availability instead of one misleading total.
Archived records keep who/when/why, query hooks hide them everywhere automatically, and partial unique indexes let names be reused after archival — no orphaned constraints.
PO-00042 style sequential IDs generated atomically from a counter collection, for every entity staff reference on calls between countries.
QC results, arrival events, and status changes live as embedded sub-documents with timestamps and actors — every object carries its own audit trail.
A pallet is a real object that moves through factories, containers, and ships. Explicit status machines with guarded transitions (a container can't dispatch before it's loaded) kept the data honest against reality.
India and Dubai needed different pages, roles, and vocabulary over the same entities. A shared API with role-scoped routes and two purpose-built React apps beat one bloated interface.
Nineteen resource modules, six roles, and ~49K lines delivered solo — surviving that meant consistent patterns (controller/model/route layering, one soft-delete recipe, one ID generator) applied everywhere.
Meganea's India and Dubai teams now run procurement, shipping, and sales on the platform, with every physical movement recorded and auditable. Restock decisions that needed phone calls across a 1.5-hour time difference are now a dashboard glance.
It's the largest system I've shipped solo — and the project that taught me that supply-chain software is really a truthfulness problem: the database must never claim something the warehouse can't confirm.
What's next