
Overview
A vertically-integrated B2B commerce engine purpose-built for high-density wholesale operations. Features a server-rendered product catalog with RPC-driven data hydration, a multi-dimensional matrix ordering interface with live tier-arbitraged pricing recalculation, and a dual-serialization checkout pipeline that persists validated order snapshots to a PostgreSQL ledger before dispatching structured payloads via WhatsApp Business API.
The Challenge & Solution
Traditional B2B wholesale relies on WhatsApp screenshots, manual price lookups, and spreadsheet-based order tracking to a workflow that is unauditable, error-prone, and impossible to scale. We engineered a platform where buyers configure complex multi-color, multi-size matrix orders with automatic MOQ enforcement and dynamic tier pricing, while the backend generates cryptographically-referenced order records with dual-immutable cart snapshots, turning chaotic WhatsApp commerce into a structured, verifiable transaction ledger.
Architecture
Next.js 14 App Router with strict RSC/Client Component boundary enforcement, data fetching is exclusively server-side via Supabase RPC functions, while interactive state (cart mutations, matrix quantity commits) is managed through a Zustand persistence layer with surgical hydration. Row-Level Security policies enforce tenant-scoped data access at the database kernel level, not the application layer.
Telemetry & Outcomes
Every order undergoes dual-snapshot immutability: the raw client payload is frozen alongside a server-recalculated validated cart, creating a tamper-evident audit chain. Order lifecycle state transitions are tracked through an enum-driven finite state machine with full timestamp provenance.