# Example store (/docs/getting-started/example-store)

[Photo Studio](https://photo-studio.obelism.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](https://github.com/Obelism/example-shopify-store) is public (MIT), so every step in these docs can be read in working code.

<Cards>
	<Card
		title="Visit the store"
		href="https://photo-studio.obelism.studio"
		description="Photo Studio, live on Vercel"
	/>
	<Card
		title="Read the source"
		href="https://github.com/Obelism/example-shopify-store"
		description="Next.js 16 and Shopify's Hydrogen SDK, with Content, Improve, Numbers and Media"
	/>
</Cards>

## What Content does there [#what-content-does-there]

- **The pages**: home, [About](https://photo-studio.obelism.studio/about) and [Printing](https://photo-studio.obelism.studio/printing) are `page` entries, served at their path.
- **A page per series and per print**: a `seriesPage` picks a Shopify collection and a `printPage` a Shopify product with a [Shopify field](/docs/guides/shopify). 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`, `image` and `quote` blocks, and `featuredSeries` and `featuredPrint`, 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](/docs/guides/ab-tests), the `home-intro` test, written by an editor and decided before the first paint on a prerendered page.
- **Click rates on the canvas**: every block carries its `_uid` as `data-numbers-id`, so Numbers counts its clicks and the [canvas](/docs/guides/canvas#click-rates) shows them on the block.

## Where to look in the code [#where-to-look-in-the-code]

| File | What it shows |
| --- | --- |
| `content/content-model.json` | The [model in Git](/docs/guides/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](/docs/guides/site-editing): sign-in turns on Next's draft mode |
| `app/api/webhooks/content/route.ts` | A [webhook](/docs/guides/webhooks) 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 [#run-it-on-your-own-space]

1. Clone the repository, then `npm install` and `cp .env.example .env.local` (npm 11 and Node.js 26).
2. Create a space and give it the store's model: with a [management token](/docs/guides/api-tokens) in `CONTENT_MANAGEMENT_TOKEN`, `npx content model apply` creates the content types from `content/content-model.json`.
3. Put a delivery token, the space id and the environment in `CONTENT_DELIVERY_TOKEN`, `CONTENT_SPACE_ID` and `CONTENT_ENVIRONMENT`, and the Storefront API credentials of a Shopify store in the `SHOPIFY_*` values.
4. `npm run dev`, then set the environment's **preview URL** to `http://localhost:3000` to edit the pages on the canvas, or sign in on the site at `/cms/login`.
5. Add a webhook to `/api/webhooks/content` with `CONTENT_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.

## The other products on the same store [#the-other-products-on-the-same-store]

- [Improve](https://improve.obelism.studio/docs/examples/example-store) assigns every test before the page paints, in code and in Content's pages.
- [Numbers](https://numbers.obelism.studio/docs/example-store) counts page views, block clicks and the shop's events, through to paid orders.
- [Media](https://media.obelism.studio/docs/shopify) holds the photographs and puts them on the Shopify products with one product rule.
