Martijn Hoogeveen
01 Software · SW-03

Supplier Order Portal

A bilingual order system shared with my manufacturers in China. Every paid order arrives with finish, address, contact details, pricing and freight method, and is tracked through each production stage.

Ticket
SW-03
Type
Internal tool · Operations
Status
Live
Owner
Martijn Hoogeveen
Started
May 2026

01Problem statement

Made-to-order parts are produced by manufacturers in China. Every order needs a lot of information to reach them correctly: the exact part number, carbon finish, quantity, agreed price, the customer's shipping address and phone number, and whether it ships by sea or air. That lived in chat messages and spreadsheets. There was no shared status, details got lost in translation, and a job could slip for weeks before anyone noticed.

02Goals

In scope

  • Every paid order line reaches the right manufacturer automatically, with everything they need to build and ship it
  • One shared status per order, updated by the factory itself
  • Works in Chinese and English
  • Late jobs are impossible to miss

Out of scope

  • Inventory management
  • Supplier invoicing and payments

03Acceptance criteria

  • A paid order becomes an order card within seconds
  • Each card carries part number, finish, quantity, price, ship-to address, contact number, freight method and notes
  • Part number = variant barcode, falling back to SKU, then name
  • Lines routed to the right manufacturer by vendor and barcode rules
  • Cards move through Order raised → Invoice paid → In production → Shipped → Delivered, each stage dated
  • Freight set to sea or air from the customer's shipping choice, editable per card
  • Shopify retries never create duplicates; deleted cards never come back
  • Works offline and syncs when back online
  • Amber at 30 days in production, late at 35

04Design

  • The Worker verifies the webhook HMAC and looks up part numbers per variant through Admin GraphQL, because order webhooks don't include them
  • Finish comes from the variant, freight from the shipping line ('Express' → air, otherwise sea), address and contact from the order
  • Each line is routed and written to its own KV record; soft deletes are kept for 90 days
  • A static, bilingual web app on GitHub Pages reads and writes through the Worker, one PIN per manufacturer
enrichread / writeShopifypaid orderWorkerHMAC verifyAdmin GraphQLvariant → part no.Routerper line itemOrder cardfinish · price · ship-toFactory Aown PINFactory Bown PINPortalZH / EN · offlineFactory teamupdates stagesOrder raised → Invoice paid → In production → Shipped → Delivered · late at 35 d
Fig. 1 · System architecture
Users
Me + factory teams in China, one portal per manufacturer
Per order
Part number, finish, quantity, price, ship-to address, contact number, freight, notes
Stages
Order raised → Invoice paid → In production → Shipped → Delivered
Freight
Sea or air, set from the customer's shipping choice
Trigger
orders/create webhook, HMAC-verified
Enrichment
Part numbers looked up per variant via Admin GraphQL
Storage
One KV record per order line, soft delete for 90 days
Client
Static web app, Chinese / English, works offline
Access
PIN per manufacturer, IP lockout with push alerts
SLA
Amber at 30 days, late at 35 days in production

05Key decisions

DecisionAlternative consideredWhy
One KV key per cardOne JSON blob per boardThe blob lost updates when a webhook and a person saved at the same time
Counter keys for card numbersCounting with KV list()list() lags behind writes, so it can hand out duplicate numbers
API version pinnedTracking the latest APIThe barcode field is deprecated in the newer version
PIN + IP lockoutUser accountsPartner staff need zero-friction access; lockout and push alerts limit brute force

06Failure modes

RiskMitigation
A board write fails mid-webhookReturn 500 so Shopify retries; both boards dedupe
No barcode found for a lineIt stays on the default board, so a real order is never dropped
Deploy propagationWait ~20 s before backfills that depend on new fields

07Testing & rollout

Testing

  • Local dev with persisted KV and a test webhook secret
  • Real historical orders backfilled through the same path

Rollout

  • First manufacturer portal
  • Cloned for a second manufacturer on shared code and styles

08Outcome

  • Two manufacturer portals live, filled automatically from paid orders
  • No more order details re-typed into chat

09Follow-ups

  • Delivery ETA from the freight type already tagged on each card

Labels

  • Cloudflare Workers
  • Workers KV
  • Admin GraphQL
  • Vanilla JS
  • GitHub Pages
  • Supplier integration
  • Webhooks
  • Eventual consistency
  • Idempotency
  • Offline-first
  • i18n
  • Auth