Workmoethuzar
Moethuzar
A fashion store built as a modular monolith: a calm storefront on top, dependable checkout, admin and async workflows underneath.
The engineering, in short
- Idempotent checkout: one transaction, one order, however many times the button is pressed
- Transactional outbox and an idempotent projector keep the wishlist replayable
- Variant-level inventory and price snapshots on every order
- A modular monolith: thin routes, use-case services, pure domain rules
Next.js, TypeScript, Prisma, PostgreSQL, Supabase Auth, Cloudflare R2, Upstash QStash, Vitest

The problem
Moe Thuzar needed more than a storefront. The shop had to handle variants, stock, promotions, guest and signed-in customers, local payment rules and order tracking, and the team needed tools to run all of it.
Payments in Myanmar are often manual: Yangon customers pay cash on delivery, others transfer money and upload proof. Checkout had to respect both.

How it is organised
I built it as a domain-oriented modular monolith. API routes stay thin: parsing, auth, validation, error mapping. Services own the use cases and the transactions. Domain modules hold pure rules. Repositories appear only where a query earned one.
Inventory lives at the variant level, which is where it belongs for clothing: size and colour change what is in stock.
- Catalogue, products, variants, images
- Cart and checkout
- Orders and order history
- Promotions and discount rules
- Shipping rules and transfer methods
- Inventory logs
- Wishlist write model, read model and outbox

Checkout without duplicates
Checkout validates the cart, confirms stock, resolves shipping, applies promotions, chooses the payment policy for the zone and creates the order inside one transaction. An idempotency key means a retry or a double tap cannot create a second order.
Prices are snapshotted on the order, so a later price change never rewrites what someone paid.

A wishlist you can replay
Wishlist writes update the canonical table and record an outbox event in the same transaction. QStash delivers the event to a projector that updates the read model, and the projector is idempotent. If delivery fails, the view can be rebuilt from the source of truth.
Admin as a product
Staff manage the catalogue, variants, stock, promotions, transfer methods and orders in an admin that got the same care as the storefront. Rate limiting, request IDs and structured error envelopes keep the system observable.