← things I ship
CLIENTFull-stack developer · client projectLIVE · PREVIEW

Charming Stones.

A full online jewelry store: catalogue, bag, Stripe checkout, shipping labels, order emails and tracking, with the owner running it all from one Sanity Studio.

TECH USED
Next.jsSanityStripeShippoResendVercel
Charming Stones home page with a hero photo of gold jewelry and the headline Jewelry that looks the part
01HomeHero on the live storefront
Charming Stones shop page with category pills, finish and price filters and product cards
02ShopCategory pills, finish and price filters, product grid
Charming Stones quick view dialog for Luna Pearl Drops with finish swatches and an add to bag button
03Quick viewProduct details and add to bag without leaving the shop
Charming Stones bag drawer with one item, a free shipping progress bar, subtotal and a checkout button
04Bag drawerFree-shipping progress and subtotal; checkout hands off to Stripe
Charming Stones shop on a phone with two product columns
05Mobile shopTwo product columns on phones
01 / 05scroll →swipe →
demo
Space or K play and pause, M mute, F fullscreen, arrow keys seek 5 seconds
0:00 / 0:00
the full path

From problem to what's next.

In the order it actually happened. Use the route to jump around.

01THE PROBLEM

A small jewelry boutique needed a complete store, from catalogue to checkout, payment, shipping and order tracking, run from one place at the lowest running cost.

02THE SOLUTION

A Next.js storefront on Vercel with Sanity as the only datastore and an embedded Studio. Stripe Checkout takes payment and holds it until stock is reserved, Shippo buys USPS labels and tracks parcels, and Resend sends order email. Only a signed Stripe webhook creates an order.

WHAT I BUILT
  1. 01Built the storefront: filtered shop with cursor pagination, product variants, wishlist, a server-priced bag and order tracking by order number.
  2. 02Built checkout on Stripe Checkout with held payments and Stripe Tax, flat or free shipping, and a signed webhook that creates the order.
  3. 03Wrote the order logic: stock reservation, capture or release, USPS labels and address checks through Shippo, and transactional order emails.
  4. 04Modelled catalogue, orders and content in Sanity, with Studio actions to buy and print labels, edit addresses and add order notes.
03HOW IT'S BUILT

The system, end to end.

SHOPPER PATH
  1. STEP 01StorefrontNext.js 16 on Vercel
  2. STEP 02Bagbrowser keeps variant and quantity only
  3. STEP 03Server pricingre-reads price and stock from Sanity
  4. STEP 04Stripe Checkouthosted page · payment held, not captured
ORDER PATH
  1. STEP 01Stripe webhookcheckout.session.completed · signed
  2. STEP 02Order + stockone Sanity transaction, revision locks
  3. STEP 03Capture or releasecapture the hold, or cancel if sold out
  4. STEP 04Label + trackingbought in Studio · Shippo webhook
  5. STEP 05EmailsResend · each sent at most once
OWNER PATH
  1. STEP 01Sanity Studioembedded at /studio
  2. STEP 02Content webhooksigned · invalidates one cache tag
  3. STEP 03Remote cacheuse cache: remote · all instances
  4. STEP 04Storefrontstock changes show in seconds
01Held paymentsCheckout uses manual capture. The webhook reserves stock first, then captures. If the last piece sold out, the hold is cancelled and nobody is charged.
02Order and stock, one writeCreating the order and decrementing stock is one Sanity transaction with revision locks. A 409 re-reads: the order exists, or a product changed and it retries up to 5 times.
03Resumable webhookEach delivery re-reads the order and the live PaymentIntent and does only the missing steps. Capture, cancel and refund carry idempotency keys; emails use marker events.
04Private data, public datasetOrders, subscribers and messages use dot-path IDs, which Sanity keeps private in a public dataset. A test checks an anonymous query returns nothing.
04WHAT BROKE,
AND THE FIX

FIX →Split into two patches in one atomic transaction. Only the integration test against the real service caught it.

FIX →A signed content webhook invalidates a global cache tag and reads moved to use cache: remote. Stock now shows in 3 to 4 seconds.

FIX →Orders are read-only with one append-only Add note action, so no draft exists and payment data comes only from Stripe and Shippo.

FIX →The webhook verifies the address at order time, fail-open: bad ones are flagged for the owner, never cancelled, and a Shippo outage cannot lose a sale.
05WHERE IT IS NOW
  1. IDEA
  2. BUILDING
  3. LIVE

Live as a preview on Vercel with a seeded placeholder catalogue; a check blocks seed data from shipping. 289 unit tests pass, plus integration tests against test-mode Stripe, Shippo and Sanity.

06NEXT STOPS

The road keeps going.

  1. STOP +1Add a timeout and purchase lookup so a retried label purchase cannot buy a second label
  2. STOP +2Reconcile orders when Stripe stops retrying after a capture whose order update failed
  3. STOP +3Move side jobs out of the webhook onto a durable queue