All workIn production

Case file

Way2Myanmar

A multi-tenant logistics platform for a franchise network, and the ERP that is replacing its back office.

Client
Way2Myanmar
My role
Independent developer, design to operations
Period
2023 – present
Node.jsExpressMongoDBReact 18Socket.IOPWANestJSPrismaPostgreSQL 16DockerGitHub Actions

In one paragraphFor engineersFor hiring managersThe short version

Way2Myanmar's franchise network takes orders, clears customs, invoices customers, and settles with franchisees on a platform I built and run. I am now moving its accounting and inventory onto a proper ERP, test-first, without interrupting the business.A tenant-scoped Express and MongoDB platform with per-tenant module entitlements, a franchise settlement ledger with atomic running balances, and tenant-isolated Socket.IO rooms for realtime. Its successor, W2M ERP, is NestJS on PostgreSQL with a single-writer double-entry posting engine, a FIFO cost-layer inventory ledger, multi-currency AR/AP, and a per-domain migration CLI from the old data.Way2Myanmar's franchise network takes orders, clears customs, invoices customers, and settles with franchisees on a platform I built and run. I am now moving its accounting and inventory onto a proper ERP, test-first, without interrupting the business.Shipping between Thailand and Myanmar involves a lot of people who need to see the same order at the same time, in three languages. This is the system that lets them, and the story of what it grew into.

Choose a lens in the header to reorder this page for your reading.Engineer lens: the engineering story comes before the outcome.Hiring lens: the outcome comes right after the problem; the engineering story follows.Curious lens: the story first, the engineering detail last.

Situation

The problem

Way2Myanmar moves cargo between Thailand and Myanmar through a network of franchisees. The business is more than shipping: there are order cutoffs, customs clearance, invoicing, deposits and outstanding balances, warehouse trading, and a buy-on-behalf service where staff shop for customers who cannot buy across the border themselves. Every franchisee needs to see their own orders and customers, and only theirs, while head office needs to see all of it and settle money with each of them.

Before the platform, that meant scattered information and a lot of messaging. The requirement was a single system where each franchise runs its own operation, head office keeps the books straight, and customers can see where their cargo is, in English, Burmese, or Thai.

Delivery

What I built

The platform (in production). An Express and MongoDB application with a React front end, delivered as a trilingual PWA with push notifications to a companion mobile app, plus the public website and a customer dashboard.

  • Multi-tenant franchise architecture: a tenant-scoped data layer, per-tenant module entitlements, and a franchise settlement ledger with atomic running balances.
  • Orders, cutoffs, customs clearance, invoicing, warehouse trading, and the buy-on-behalf shopper service.
  • Realtime presence and notifications over tenant-isolated Socket.IO rooms.
  • A granular role and permission system; customer deposits, outstanding balances, and daily and monthly financial reports.

W2M ERP (in development). A greenfield replacement for the back office: freight, buy-on-behalf sourcing, warehouse trading, customs duty, and inter-company settlement, multi-currency from day one.

  • NestJS and Prisma on PostgreSQL 16, a 93-model schema, in a pnpm monorepo with Docker and a CI pipeline that runs migrations, lint, and tests on every push.
  • A double-entry posting engine as the only writer of journal entries, with balanced-entry and period-lock enforcement, built spec-first and test-first with Jest and Supertest.
  • A FIFO cost-layer inventory ledger with immutable stock moves, and purchasing from purchase order to receipt to GRNI to automatic billing.
  • Multi-currency AR and AP with automatic FX gain and loss on settlement, bank statement reconciliation, and P&L, balance sheet, and trial balance.
  • A migration CLI from the legacy MongoDB data with per-domain importers and verification, and a customer self-service portal.
93
models in the ERP schema
3
languages, every screen
Under the hood

The engineering story

Tenancy is in the data layer, not in the controllers. Every query on the platform is tenant-scoped at the data layer, so a franchise cannot reach another franchise's data by accident, and a new feature does not have to remember to filter. Module entitlements are per tenant, so head office can switch capabilities on for one franchisee without touching the others.

Settlement is a ledger, not a report. Money between head office and franchisees is tracked in a settlement ledger with atomic running balances, so the balance is always what the ledger says, and there is no end-of-month reconstruction from invoices.

Realtime that respects tenancy. Presence and notifications run over Socket.IO rooms isolated per tenant, so a franchise sees its own team's activity and nothing else.

The ERP: one writer for the ledger. In W2M ERP, only the posting engine writes journal entries. Every entry must balance, and posting into a locked period is refused. That rule is written as a spec and tested before the feature that depends on it exists, with Jest and Supertest against the running API.

Inventory with a cost history. Stock is a FIFO cost-layer ledger with immutable stock moves, so cost of goods is calculated from what was actually bought, and nothing about the past can be edited into a different number.

Moving the data. The legacy MongoDB data moves through a migration CLI with an importer per domain and a verification step, so the switch can be rehearsed and checked before it is real.

Impact

What it changed

The platform is in production at waytomyanmar.com, and it is how the franchise network runs its day: orders, cutoffs, customs, invoicing, deposits, and settlement, with staff and customers working in the language they prefer.

The ERP is the next step, and its purpose is a business outcome, not a technical one: books that are correct by construction, inventory cost that comes from real purchases, and multi-currency settlement that does not need a spreadsheet next to it.