Forking the Starter
The recommended approach is to fork the repository so you can customize freely while pulling upstream updates.1. Fork on GitHub
Go to github.com/spree/storefront and click Fork.2. Clone Your Fork
3. Add Upstream Remote
4. Pull Upstream Updates
When the official starter gets updates, pull them into your fork:Styling
The storefront uses Tailwind CSS 4, which replaces the traditionaltailwind.config.ts with CSS-native configuration via the @theme directive in src/app/globals.css.
Theme Customization
Edit the@theme inline block in src/app/globals.css to change colors, fonts, and other design tokens:
@theme inline become Tailwind utilities automatically — for example, --color-primary-500 maps to bg-primary-500, text-primary-500, etc.
Components
All components live insrc/components/ and can be customized or replaced:
Data Layer
To customize API behavior, modify the server actions insrc/lib/data/. Each file handles a specific domain:
| File | Purpose |
|---|---|
products.ts | Product listing and detail queries |
cart.ts | Cart operations (add, update, remove) |
checkout.ts | Checkout flow (addresses, shipping, completion) |
customer.ts | Authentication and profile management |
addresses.ts | Address CRUD |
orders.ts | Order history |
payment.ts | Payment sessions and processing |
taxonomies.ts | Categories and taxons |
countries.ts | Country and region data |
cookies.ts | Auth check helper |
store.ts | Store configuration |
credit-cards.ts | Saved payment methods |
gift-cards.ts | Gift card management |
utils.ts | Shared helpers (error handling, fallbacks) |
@spree/next package functions. You can add custom logic, caching strategies, or additional transformations as needed.
Adding New Pages
Follow the existing App Router pattern with localized routes. Place pages under the(storefront) route group to inherit the shared header/footer layout:
Building a Custom Storefront
If you prefer to build from scratch instead of forking the starter, you can use the@spree/next and @spree/sdk packages directly in any Next.js application. See the @spree/next Package documentation for the complete API reference.
