Routes
Every URL in the storefront mapped to its source file and purpose.
Pages
| Route | File | Description |
|---|---|---|
/ | app/page.tsx | Home page with hero, featured products, info section |
/products/[handle] | app/products/[handle]/page.tsx | Product detail page (default variant) |
/products/[handle]/[variantId] | app/products/[handle]/[variantId]/page.tsx | Product detail page (specific variant) |
/collections/[handle] | app/collections/[handle]/page.tsx | Collection listing with filters, sort, pagination |
/search | app/search/page.tsx | Search results (same grid as collections) |
/cart | app/cart/page.tsx | Full cart page with upsells |
/pages/[slug] | app/pages/[slug]/page.tsx | CMS-driven marketing pages |
/about | app/about/page.tsx | About page |
API routes
| Route | File | Description |
|---|---|---|
POST /api/webhooks/shopify | app/api/webhooks/shopify/route.ts | Shopify webhook handler for cache invalidation |
POST /api/chat | app/api/chat/route.ts | AI shopping assistant endpoint |
GET /api/draft | app/api/draft/route.ts | Draft mode toggle for content preview |
URL rewrites
The following rewrite in next.config.ts enables variant selection via query parameters:
| Source | Destination | Purpose |
|---|---|---|
/products/:handle?variantId=:variantId | /products/:handle/:variantId | Maps variant query param to route segment |