Getting started
Example store
Photo Studio, a live Shopify print shop on Next.js that reads every page from Content: the model in Git, drafts on the canvas, editing on the site, webhooks and A/B tests in its pages. With its source.
Photo Studio is a print shop for a fictional photographer: six series of photographs, each print in several sizes, papers and frames. Shopify sells the prints; Content holds every page around them and the story behind each series and print. It is a real, running storefront, and its source is public (MIT), so every step in these docs can be read in working code.
Visit the store
Photo Studio, live on Vercel
Read the source
Next.js 16 and Shopify's Hydrogen SDK, with Content, Improve, Numbers and Media
What Content does there
- The pages: home, About and Printing are
pageentries, served at their path. - A page per series and per print: a
seriesPagepicks a Shopify collection and aprintPagea Shopify product with a Shopify field. The store's collection and product routes look up the entry by that field and render its story under Shopify's title, price and variants. - Blocks that mix both:
intro,text,imageandquoteblocks, andfeaturedSeriesandfeaturedPrint, where an editor picks collections or a product and the site fills in the live image and price from Shopify. - A/B tests in the content: the home page's intro is an improve block, the
home-introtest, written by an editor and decided before the first paint on a prerendered page. - Click rates on the canvas: every block carries its
_uidasdata-numbers-id, so Numbers counts its clicks and the canvas shows them on the block.
Where to look in the code
| File | What it shows |
|---|---|
content/content-model.json | The model in Git; content/content-types.ts is generated from it with npx content types |
.github/workflows/content-model.yml | Plans model changes on a pull request and applies them to develop on merge |
lib/cms/server.ts | Published reads in Next's cache under one cms tag, a series or print page found by its Shopify field, and drafts only with an editor's own token |
components/cms/cms-entry.tsx | The published entry in the static shell; a draft swaps in only for a request that carries an editor's token |
components/cms/cms-body-client.tsx | The block renderer: useLiveEntry and editable for the canvas, the improve block, click tracking per block |
components/cms/cms-body.tsx | Reads the Shopify products and collections featured blocks need on the server |
components/cms/cms-bridge.tsx | ContentBridge, which lets the canvas follow and edit the page |
app/cms/[...path]/route.ts | Editing on the site: sign-in turns on Next's draft mode |
app/api/webhooks/content/route.ts | A webhook that expires the cms tag, so a publish shows at once |
next.config.ts | frame-ancestors allows content.obelism.studio, so the canvas can show the site |
Its AGENTS.md describes the same split for coding agents: which product owns which part of the store, and the rules each part keeps.
Run it on your own space
- Clone the repository, then
npm installandcp .env.example .env.local(npm 11 and Node.js 26). - Create a space and give it the store's model: with a management token in
CONTENT_MANAGEMENT_TOKEN,npx content model applycreates the content types fromcontent/content-model.json. - Put a delivery token, the space id and the environment in
CONTENT_DELIVERY_TOKEN,CONTENT_SPACE_IDandCONTENT_ENVIRONMENT, and the Storefront API credentials of a Shopify store in theSHOPIFY_*values. npm run dev, then set the environment's preview URL tohttp://localhost:3000to edit the pages on the canvas, or sign in on the site at/cms/login.- Add a webhook to
/api/webhooks/contentwithCONTENT_WEBHOOK_SECRET, so publishing refreshes the deployed site.
The README has the rest: seeding the Shopify catalog, and the values that turn Numbers and Improve on.