StackMoth/Work/Diyon & Co.

Headless commerce

A static gemstone storefront that refuses to publish stale inventory

Public storefront for Sri Lankan sapphire house Diyon & Co., synced directly to its live Etsy shop.

2 hrCI rebuild cycle
5 minAvailability CDN cache
0OAuth write tokens in hosting

Natural sapphires are one-of-one items. Selling a stone twice across two storefronts is worse than showing no catalogue at all.

Engineering notes

Sync, fail-closed builds & ops

01Facts
Client
Diyon & Co. (Sri Lankan gemstones)
Stack
Astro 7, Tailwind 4, TypeScript, Three.js
Sync
Etsy Open API v3 (2-hour CI rebuilds + 5-min availability API)
Operations
Internal bulk-ops & SKU ledger scripts
Hosting
Vercel (static prerender + serverless availability route)
02One source of truth for unique stones

Instead of maintaining a duplicate product database, diyonco.com reads listings straight from the live Etsy shop at build time, prerendering every stone page with Etsy’s own verbatim text, attributes and CDN media while checkout remains on Etsy. Scheduled GitHub Actions rebuilds run every two hours, and an on-demand route (/api/availability.json, cached at the CDN for five minutes with 600-second stale-while-revalidate and build-time fallback on lookup errors) updates badges shortly after a sale.

03Production builds fail closed

Local development reads from a saved public fixture so the site builds offline. In CI and on Vercel, missing Etsy credentials or an upstream API failure aborts the build intentionally — stale or fixture inventory can never overwrite the live deployment.

04Read-only storefront, scripted back-office
  • No OAuth write tokens in web hosting: read-only listing requests use the app key and shared secret (x-api-key: key:secret), keeping shop OAuth write tokens off the public deploy pipeline.
  • Internal Etsy ops toolkit: bulk drafting, publishing, repricing and SKU ledger checks live in a separate internal operations repo rather than inside the storefront.
  • Progressive visual craft: an interactive Three.js gemstone renders only on the homepage with a static stone fallback if WebGL is unavailable, and respects system reduced-motion preferences site-wide.

AI-assisted, human-accountable. AI tools contributed significantly to the implementation described here. The specification, the review of every change, the production operation and the accountability are mine.

Next case study

Ledgerline