Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Improve CONTRIBUTING guide even more

Damian Legawieca6661793c164
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 054e941561..228422409e 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -8,6 +8,7 @@ Please read our [Code of Conduct](../CODE_OF_CONDUCT.md) before contributing.
- [Getting Started](#getting-started)
- [Cloning the repository](#cloning-the-repository)
+ - [Prerequisites](#prerequisites)
- [Spree codebase](#spree-codebase)
- [Backend Development (Ruby)](#backend-development-ruby)
- [Engines overview](#engines-overview)
@@ -43,6 +44,12 @@ Spree is a big monorepo. For a faster clone, use a **partial clone** which downl
git clone --filter=blob:none https://github.com/spree/spree.git
```
+### Prerequisites
+
+You need **Node.js 20+** to run the workspace scripts (including `pnpm server:setup`, which both backend and TypeScript contributors use). Install it via [nvm](https://github.com/nvm-sh/nvm), [mise](https://mise.jdx.dev), [fnm](https://github.com/Schniz/fnm), or your package manager (`brew install node` on macOS).
+
+`pnpm` is provisioned automatically via [Corepack](https://nodejs.org/api/corepack.html) (bundled with Node) — the repository pins its version in `package.json`, and the first `pnpm` command will fetch the matching release. If Corepack is disabled in your environment, run `corepack enable` once.
+
### Spree codebase
Spree is a monorepo with three main areas:
@@ -72,15 +79,7 @@ All Spree models, controllers and other Ruby classes are namespaced by the `Spre
The server app is not checked into the monorepo. It's cloned from [spree-starter](https://github.com/spree/spree-starter) on first setup, with `SPREE_PATH=..` automatically configured so it uses your local Spree gems.
-**Step 1: Start infrastructure**
-
-```bash
-docker compose up -d # starts Postgres, Redis, Meilisearch
-```
-
-Or install PostgreSQL and Redis locally if you prefer.
-
-**Step 2: Clone the server app**
+**Step 1: Clone the server app**
```bash
pnpm server:setup
@@ -88,19 +87,34 @@ pnpm server:setup
This clones [spree-starter](https://github.com/spree/spree-starter) into `server/` and sets `SPREE_PATH=..` in `server/.env` so it uses your local Spree gems.
-**Step 3: Configure and run**
+**Step 2: Configure and run**
```bash
cd server
# Edit .env if needed (e.g. DATABASE_USERNAME, DATABASE_HOST, DATABASE_PORT)
-bin/setup # installs Ruby (via mise), system packages, gems, prepares database
+bin/setup # installs Ruby (via mise), Postgres/Redis/Meilisearch (via brew), gems, prepares database
bin/dev # starts Rails + Sidekiq + CSS watchers via overmind
```
+`bin/setup` installs system services natively (PostgreSQL, Redis, Meilisearch) via `brew bundle` on macOS or `apt-get` on Linux. If you'd rather run those services in Docker, start them from the repo root before running `bin/setup`:
+
+```bash
+docker compose up -d postgres redis meilisearch
+```
+
Use `bin/setup --reset` to drop and recreate the database.
The app runs at [http://localhost:3000](http://localhost:3000). Admin Panel is at [http://localhost:3000/admin](http://localhost:3000/admin).
+**Step 3 (optional): Load sample data**
+
+To populate your store with sample products, customers, orders, and configuration:
+
+```bash
+pnpm server:load_sample_data # from repo root
+# or, from server/: bin/rails spree:load_sample_data
+```
+
### Running engine tests
Each engine has its own test suite. First install the shared dependencies at the `spree/` level, then navigate into the specific engine to set up and run its tests:
diff --git a/docs/developer/contributing/developing-spree.mdx b/docs/developer/contributing/developing-spree.mdx
index 8155cd7d28..a1999ca660 100644
--- a/docs/developer/contributing/developing-spree.mdx
+++ b/docs/developer/contributing/developing-spree.mdx
@@ -13,6 +13,12 @@ Spree is a big monorepo. For a faster clone, use a **partial clone** which downl
git clone --filter=blob:none https://github.com/spree/spree.git
```
+## Prerequisites
+
+You need **Node.js 20+** to run the workspace scripts (including `pnpm server:setup`, which both backend and TypeScript contributors use). Install it via [nvm](https://github.com/nvm-sh/nvm), [mise](https://mise.jdx.dev), [fnm](https://github.com/Schniz/fnm), or your package manager (`brew install node` on macOS).
+
+`pnpm` is provisioned automatically via [Corepack](https://nodejs.org/api/corepack.html) (bundled with Node) — the repository pins its version in `package.json`, and the first `pnpm` command will fetch the matching release. If Corepack is disabled in your environment, run `corepack enable` once.
+
## Spree codebase
Spree is a monorepo with three main areas:
@@ -42,15 +48,7 @@ All Spree models, controllers and other Ruby classes are namespaced by the `Spre
The server app is not checked into the monorepo. It's cloned from [spree-starter](https://github.com/spree/spree-starter) on first setup, with `SPREE_PATH=..` automatically configured so it uses your local Spree gems.
-**Step 1: Start infrastructure**
-
-```bash
-docker compose up -d # starts Postgres, Redis, Meilisearch
-```
-
-Or install PostgreSQL and Redis locally if you prefer.
-
-**Step 2: Clone the server app**
+**Step 1: Clone the server app**
```bash
pnpm server:setup
@@ -58,19 +56,34 @@ pnpm server:setup
This clones [spree-starter](https://github.com/spree/spree-starter) into `server/` and sets `SPREE_PATH=..` in `server/.env` so it uses your local Spree gems.
-**Step 3: Configure and run**
+**Step 2: Configure and run**
```bash
cd server
# Edit .env if needed (e.g. DATABASE_USERNAME, DATABASE_HOST, DATABASE_PORT)
-bin/setup # installs Ruby (via mise), system packages, gems, prepares database
+bin/setup # installs Ruby (via mise), Postgres/Redis/Meilisearch (via brew), gems, prepares database
bin/dev # starts Rails + Sidekiq + CSS watchers via overmind
```
+`bin/setup` installs system services natively (PostgreSQL, Redis, Meilisearch) via `brew bundle` on macOS or `apt-get` on Linux. If you'd rather run those services in Docker, start them from the repo root before running `bin/setup`:
+
+```bash
+docker compose up -d postgres redis meilisearch
+```
+
Use `bin/setup --reset` to drop and recreate the database.
The app runs at [http://localhost:3000](http://localhost:3000). Admin Panel is at [http://localhost:3000/admin](http://localhost:3000/admin).
+**Step 3 (optional): Load sample data**
+
+To populate your store with sample products, customers, orders, and configuration:
+
+```bash
+pnpm server:load_sample_data # from repo root
+# or, from server/: bin/rails spree:load_sample_data
+```
+
### Running engine tests
Each engine has its own test suite. First install the shared dependencies at the `spree/` level, then navigate into the specific engine to set up and run its tests: