Public
Starter website clone
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

πŸ›οΈ Nimbus Store

A fully functional product-selling website with a shopping cart, checkout, order storage, and Stripe payments β€” built on Val Town.

Features

  • Product catalog seeded into SQLite (8 demo products, easy to edit)
  • Shopping cart with quantities, persisted in the browser (localStorage)
  • Checkout with shipping/contact form and live order summary
  • Payments in two modes (auto-detected):
    • πŸ§ͺ Demo mode (default) β€” simulated instant payment, works out of the box
    • πŸ”’ Live Stripe mode β€” real card payments via Stripe Checkout, enabled the moment you set STRIPE_SECRET_KEY
  • Orders persisted to SQLite with line items, total, and status
  • Confirmation page that reads the order back from the server

Architecture

Rendering mermaid diagram...
  • main.ts β€” entry point, re-exports the backend
  • backend/index.ts β€” Hono app: API routes + serves the SPA
  • backend/db.ts β€” SQLite schema, product seed, order storage
  • backend/payments.ts β€” Stripe Checkout session helper
  • frontend/ β€” React UI (Catalog, Cart, Checkout, Success) styled with Twind/Tailwind

Going live with real payments

  1. Create a Stripe account and grab your Secret key from https://dashboard.stripe.com/apikeys (use a sk_test_... key to test first).

  2. Add it as an environment variable named STRIPE_SECRET_KEY:

    πŸ‘‰ Add STRIPE_SECRET_KEY here: https://www.val.town/x/vegita/ugtest-clone/environment-variables?key=STRIPE_SECRET_KEY

  3. That's it β€” the checkout automatically switches from demo mode to real Stripe Checkout. Use Stripe's test card 4242 4242 4242 4242, any future expiry, any CVC.

Editing products

Products live in the SEED_PRODUCTS array in backend/db.ts. To re-seed after changing them, bump the _v1 table-name suffix at the top of that file.