--- title: "An online store with card checkout, built by Claude Code on Elements" author: "@chris" author_url: https://elements.dev/u/@chris published: 2026-09-30T18:39:09.862Z url: https://elements.dev/demos/an-online-store-with-card-checkout-built-by-claude-code-on-73emab7f kind: post format: article --- # An online store with card checkout, built by Claude Code on Elements by [@chris](https://elements.dev/u/@chris) ยท 2026-09-30 ## Description Coffee by collection with size and grind variants, guest checkout by card, order and shipping emails with tracking, and live stock and sales for the owner. Millrow needed a catalog with size and grind variants, a cart, card checkout, order emails, and stock that updates while people shop. Each of those is a part of Elements, so the agent spent its 29 minutes on the store itself. - **Live stock and orders.** Product variants and orders are LiveTables. An open product page shows "Only 4 left" the moment stock changes, the owner's orders list fills in as orders arrive, and a channel pushes each new sale to the sales dashboard. - **Card checkout.** Checkout prices the cart on the server, holds the stock and sends the shopper to Stripe with the store's own prices. The order is recorded when the shopper returns and again when Stripe's webhook arrives, once either way. Without a Stripe key, the same button opens a test checkout inside the app that pays through the same code, and in production the app registers its own webhook on the first checkout. - **Server calls as function calls.** The cart, order lookup and product editor call server functions straight from the page with `@rpc`, with types checked from the template to the database. - **Background work.** A job sends order confirmations and tracking emails, and a one-line cron schedule returns stock held by unfinished checkouts every five minutes. - **Data from SQL files.** Migrations define the store and seed 12 products with 59 variants and 20 orders. The project server applied each one the moment it was saved. - **Sessions and roles.** Every admin page and server call shares one guard on the signed-in owner's role.