An online store with card checkout, built by Claude Code on Elements An online store with card checkout, built by Claude Code on Elements

An online store with card checkout, built by Claude Code on Elements

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.

View the code on GitHub →

How it's built

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.

Why Elements

Elements is the integrated stack for web apps: a build server and tooling, an app framework, a Postgres database and deployment, engineered as one system. Your editor, tools and one or many agents all connect to the same always-on build server, which runs type checking, program analysis, migrations and tests as the agent builds. Built-in guardrails keep the app structured correctly and secure as it grows from prototype to production.

Run it yourself

Install Elements

  1. Copy the install command.

    curl -fsSL https://elements.dev/install | sh
    View script
  2. Open a terminal in VS Code: choose Terminal › New Terminal from the menu bar at the top of your screen.

  3. Copy and paste the command into the terminal and press Enter.

    VS Code
    The install command pasted into the VS Code terminal The install command pasted into the VS Code terminalcurl -fsSL https://elements.dev/install | sh

Create your copy of this app

  1. When the install finishes, press Shift + Command + P to open the command palette.

  2. Type new app, select Elements: New App in the list and press Enter.

    VS Code
    VS Code's command palette with Elements: New App selected VS Code's command palette with Elements: New App selected
  3. Copy the text.

    VS Code
    millrow -scaffold=elementscode/demo-millrow
  4. Paste the text into the Elements: New App name box and press Enter.

    VS Code
    The name box Elements: New App opens, with this app's name and scaffold typed in The name box Elements: New App opens, with this app's name and scaffold typed inmillrow -scaffold=elementscode/demo-millrow

    Your copy of this app opens in VS Code with a terminal and Claude Code on the left.

Start your app

  1. Copy the command.

    Terminal
    elements start
    
  2. Paste the command into the terminal and press Enter.

    VS Code
    elements start typed into the terminal of the new app elements start typed into the terminal of the new app

    Your app opens in VS Code's browser, next to the terminal and Claude Code.

New to Elements? Read the getting started guide.