@spree/docs 0.1.129 → 0.1.130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/developer/contributing/developing-spree.md +2 -2
- package/dist/developer/core-concepts/reports.md +1 -1
- package/dist/developer/create-spree-app/quickstart.md +34 -14
- package/dist/developer/dashboard/deployment.md +8 -12
- package/dist/developer/deployment/aws.md +77 -434
- package/dist/developer/deployment/aws_ecs.md +460 -0
- package/dist/developer/deployment/background_jobs.md +106 -0
- package/dist/developer/deployment/caching.md +15 -7
- package/dist/developer/deployment/database.md +4 -4
- package/dist/developer/deployment/docker.md +50 -58
- package/dist/developer/deployment/emails.md +27 -19
- package/dist/developer/deployment/environment_variables.md +33 -21
- package/dist/developer/deployment/quickstart.md +79 -0
- package/dist/developer/deployment/render.md +28 -42
- package/package.json +1 -1
- package/dist/developer/deployment/heroku.md +0 -51
|
@@ -36,7 +36,7 @@ pnpm install # workspace dependencies
|
|
|
36
36
|
pnpm server:setup # ~5–10 min on first run; idempotent
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
`pnpm server:setup` clones [spree-starter](https://github.com/spree/spree-starter) into `./server/`, wires it to load Spree gems from the monorepo via a Docker compose overlay, builds the dev image, starts the stack (Postgres +
|
|
39
|
+
`pnpm server:setup` clones [spree-starter](https://github.com/spree/spree-starter) into `./server/`, wires it to load Spree gems from the monorepo via a Docker compose overlay, builds the dev image, starts the stack (Postgres + Meilisearch + a single Rails `web` container — background jobs run in-process via Solid Queue), and prepares the database. The full sequence lives in `scripts/server-setup.sh`.
|
|
40
40
|
|
|
41
41
|
When it's done, the backend is up at [http://localhost:3000](http://localhost:3000) and the admin is at [http://localhost:3000/admin](http://localhost:3000/admin). Sign in with the seed admin: **`spree@example.com`** / **`spree123`** (override at seed time with `ADMIN_EMAIL` / `ADMIN_PASSWORD` env vars — see `spree/core/app/services/spree/seeds/admin_user.rb`).
|
|
42
42
|
|
|
@@ -95,7 +95,7 @@ If you prefer the fastest possible inner loop and don't mind installing Ruby, Po
|
|
|
95
95
|
pnpm server:create # clones spree-starter, writes server/.env with SPREE_PATH=..
|
|
96
96
|
cd server
|
|
97
97
|
bin/setup # installs Ruby (via mise), Postgres/Redis/Meilisearch (via brew bundle on macOS), gems, prepares the database
|
|
98
|
-
bin/dev # starts Rails
|
|
98
|
+
bin/dev # starts Rails (jobs run in-process) + CSS watchers via Foreman
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
This path is faster per request but means more on your host. It also runs against your installed system services, not a sandboxed Docker stack.
|
|
@@ -187,7 +187,7 @@ Spree::Admin::RuntimeConfig.reports_line_items_limit = 100
|
|
|
187
187
|
By default, report jobs run on the `:default` queue. To route them to a dedicated queue, configure your job processor:
|
|
188
188
|
|
|
189
189
|
```ruby
|
|
190
|
-
#
|
|
190
|
+
# ActiveJob example
|
|
191
191
|
Spree.queues.reports = :reports
|
|
192
192
|
```
|
|
193
193
|
|
|
@@ -16,12 +16,14 @@ The CLI walks you through an interactive setup:
|
|
|
16
16
|
2. Optionally load **sample data** (products, categories, images)
|
|
17
17
|
3. Optionally **start Docker services** immediately
|
|
18
18
|
|
|
19
|
-
Once complete, your store is running at [http://localhost:3000](http://localhost:3000).
|
|
19
|
+
Once complete, your store is running at [http://localhost:3000](http://localhost:3000) — setup pulls the latest Spree image, seeds the database, and configures API keys, then prints a summary with your admin credentials and keys. If you skipped starting services, the first `pnpm dev` completes setup automatically.
|
|
20
|
+
|
|
21
|
+
The **React Dashboard** (Developer Preview of the next-generation admin) is available with the `--react-dashboard` flag, or later via `spree add dashboard`.
|
|
20
22
|
|
|
21
23
|
## Prerequisites
|
|
22
24
|
|
|
23
25
|
- [Node.js](https://nodejs.org/) 20 or later
|
|
24
|
-
- [Docker](https://docs.docker.com/get-docker/) (for running the Spree backend, PostgreSQL,
|
|
26
|
+
- [Docker](https://docs.docker.com/get-docker/) (for running the Spree backend, PostgreSQL, and Meilisearch)
|
|
25
27
|
|
|
26
28
|
## CLI Flags
|
|
27
29
|
|
|
@@ -33,6 +35,7 @@ npx create-spree-app@latest my-store --no-storefront --no-sample-data --no-start
|
|
|
33
35
|
|
|
34
36
|
| Flag | Description |
|
|
35
37
|
|------|-------------|
|
|
38
|
+
| `--react-dashboard` | Include the React Dashboard (Developer Preview — also available later via `spree add dashboard`) |
|
|
36
39
|
| `--no-storefront` | Skip Next.js storefront setup |
|
|
37
40
|
| `--no-sample-data` | Skip loading sample products and categories |
|
|
38
41
|
| `--no-start` | Don't start Docker services after scaffolding |
|
|
@@ -49,35 +52,39 @@ npx create-spree-app@latest my-store --no-storefront --no-sample-data --no-start
|
|
|
49
52
|
|
|
50
53
|
```text
|
|
51
54
|
my-store/
|
|
52
|
-
├── docker-compose.yml # Spree backend (prebuilt image) + Postgres +
|
|
55
|
+
├── docker-compose.yml # Spree backend (prebuilt image) + Postgres + Meilisearch
|
|
53
56
|
├── docker-compose.dev.yml # Alternative: build from local backend/
|
|
54
|
-
├── .
|
|
57
|
+
├── render.yaml # Render Blueprint — one Docker service built from this repo
|
|
58
|
+
├── .env # SECRET_KEY_BASE, SPREE_PORT, SPREE_VERSION_TAG, SPREE_SAMPLE_DATA
|
|
59
|
+
├── .dockerignore # Keeps the production build context to sources
|
|
55
60
|
├── .gitignore
|
|
56
61
|
├── package.json # Convenience scripts
|
|
57
62
|
├── README.md
|
|
58
|
-
├── backend/ # Full Rails app (from spree/spree-starter)
|
|
63
|
+
├── backend/ # Full Rails app — the Spree API (from spree/spree-starter)
|
|
59
64
|
│ ├── Gemfile
|
|
60
|
-
│ ├── Dockerfile
|
|
65
|
+
│ ├── Dockerfile # Also builds the production image (API + dashboard)
|
|
61
66
|
│ ├── config/
|
|
62
67
|
│ ├── app/
|
|
63
68
|
│ └── ...
|
|
64
69
|
└── apps/
|
|
65
|
-
|
|
66
|
-
|
|
70
|
+
├── storefront/ # Next.js storefront (unless --no-storefront)
|
|
71
|
+
│ ├── .env.local # API URL + API key
|
|
72
|
+
│ └── ...
|
|
73
|
+
└── dashboard/ # React Dashboard (with --react-dashboard)
|
|
74
|
+
├── .env.local # Dev proxy target — no credentials
|
|
67
75
|
└── ...
|
|
68
76
|
```
|
|
69
77
|
|
|
70
78
|
### What's in docker-compose.yml
|
|
71
79
|
|
|
72
|
-
- **Spree** — `web`
|
|
80
|
+
- **Spree** — one `web` container running the `ghcr.io/spree/spree:latest` image on the configured port (default `3000`); background jobs run in-process via Solid Queue (stored in Postgres — job dashboard at `/jobs`)
|
|
73
81
|
- **PostgreSQL 18** — database with persistent volume
|
|
74
|
-
- **Redis 7** — caching, background jobs, and Action Cable
|
|
75
82
|
- **Meilisearch** — search engine
|
|
76
|
-
- Health checks on postgres,
|
|
83
|
+
- Health checks on postgres, meilisearch, and web
|
|
77
84
|
|
|
78
|
-
## Customizing the
|
|
85
|
+
## Customizing the Spree API
|
|
79
86
|
|
|
80
|
-
The `backend/` directory
|
|
87
|
+
The `backend/` directory is the Spree API — a full Rails application with Spree installed (cloned from [spree-starter](https://github.com/spree/spree-starter)) serving the Store and Admin APIs your storefront and dashboard talk to, plus background jobs and transactional emails. By default, the project runs it from a prebuilt Docker image. To switch to building from your local copy:
|
|
81
88
|
|
|
82
89
|
```bash
|
|
83
90
|
npx spree eject
|
|
@@ -99,10 +106,12 @@ The project includes [@spree/cli](../cli/quickstart.md) for managing your Spree
|
|
|
99
106
|
|
|
100
107
|
| Command | Description |
|
|
101
108
|
|---------|-------------|
|
|
102
|
-
| `spree dev` | Run the
|
|
109
|
+
| `spree dev` | Run the app in the foreground — streams logs, Ctrl+C stops it. First run completes setup automatically; co-runs the React Dashboard dev server when `apps/dashboard` exists |
|
|
103
110
|
| `spree stop` | Stop backend services |
|
|
104
111
|
| `spree update` | Pull latest Spree image and restart (runs migrations automatically) |
|
|
105
112
|
| `spree eject` | Switch from prebuilt image to building from `backend/` |
|
|
113
|
+
| `spree add dashboard` | Add the React Dashboard to an existing project |
|
|
114
|
+
| `spree build --production` | Build the production image — the Spree API plus your dashboard, in one |
|
|
106
115
|
| `spree logs` | View backend logs |
|
|
107
116
|
| `spree logs worker` | View background jobs logs |
|
|
108
117
|
| `spree console` | Rails console |
|
|
@@ -118,6 +127,8 @@ Open [http://localhost:3000/admin](http://localhost:3000/admin) and log in with:
|
|
|
118
127
|
| **Email** | `spree@example.com` |
|
|
119
128
|
| **Password** | `spree123` |
|
|
120
129
|
|
|
130
|
+
With `--react-dashboard`, the React Dashboard's dev server is the admin instead: `spree dev` starts it alongside the API at [http://localhost:5173](http://localhost:5173) — same credentials, live-reloading from `apps/dashboard/` (the classic admin remains at `/admin`). See the [React Dashboard docs](../dashboard/overview.md).
|
|
131
|
+
|
|
121
132
|
### Store API
|
|
122
133
|
|
|
123
134
|
The REST API is available at [http://localhost:3000/api/v3/store](http://localhost:3000/api/v3/store). See the [API Reference](/api-reference) for details.
|
|
@@ -149,6 +160,15 @@ To pin a specific version, edit `SPREE_VERSION_TAG` in `.env`:
|
|
|
149
160
|
SPREE_VERSION_TAG=5.4
|
|
150
161
|
```
|
|
151
162
|
|
|
163
|
+
## Deployment
|
|
164
|
+
|
|
165
|
+
The project deploys as **one image**: `backend/Dockerfile` builds the Spree API together with your React Dashboard (when `apps/dashboard` exists), served same-origin at `/dashboard` — no CORS, no cookie configuration, no second service.
|
|
166
|
+
|
|
167
|
+
- **Render** — the `render.yaml` at the project root is a ready Blueprint: one Docker service built straight from your repo, migrations run on boot.
|
|
168
|
+
- **Anywhere else** — `spree build --production` builds the same image locally; push it to a registry and run it on any Docker host.
|
|
169
|
+
|
|
170
|
+
See the [Deployment Guide](../deployment.md) and the [dashboard deployment docs](../dashboard/deployment.md).
|
|
171
|
+
|
|
152
172
|
## Next Steps
|
|
153
173
|
|
|
154
174
|
|
|
@@ -22,16 +22,13 @@ The official image contains the *stock* dashboard. Once you've customized yours
|
|
|
22
22
|
spree build --production # optionally --tag registry/repo:tag
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
The
|
|
25
|
+
The Dockerfile normalizes its own build context: built from the project root it detects the layout (`backend/` = the Rails app, `apps/dashboard/` = your dashboard) and builds *your* dashboard into the image — no flags, no named contexts. Without the CLI, the equivalent is:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
docker build
|
|
29
|
-
--build-arg DASHBOARD_SOURCE=custom \
|
|
30
|
-
--build-context dashboard-src=./apps/dashboard \
|
|
31
|
-
-t my-shop-spree:latest
|
|
28
|
+
docker build . -f backend/Dockerfile -t my-shop-spree:latest
|
|
32
29
|
```
|
|
33
30
|
|
|
34
|
-
Inside the stage the build runs with `VITE_BASE_PATH=/dashboard/` (asset URLs resolve under the mount) and `VITE_SPREE_API_URL` unset (API calls stay origin-relative). Projects **without** `apps/dashboard/`
|
|
31
|
+
Inside the dashboard stage the build runs with `VITE_BASE_PATH=/dashboard/` (asset URLs resolve under the mount) and `VITE_SPREE_API_URL` unset (API calls stay origin-relative); the Node toolchain lives only in that throw-away stage. Projects **without** `apps/dashboard/` get the stock dashboard baked instead — and if your `backend/Dockerfile` predates this layout support, the command warns instead of silently shipping the stock dashboard over your customized one (update it from the spree-starter template).
|
|
35
32
|
|
|
36
33
|
## Static host / CDN — the alternative
|
|
37
34
|
|
|
@@ -52,16 +49,15 @@ A middle ground also works: serve `dist/` and proxy `/api/*` + `/rails/*` to Rai
|
|
|
52
49
|
|
|
53
50
|
## Render
|
|
54
51
|
|
|
55
|
-
|
|
52
|
+
The Blueprint that `create-spree-app` places at the project root deploys the backend as a **Docker service** built from your repo — the same Dockerfile as everywhere else, with the repo root as context:
|
|
56
53
|
|
|
57
54
|
```yaml
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
value: ../apps/dashboard/dist
|
|
55
|
+
runtime: docker
|
|
56
|
+
dockerfilePath: ./backend/Dockerfile
|
|
57
|
+
dockerContext: .
|
|
62
58
|
```
|
|
63
59
|
|
|
64
|
-
That's the whole setup — one service, one origin, **your customized dashboard** (it builds from your `apps/dashboard`, not the stock bundle) at `https://your-service.onrender.com/dashboard`. No `VITE_SPREE_API_URL`, no Allowed Origins entry, no extra service. Redeploys rebuild on every push.
|
|
60
|
+
That's the whole setup — one service, one origin, **your customized dashboard** (it builds from your `apps/dashboard`, not the stock bundle) at `https://your-service.onrender.com/dashboard`. No `VITE_SPREE_API_URL`, no Allowed Origins entry, no extra service, no build commands to maintain — migrations run from the image entrypoint on boot. Redeploys rebuild on every push, and what Render builds is byte-for-byte what `spree build --production` builds locally.
|
|
65
61
|
|
|
66
62
|
If you prefer the dashboard on Render's CDN instead, add a static-site service by hand using the cross-origin recipe above.
|
|
67
63
|
|