ENGINEERING

Under the hood

A serverless supply-ordering system running in production for a real franchise supply chain.

One-click order acceptance, step by step

From a store placing an order to HQ and the store receiving the invoice, every step is validated, allocated and written atomically.

Transaction flow

Tap or hover over any node for details.

Three engineering points

Transactional consistency

Stock deduction on acceptance is split across several DynamoDB transactions; a failure midway resumes from the checkpoint without double-deducting, and a failed large receipt rolls back automatically.

Idempotent · resumable · auto-rollback

Testing discipline

Playwright E2E tests hit a real test environment and inject 5xx errors, dropped connections and latency; hundreds of backend Python tests isolate AWS with moto.

Real environment · fault injection

Server-side recalculation

The tenant is taken only from the sign-in token, and totals are recomputed on the server from the catalogue and tax rates, so the client cannot tamper with them.

Zero-trust client

More details

AreaWhat was done
Frontend performance
  • The ~2 MB product catalogue is cached and read on demand
  • Long lists are virtualized (react-window)
  • Module import cycles cut from 743 to 0
Data model
  • Single-table DynamoDB design with a GSI ordering batches by expiry
  • An "allocatable batch" pointer avoids scanning every batch on allocation
  • Batches are identified only by production date + expiry date
Production & migration
  • Live in production, with one production data-model migration completed
  • Process: dry-run → apply → verify
Documentation
  • Every API contract, table shape and technical decision is documented

Tech stack

Frontend

React 18Redux ToolkitMUIReact Routerreact-windowi18next

Backend

AWS AmplifyCognitoAPI GatewayLambda (Python 3.12)DynamoDBS3SES

Quality

Playwrightpytestmoto