Search Documentation
Search for a documentation page...
Storefront Overview
The YNS storefront template is a production-ready Next.js app for building your online store.
What is the Storefront?
The YNS storefront is an open-source Next.js application that serves as the customer-facing frontend for your store. It connects to the YNS platform via the Commerce SDK and provides:
- Product listing and detail pages
- Shopping cart with real-time updates
- Checkout powered by Stripe
- Collection and search pages
- Newsletter subscription
- Legal pages
Architecture
The storefront is built with modern React patterns:
Server Components
All data fetching happens in React Server Components. Pages use async components that fetch data directly from the YNS API:
Cart Management
The cart uses a combination of React Context (for client-side state) and Server Actions (for mutations):
cart-context.tsx— client-side cart statecart-sidebar.tsx— cart UI componentactions.ts— Server Actions for add/remove/update
Tech Stack
- Next.js 16 (canary) with App Router
- React 19 with Server Components
- TypeScript with strict mode
- Tailwind CSS v4 for styling
- Commerce SDK for API access
- Radix UI + shadcn/ui for components
- Biome for linting and formatting