What you’ll build
- A
Spree::Brandmodel with a Store API and an Admin API — one generator command - A brands screen in the dashboard: a list page, navigation and a card on the product page
- Brands on the storefront, fetched through
@spree/sdkwith generated types - Lifecycle events other systems subscribe to, in the app or over webhooks
- Specs for the model and both APIs, plus an end-to-end pass
The five steps
1. Models & API
Generate the model, migration, Store and Admin controllers, serializers and routes in one command
2. Dashboard
Scaffold the back-office UI with the CLI — a table, a form, navigation and a product slot
3. Storefront
Regenerate SDK types and render brands on the product page in the Next.js storefront
4. Events
Publish lifecycle events and consume them with subscribers and outbound webhooks
5. Testing
Model and request specs, dashboard plugin tests, and one end-to-end check
Before you start
You need a running Spree application. The fastest path is create-spree-app, a Docker-based project with the Spree CLI and nothing to install locally:spree CLI. Nothing needs installing on your machine — the CLI routes each command into the right container.
The project it creates has this shape, and the paths in every chapter are relative to its root:
create-spree-app projects: run
spree eject once before starting. Fresh projects use a prebuilt Docker image; ejecting switches to the development setup that mounts your app into the container, so the files the generators create land in your project and reload as you edit them.
