Start from ForkMe
ForkMe is the template built for this. Create a storefront from it under Store → Storefronts → Advanced, then pull it:What you keep
What you write
- The look:
src/theme/tokens.css. Colours, type, radius, shadows, spacing. In ForkMe every Tailwind colour, font, size and radius utility maps to a token here, so a section cannot reach for a value outside the system. - The shell: header, footer, page shell under
src/components/layout/. - The home page: sections under
src/sections/, one file each, registered insrc/sections/index.tsx. - The pages: one file per route under
src/pages/. Keep the routes the platform links to:
- The content contract:
src/config/content-defaults.jsonis what a merchant edits in the Design tab;content-schema.jsonturns enums and bounds into pickers;site-config.tsparses both strictly. Every element that renders a content value carriesdata-sx-config="<dotted.path>".
How the data arrives
Nothing in a code storefront fetches the catalog. The edge injectswindow.__SHOPPEX_INITIAL__ (shop, products, groups, categories, settings, the merchant’s saved content) and the SDK bootstrap globals before the bundle runs, then the SDK on window.shoppex handles the live parts: cart, quotes, checkout, reviews, menus, pages, the account. readStorefrontData() from @shoppexio/storefront-react parses the payload once, strictly; a field that is missing throws instead of rendering a half shop. Code storefront development lists the globals.
The rules that are not yours to change
package.jsonand the lockfile are fixed at build time; the build reinstalls them in a sandbox with no network. Add nothing you cannot ship inside the artifact.- The SDK stays a
<script>inindex.html. vite.config.tskeepsbase: './'.- Reach the SDK through
getShoppex()from the package, notwindow.shoppexdirectly: its first call captures the affiliate code from the URL, or affiliates stop earning. - A new enum in a parser goes into
content-schema.jsonin the same change, or a merchant can save a value that takes the storefront down. - No placeholder data. A section with nothing real renders nothing.
Prove it works
When the commerce layer changes
ForkMe pins@shoppexio/storefront-react to an exact version, so nothing changes under you. To take a platform change, raise the version in package.json, run bun install, read the package’s CHANGELOG.md, and run the typecheck and tests before you push. If you ejected the account, port account changes by hand.