Hamesu · Multi-Tenant Commerce OS
Multi-tenant commerce operating system turning Iranian Instagram sellers and physical shops into full-stack storefronts with marketplace feeds and Rial accounting.
01 — The Operational Problem & Stakes
An estimated 130,000+ Iranian social sellers (market estimate, Nov 2026) take orders manually inside Instagram DMs via card-to-card screenshots, losing buyers at checkout and failing the technical requirements needed to list on high-intent price-comparison engines like Torob and Emalls.
Meanwhile, jewelry and gold merchants require dynamic real-time gram pricing tied to market rates and Article 26 VAT formulas — capabilities missing from generic store builders.
02 — System Architecture & Execution
Hamesu pairs a Medusa 2.22 headless commerce core and PostgreSQL Row-Level Security (RLS) multi-tenancy with a Next.js 16 storefront (30 routes, instant `/buy/[handle]` DM checkout, 4-step BNPL split) and a 43-route merchant operations console.
Recent engineering slices (`PROMALL-OS-01` & `WEBSITE-V6-AWWWARDS`) eliminated every stub screen in the merchant console — shipping an Instagram caption-to-SKU parser, multi-branch inventory, 7-day RMA returns, a Rial general ledger, signed Torob feeds, 5-role staff RBAC, and a zero-CPU local-to-VPS bundle deployer.
03 — Interactive Subsystem Topology (Click Any Node)
Next.js Multi-Tenant Storefront
Serves custom merchant themes, jewelry/gold dynamic pricing views, `/buy/[handle]` social checkout, and signed Torob/Emalls XML/JSON feeds.
04 — Key Engineering Decisions & Trade-Offs
Self-Hosted Variable Fonts Eliminating Synthetic Bold
A dedicated typography audit (`FONT-AUDIT-v4`) caught browsers synthesizing fake bold weights on Persian headings; switching to self-hosted `Yekan Bakh VF` + `IRANYekanX VF` with `font-synthesis: none` fixed RTL rendering permanently.
Zero-CPU Production Shipping Discipline
Running Next.js/Medusa builds on a shared 4-vCPU box spikes load and starves live traffic; `OPS-DEPLOY-ZERO-CPU-01` builds locally and syncs prebuilt artifacts only when 5-min load is safe.
Solving the Real Wedge: Torob + DM Checkout
Instead of promising 100 imaginary channels, Hamesu nails the exact loop Iranian merchants pay for today: instant DM checkout links, Zarinpal/C2C, and signed Torob price feeds.
108+ Test Suites Across Tenancy & Reconciliation
67.4k+ lines of TypeScript backed by 108 test files covering tenant boundaries, marketplace sync, and Rial fee caps.
05 — Verified Build, Test & Runtime Proof
$ bash scripts/agent/gate.sh (Hamesu main @ 05fa3e17, verified 2026-11-18)
✓ .medusa/server compiled | storefront: 30 routes | console: 43 routes (0 stub pages)
✓ Visual QA Playwright: 26 slices @ 1440px & 390px -> overflowPx: 0, consoleErrors: 0
✓ Live systemd check: hamesu-backend (active) · hamesu-storefront (active) · https://hamesu.ir -> 200