Sell products online with hosted checkout, taxes, and an order pipeline you can trust during a traffic spike.
Recommended stack
- Next.js - storefront. Static product pages with ISR are fast and cheap; server actions handle cart ops.
- Stripe Checkout + Billing - payments. Hosted checkout offloads PCI, taxes, wallets, and subscription math.
- Supabase Postgres - orders & inventory. Relational orders with RLS so customers see only their own.
- Resend + react-email - transactional email. Order confirmations as version-controlled React templates.
Build steps
- Model products/prices in Stripe as source of truth; mirror to your DB via webhook for querying.
- Cart โ Checkout Session with line items; let Stripe handle taxes and payment methods.
- Treat
checkout.session.completedwebhooks as the only order-creation path (idempotent by event id). - Build order status page keyed by session id; email confirmation on webhook, not on redirect.
- Test the whole flow with Stripe test clocks and the CLI webhook forwarder before launch.
Watch out for
- Creating orders on the redirect page - users close tabs; webhooks are the truth.
- Non-idempotent webhook handlers double-fulfilling on Stripe retries.
- Storing card data anywhere, ever.
Definition of done
- Test-mode purchase โ order row โ confirmation email, end to end
- Webhook replay produces no duplicate orders
- Refund in Stripe reflects in the customer's order page