Variant qty > 0 in inventory table. Add to cart enabled. Qty selector capped at available stock. On cart validate, re-check before payment intent is created.
✗ Out of Stock
Item unavailable → block + notify
Size/color selector grayed out. "Sold Out" badge shown. Add to Cart disabled. If item sells out mid-session, cart validator catches it and shows inline error before payment.
Recommended Tech Stack
Frontend
React + Next.js (App Router)
Tailwind CSS
Zustand for cart state
React Hook Form + Zod
Backend / API
Next.js API Routes
or Express.js server
Stripe Node SDK
Webhook endpoint (POST)
Database
PostgreSQL (Supabase)
Tables: products, variants,
inventory, orders,
order_items, email_log
Payments
Stripe Payments
Stripe Elements (card UI)
PaymentIntent API
Stripe webhooks
Email
Resend (recommended)
React Email templates
Triggers: order confirm,
shipped, delivered
Inventory Lock
Decrement qty on
payment_intent.succeeded
Restore on intent cancel
or 30-min session timeout
Frontend Component
API Endpoint
Database
Business Logic
Email Trigger
REQ
Required
OPT
Optional / Phase 2
FLYINGNAKED.COM — INTERNAL DEV REFERENCE — NOT FOR DISTRIBUTION