> ## Documentation Index
> Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tutorial

> Build a complete custom Brands feature in Spree — model, admin UI, Store and Admin APIs, events, and TypeScript storefront integration — end to end.

This tutorial walks you through creating a complete Spree feature from scratch: a "Brands" feature that lets admins manage [Product](https://spreecommerce.org/docs/v5/developer/core-concepts/products.md) brands, exposes them through the Store API, and consumes them from TypeScript.

It's written for **both backend and frontend developers**. The Ruby you'll write is minimal and mostly generated — Spree's generators produce convention-correct models, admin UIs, and API endpoints, and the TypeScript SDK gives you typed access from your storefront. You don't need to be a Rails expert to follow along.

## Before you start

You need a running Spree app. The fastest path is [create-spree-app](https://spreecommerce.org/docs/v5/developer/create-spree-app/quickstart.md) — a Docker-based project with the [Spree CLI](https://spreecommerce.org/docs/v5/developer/cli/quickstart.md), no local Ruby required:

```bash theme={"theme":"night-owl"}
npx create-spree-app@latest my-store
```

An existing app with Spree gems works just as well. **Every command in this tutorial is shown in two forms** — **Spree CLI** (runs inside Docker) and **Without Spree CLI** (runs directly on your machine) — pick the tab that matches your setup and ignore the other.

> [!NOTE]
>
> **create-spree-app projects:** run `spree eject` once before starting. Fresh projects use a prebuilt Docker image; ejecting switches to the dev setup that mounts `backend/` into the container, so the files the generators create land in your project (and reload live as you edit them).

> [!TIP]
>
> Using an AI coding agent? Install the [Spree agent skills](https://spreecommerce.org/docs/v5/developer/agentic/agent-skills.md) (`npx skills add spree/agent-skills`) and connect the [docs MCP server](https://spreecommerce.org/docs/v5/developer/agentic/mcp) before starting — your agent will know the conventions this tutorial teaches and can follow along with you. See [Agentic Development](https://spreecommerce.org/docs/v5/developer/agentic/overview.md).

## What you'll build

* A `Brand` model with a rich text description and an uploadable logo — one generator command
* An admin UI for managing brands — one generator command, then customized
* A `brand` association on Products, surfaced in the product admin form
* Store API endpoints (`GET /api/v3/store/brands`) with serializers and prefixed IDs
* Typed TypeScript access to brands from your storefront via `@spree/sdk`
* Event subscribers and webhooks connecting the store to external systems
* Automated tests for all of it

## Tutorial Sections

> [card] [1. Model](https://spreecommerce.org/docs/developer/tutorial/model)
>
> Generate the Brand model — columns, rich text description, and logo upload in one command

> [card] [2. Admin Dashboard](https://spreecommerce.org/docs/developer/tutorial/admin.md)
>
> Scaffold the admin UI, then add the description editor, logo upload, and table columns

> [card] [3. Extending Core Models](https://spreecommerce.org/docs/developer/tutorial/extending-models.md)
>
> Connect Brands to Products using a decorator and an association

> [card] [4. API](https://spreecommerce.org/docs/developer/tutorial/api.md)
>
> Expose Brands through the Store and Admin APIs — generated in one command, or hand-built to learn the pieces

> [card] [5. Events & Webhooks](https://spreecommerce.org/docs/developer/tutorial/events.md)
>
> React to store activity and connect external systems — OMS, warehouse, ERP

> [card] [6. SDK](https://spreecommerce.org/docs/developer/tutorial/sdk.md)
>
> Consume Brand endpoints from TypeScript using the SDK

> [card] [7. Testing](https://spreecommerce.org/docs/developer/tutorial/testing.md)
>
> Write automated tests for your feature


## Related topics

- [Extending Core Models](https://spreecommerce.org/docs/v5/developer/tutorial/extending-models.md)
- [SDK](https://spreecommerce.org/docs/v5/developer/tutorial/sdk.md)
- [Testing](https://spreecommerce.org/docs/v5/developer/tutorial/testing.md)
- [Expose a custom model through the Store and Admin APIs](https://spreecommerce.org/docs/v5/developer/tutorial/api.md)
- [Adyen Integration Guide for iOS](https://spreecommerce.org/docs/api-reference/tutorials/adyen-integration-guide-for-ios.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.