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.
A fully functional product-selling website with a shopping cart, checkout, order storage, and Stripe payments β built on Val Town.
- 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
Rendering mermaid diagram...
main.tsβ entry point, re-exports the backendbackend/index.tsβ Hono app: API routes + serves the SPAbackend/db.tsβ SQLite schema, product seed, order storagebackend/payments.tsβ Stripe Checkout session helperfrontend/β React UI (Catalog, Cart, Checkout, Success) styled with Twind/Tailwind
-
Create a Stripe account and grab your Secret key from https://dashboard.stripe.com/apikeys (use a
sk_test_...key to test first). -
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
-
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.
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.