Full-stack build · B2B eCommerce · wholesale distribution
Sundor Skin imports authentic skincare — with a deep K-beauty range — and supplies pharmacies, retail shops, salons and online resellers. RAITHub replaced phone-and-WhatsApp ordering with one system: approved buyers see their own wholesale price, order on prepayment or credit, and every step from approval to dispatch is recorded.

The mandate
The brief was to make ordering easier than calling and to let the business run without spreadsheets — while keeping trade prices private, extending credit safely, and proving that every unit is authentic and in date.
Scope · two products
The ordering and distribution system: public catalogue and account application, a buyer portal for approved businesses, and a staff back office for sales, accounts, warehouse and content teams.
The acquisition channel: skincare articles, an ingredient library and concern guides, with scheduled publishing, moderated comments and a double opt-in newsletter. Articles link into the wholesale catalogue and fall back to plain text if it's unreachable.
The build · buyer journey
A business applies from the public site. Nobody sees wholesale prices without an approved account.
Staff review the application and issue a single-use invitation link. Staff can also onboard a buyer directly.
Each buyer sits on a Bronze, Silver, Gold or Platinum tier, with optional per-buyer price overrides.
Orders are re-priced on the server, checked against credit, then allocated by batch — earliest expiry first — and picked, packed and dispatched.
By the numbers
Wholesale portal only, counted from the repository in September 2026. Tests exclude 20 additional SQL assertion suites.
The platform
System architecture
No ORM: typed raw SQL over a schema that owns the rules. Credit checks, pricing and stock allocation run as database functions inside one transaction, so a bug in a screen can't oversell stock or bypass a credit limit. The content site runs on a separate database and cannot reach orders or payments.
Engineering rigor
Every buyer query runs under PostgreSQL row-level security scoped to that buyer. CI fails the build if any buyer-scoped table lacks a policy, and a dedicated IDOR suite tries to read other buyers' data.
An append-only, hash-chained audit log written in the same transaction as the change it records, partitioned by month. Conflicting permissions are declared and enforced in the database, so no single role holds both sides of a sensitive pair.
Money is never a float — amounts are stored as integer poisha. Packing is idempotent, allocation follows batch expiry, and transactions retry on serialisation conflicts instead of failing the order.
argon2 password hashing, per-IP and per-account rate limits with lockout, one generic error with equal work for unknown users, validated redirects, CSRF protection and a per-request CSP nonce.
The takeaway
RAITHub took Sundor Skin from a spec to a live wholesale platform — onboarding, tier pricing, credit, payments, fulfilment and a role-based back office — with a separate content site to bring buyers in.