Quick Start
- Include Next.js Storefront (default: yes)
- Optionally load sample data (products, categories, images)
- Optionally start Docker services immediately
Prerequisites
CLI Flags
All prompts can be skipped with flags for non-interactive (CI/CD) usage:| Flag | Description |
|---|---|
--no-storefront | Skip Next.js storefront setup |
--no-sample-data | Skip loading sample products and categories |
--no-start | Don’t start Docker services after scaffolding |
--port <number> | Port for the Spree backend (default: 3000) |
--use-npm | Use npm as package manager |
--use-yarn | Use yarn as package manager |
--use-pnpm | Use pnpm as package manager |
Generated Project Structure
What’s in docker-compose.yml
- Spree — runs the
ghcr.io/spree/spree:latestimage on the configured port (default3000) - PostgreSQL 18 — database with persistent volume
- Redis 7 — caching, background jobs, and Action Cable
- Mailpit — local email inbox at http://localhost:8025
- Health checks on all services
Customizing the Backend
Thebackend/ directory contains a full Rails application with Spree installed (cloned from spree-starter). By default, the project uses a prebuilt Docker image. To switch to building from your local backend:
docker-compose.yml with a version that builds from backend/, rebuilds the image, and restarts services. You can then:
- Add gems to
backend/Gemfile - Override models with decorators in
backend/app/models/ - Add controllers in
backend/app/controllers/ - Configure Spree in
backend/config/initializers/spree.rb - Add migrations with
cd backend && bin/rails generate migration
Spree CLI Commands
The project includes @spree/cli for managing your Spree backend:| Command | Description |
|---|---|
spree dev | Start backend services and stream logs |
spree stop | Stop backend services |
spree update | Pull latest Spree image and restart (runs migrations automatically) |
spree eject | Switch from prebuilt image to building from backend/ |
spree logs | View backend logs |
spree logs worker | View background jobs logs |
spree console | Rails console |
After Setup
Admin Dashboard
Open http://localhost:3000/admin and log in with:spree@example.com | |
| Password | spree123 |
Store API
The REST API is available at http://localhost:3000/api/v3/store. See the API Reference for details.Storefront
If you included the storefront, start it in a separate terminal:Updating Spree
To update to the latest Spree version:SPREE_VERSION_TAG in .env:
Next Steps
Next.js Storefront
Customize and extend the Storefront
Spree SDK
TypeScript SDK for the Store and Admin APIs
API Reference
Explore the REST API endpoints
Core Concepts
Learn about Spree’s architecture

