@spree/docs 0.1.106 → 0.1.108

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Architecture
3
- description: How Spree's core models, APIs, and packages work together
3
+ description: Explore how Spree's core models, APIs, and gems fit together — catalog, shopping, checkout, fulfillment, and pricing — for headless or embedded commerce.
4
4
  ---
5
5
 
6
6
  ## Overview
@@ -119,7 +119,7 @@ Events from both APIs can trigger [Webhooks](webhooks.md) to notify external sys
119
119
 
120
120
  ## Multi-Store Architecture
121
121
 
122
- Spree supports [multiple stores](../multi-store/quickstart.md) from a single installation. Each Store can have:
122
+ Spree supports running [multiple storefronts](../multi-tenant/quickstart.md) from a single installation. Each Store can have:
123
123
 
124
124
  - Its own domain and branding
125
125
  - Different currencies and locales
@@ -290,7 +290,6 @@ spree api delete /markets/market_xxx
290
290
  ## Related Documentation
291
291
 
292
292
  - [Markets (Store SDK)](../sdk/store/markets.md) — Listing, resolving, and reading markets from the Store SDK
293
- - [Stores](stores.md) — Multi-store setup and configuration
294
293
  - [Pricing](pricing.md) — Price Lists, Price Rules, and the Pricing Context
295
294
  - [Addresses](addresses.md) — Countries, States, and Zones
296
295
  - [Localization](../../api-reference/store-api/localization.md) — Locale, currency, and country headers in API requests
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Staff & Roles
3
- description: Admin users, roles, invitations, and permissions
3
+ description: Manage Spree admin users, roles, invitations, and permissions — create admins via the CLI, scope access per store, and customize role-based permissions.
4
4
  ---
5
5
 
6
6
  ## Overview
@@ -168,6 +168,5 @@ See the [Customize Permissions guide](../customization/permissions.md) for detai
168
168
  - [Custom API Authentication](../how-to/custom-api-authentication.md) — implement a custom identity-provider strategy (the full guide)
169
169
  - [Admin API Authentication](../../api-reference/admin-api/authentication.md) — keys, JWTs, scopes, and the refresh-cookie flow
170
170
  - [Customers](customers.md) — Customer accounts and authentication
171
- - [Stores](stores.md) — Multi-store setup
172
171
  - [Permissions](../customization/permissions.md) — Roles and authorization
173
172
  - [Events](events.md) — Subscribe to invitation events
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Stores
3
- description: The Store is Spree's top-level multi-tenant boundary learn how products, orders, channels, and markets are scoped to a store.
3
+ description: Understand Spree Stores the top-level tenant boundary that scopes products, orders, channels, markets, and branding, with the Admin API for store config.
4
4
  ---
5
5
 
6
6
  ## Overview
@@ -73,12 +73,10 @@ Each store owns its own resources. Products, orders, channels, markets, and taxo
73
73
 
74
74
  ## Running Multiple Storefronts
75
75
 
76
- If you need one Spree backend to serve **multiple distinct merchant brands** — different domains, different catalogs, different admin teams — there are two patterns:
76
+ If you need one Spree backend to serve **multiple distinct merchant brands** — different domains, different catalogs — there are two patterns:
77
77
 
78
78
  - **Multiple channels under one store** (recommended for most cases) — model each storefront as a Sales Channel. Products are scoped per-channel via publications, orders carry the channel that originated them, and routing/pricing can differ per channel. This is the supported pattern in core Spree 5.5+.
79
- - **Multiple stores in one app** — the legacy multi-store pattern, where each store is fully independent (catalog, admin, branding). In Spree 5.5+ this requires the [spree_multi_store](../multi-store/quickstart.md) extension. Core Spree treats each product as belonging to a single store.
80
-
81
- For most multi-brand operations, the channel pattern is simpler and more flexible. Reach for [spree_multi_store](../multi-store/quickstart.md) only when stores need genuinely independent catalogs, branding, and admin teams.
79
+ - **Multiple isolated stores (tenants) in one app** — full data isolation, only recommended if you're building a SaaS platform or a multi-tenant application. Each store can have different staff members, payment methods, shipping methods, and branding. This is supported by the [Spree Multi Tenant](../multi-tenant/quickstart.md) extension, which is a separate gem from core Spree.
82
80
 
83
81
  ## Related Documentation
84
82
 
@@ -131,5 +131,4 @@ Once installed, all translation files are available automatically — no need to
131
131
  - [Markets](markets.md) — Locale and currency configuration per geographic region
132
132
  - [Localization](../../api-reference/store-api/localization.md) — Locale, currency, and country headers in API requests
133
133
  - [Slugs](slugs.md) — Localized slugs and URL identifiers
134
- - [Stores](stores.md) — Multi-store setup
135
134
  - [Products](products.md) — Product translations
@@ -32,7 +32,7 @@ bin/rails g model Spree::NewModel tenant:references name:string --parent SpreeMu
32
32
 
33
33
  ## Tenant selector
34
34
 
35
- By default the current tenant is selected based on the subdomain or `Spree::CustomDomain`. The selector works in tandem with the default [Spree::Stores::FindCurrent](https://github.com/spree/spree/blob/main/core/app/finders/spree/stores/find_current.rb) finder.
35
+ By default the current tenant is selected based on the subdomain or `Spree::CustomDomain`.
36
36
 
37
37
  First it finds the current store, and later sets the current tenant based on the store's `tenant_id`.
38
38
 
@@ -1,20 +1,118 @@
1
1
  ---
2
- title: Building a Multi-Tenant Spree Application
3
- sidebarTitle: Quickstart
2
+ title: Spree Multi Tenant Installation
3
+ sidebarTitle: Installation
4
+ description: Install and configure Spree Multi-Tenant to run a SaaS ecommerce platform, including prerequisites, gem setup, license keys, and tenant provisioning.
4
5
  ---
5
6
 
6
- Spree out of the box is a single-tenant application. You can have multiple stores on the same instance of Spree, but they share the same products, admin user accounts and other resources.
7
- Multi-Store Spree setup is recommended for running multiple brands or multiple language versions of the same brand on the same instance.
7
+ > **WARNING:** This installation instructions assume you have a clean Spree Starter installation and you've purchased the [Spree Enterprise Edition license](https://spreecommerce.org/pricing).
8
+ >
9
+ > For migrating existing application from single-tenant to multi-tenant, please contact us at [support@spreecommerce.org](mailto:support@spreecommerce.org).
8
10
 
9
- If you want to have a true multi-tenant application, you will need to purchase [Enterprise Edition license](https://spreecommerce.org/pricing) which includes `spree_multi_tenant` gem providing full multi-tenant support.
11
+ ## Prerequisites
10
12
 
11
- ## Multi-Store vs Multi-Tenant
13
+ * You need to be on Spree 5.1+, we recommend using [spree_starter](https://github.com/spree/spree_starter) as a base for your application
14
+ * You need to have 2 environment variables set:
15
+ * `KEYGEN_ACCOUNT_ID`
16
+ * `KEYGEN_LICENSE_KEY`
17
+ * We support both PostgreSQL and MySQL databases
12
18
 
13
- To sum it up:
19
+ > **INFO:** Environment variables will be provided to you after purchasing the [Spree Enterprise Edition license](https://spreecommerce.org/pricing).
14
20
 
15
- * Multi-Store setup is recommended for running multiple brands or multiple language versions of the same store
16
- * Multi-Tenant allows you to create a SaaS application with multiple tenants, each of them with their own Spree instance
21
+ > **WARNING:** You will need to add these environment variables to your CI/CD pipeline and production environments.
17
22
 
18
- ## Setup SaaS application
23
+ ## Customer User Class
19
24
 
20
- [Follow the installation instructions](installation.md) to set up a multi-tenant Spree application.
25
+ Please follow [Authentication](../customization/authentication.md) documentation to create a new user class.
26
+
27
+ Now we will need to make slight adjustments to the generated user class so it can work in a multi-tenant environment.
28
+
29
+ If you're using Devise, you will need to remove `:validatable` module. This module is responsible for validating the user's email uniqueness. We need to change it to validate it in the scope of the tenant.
30
+
31
+ Spree Multi-Tenant gem injects `SpreeMultiTenant::CustomerUserConcern` that handles that instead.
32
+
33
+ ## Admin User Class
34
+
35
+ For our multi-tenant setup we will need a separate Admin user class. Our standard User class will be only used for customer accounts which will be isolated by tenant.
36
+ Admin user classes will be shared across tenants allowing them to manage multiple tenants from a single admin panel.
37
+
38
+ Let's create a new model with Devise (unless you already have one):
39
+
40
+
41
+ ```bash Spree CLI (Docker)
42
+ spree rails g devise Spree::AdminUser
43
+ ```
44
+
45
+ ```bash Without Spree CLI
46
+ bin/rails g devise Spree::AdminUser
47
+ ```
48
+
49
+
50
+ Replace the generated Devise code with the following:
51
+
52
+ ```ruby
53
+ class Spree::AdminUser < Spree::Base
54
+ # Include default devise modules. Others available are:
55
+ # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
56
+ devise :database_authenticatable, :registerable,
57
+ :recoverable, :rememberable, :validatable
58
+
59
+ # Spree modules
60
+ include Spree::UserMethods
61
+ end
62
+ ```
63
+
64
+ If you already have a custom Admin user class, you can add the following code to it:
65
+
66
+ ```ruby
67
+ # Spree modules
68
+ include Spree::UserMethods
69
+ ```
70
+
71
+ This will make sure that the Admin user class works well with Spree ecosystem.
72
+
73
+ Register new model in `config/initializers/spree.rb`:
74
+
75
+ ```ruby
76
+ Spree.admin_user_class = "Spree::AdminUser"
77
+ ```
78
+
79
+ ## Installing gems
80
+
81
+ 1. Add the following code to your `Gemfile`:
82
+
83
+ ```ruby
84
+ source "https://license:#{ENV['KEYGEN_LICENSE_KEY']}@rubygems.pkg.keygen.sh/#{ENV['KEYGEN_ACCOUNT_ID']}" do
85
+ gem 'spree_enterprise'
86
+ gem 'spree_multi_tenant'
87
+ end
88
+ ```
89
+
90
+ 2. Install gems:
91
+
92
+
93
+
94
+ ```bash Spree CLI (Docker)
95
+ spree bundle install
96
+ ```
97
+
98
+ ```bash Without Spree CLI
99
+ bundle install
100
+ ```
101
+
102
+
103
+
104
+ 3. Run generators:
105
+
106
+
107
+
108
+ ```bash Spree CLI (Docker)
109
+ spree generate spree_enterprise:install && spree generate spree_multi_tenant:install
110
+ ```
111
+
112
+ ```bash Without Spree CLI
113
+ bin/rails g spree_enterprise:install && bin/rails g spree_multi_tenant:install
114
+ ```
115
+
116
+
117
+
118
+ > **INFO:** This will copy and run migrations for `spree_enterprise` and `spree_multi_tenant` gems.
@@ -1,9 +1,9 @@
1
1
  ---
2
- title: 4.2 to 4.3
2
+ title: Upgrading to Spree 4.3
3
3
  section: upgrades
4
4
  order: 0
5
5
  hidden: true
6
- description: This guide covers upgrading a 4.2 Spree application to Spree 4.3.
6
+ description: Upgrade a Spree 4.2 application to Spree 4.3 — split out spree_emails, spree_backend, and spree_frontend gems, remove merged extensions, and run migrations.
7
7
  ---
8
8
 
9
9
  > **NOTE:** If you're on an older version than 4.1 please follow previous upgrade guides and perform those upgrades incrementally, eg.
@@ -28,7 +28,7 @@ These gems were merged into Spree Core in version 4.3. All of their functionalit
28
28
 
29
29
  ### Optional Remove SpreeMultiDomain
30
30
 
31
- If you used that gem in the past you need to remove it. Multi-Store is now incorporated into Spree core and you cannot use that gem anymore.
31
+ If you used that gem in the past you need to remove it.
32
32
 
33
33
  1. Remove `spree_multi_domain` from your `Gemfile`
34
34
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Upgrading to Spree 5.4
3
- description: This guide covers upgrading a Spree 5.3 application to Spree 5.4.
3
+ description: Upgrade a Spree 5.3 application to Spree 5.4 — remove spree_sample, update gems, run migrations, switch to AdminUserMethods, and backfill image thumbnail IDs.
4
4
  ---
5
5
 
6
6
  > **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 5.3](5.2-to-5.3.md)
@@ -252,20 +252,6 @@ Also, add `jsonapi-rspec` gem to your `Gemfile`:
252
252
 
253
253
  And run `bundle install`
254
254
 
255
- ### (Optional) Install Spree Multi Store
256
-
257
- [Multi-store](../multi-store/quickstart.md) features like multiple store management & custom domains were moved to a separate gem [spree_multi_store](../multi-store/quickstart.md).
258
-
259
- If you rely on these features please run:
260
-
261
- ```bash
262
- bundle add spree_multi_store
263
- ```
264
-
265
- > **INFO:** Spree Multi-Store is licensed under the [AGPL v3 License](https://opensource.org/licenses/AGPL-3.0).
266
- >
267
- > If you would like to use it in a commercial application, please [contact us](https://spreecommerce.org/get-started/) to obtain a commercial license.
268
-
269
255
  ### (Optional) Install Legacy Product Properties extension
270
256
 
271
257
  Product Properties have been extracted from Spree core to a separate gem `spree_legacy_product_properties`. Product Properties were already deprecated in favor of [Metafields](../core-concepts/metafields.md) and disabled by default since Spree 5.1.
@@ -122,7 +122,7 @@ This is a no-op on the default Database provider (there is no external index to
122
122
 
123
123
  #### Multi-store catalogs
124
124
 
125
- If you have products attached to multiple stores via the legacy `spree_products_stores` join, the `populate_publications` task picks **one** "home" store per product and creates publications on every store's default channel. The `spree_products_stores` table is **kept** as legacy compat surface — the upcoming [spree_multi_store](../multi-store/quickstart.md) extension restores the full `Product has_many :stores` association on top of it.
125
+ If you have products attached to multiple stores via the legacy `spree_products_stores` join, the `populate_publications` task picks **one** "home" store per product and creates publications on every store's default channel. The `spree_products_stores` table is **kept** as legacy compat surface.
126
126
 
127
127
  For single-store deployments this is invisible; you can move on without touching `spree_products_stores` again.
128
128
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spree/docs",
3
- "version": "0.1.106",
3
+ "version": "0.1.108",
4
4
  "description": "Spree Commerce developer documentation for AI agents and local reference",
5
5
  "type": "module",
6
6
  "license": "CC-BY-4.0",
@@ -1,78 +0,0 @@
1
- ---
2
- title: Multi-Store Spree Commerce Quickstart
3
- sidebarTitle: Quickstart
4
- description: Enable multiple storefronts on a single Spree app with the spree_multi_store gem, including per-store products, payment methods, taxonomies, and promotions.
5
- ---
6
-
7
- To enable multiple stores, you will need to add the [spree_multi_store](quickstart.md) gem to your project via:
8
-
9
-
10
- ```bash Spree CLI (Docker)
11
- spree bundle add spree_multi_store
12
- ```
13
-
14
- ```bash Without Spree CLI
15
- bundle add spree_multi_store
16
- ```
17
-
18
-
19
- > **INFO:** Spree Multi-Store is licensed under the [AGPL v3 License](https://opensource.org/licenses/AGPL-3.0).
20
- >
21
- > If you would like to use it in a commercial application, please [contact us](https://spreecommerce.org/get-started/) to obtain a commercial license.
22
-
23
- ![](/images/mulit_store_978x2.png)
24
-
25
- ## Store resources
26
-
27
- Each Store can have its own resources. For example, a Store can have its own Products, Taxonomies, Promotions, etc.
28
-
29
- | Resource | Relationship |
30
- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
31
- | [**Order**](/core-concepts/orders) | One Order belongs to one Store |
32
- | [**Product**](/core-concepts/products) | One Product can be associated with many Store(s), you can pick and choose in which Store(s) each Product will be available |
33
- | [**Payment Method**](/core-concepts/payments) | One Payment Method can be associated with many Store(s), you can select in which Stores given Payment Method will be available on Checkout |
34
- | [**Taxonomy**](/core-concepts/products#taxons-and-taxonomies) | One Taxonomy belongs to one Store |
35
- | [**Promotion**](/core-concepts/promotions) | One Promotion can be associated with multiple Stores |
36
- | **Store Credit** | One Store Credit belongs to and can be used in one Store
37
-
38
- ## Current Store
39
-
40
- Spree will try to determine the current store based on the current URL. If the URL does not match any of the stores in the database, Spree will fall back to the default store.
41
-
42
- All Spree controllers or any other controllers that include [Spree::Core::ControllerHelpers::Store](https://github.com/spree/spree/blob/main/core/lib/spree/core/controller_helpers/store.rb) have access to the `current_store` method which returns the `Store` matching the current URL.
43
-
44
- All parts of Spree (API, Admin Panel) have this implemented.
45
-
46
- > **INFO:** Under the hood `current_store` calls [Spree::Stores::FindCurrent.new(url: url).execute](https://github.com/spree/spree/blob/main/core/app/finders/spree/stores/find_current.rb).
47
- >
48
- > This logic can be easily overwritten by setting
49
- >
50
- > ```ruby
51
- Spree::Dependencies.current_store_finder = 'MyStoreFinderClass'
52
- ```
53
- >
54
- > in `config/initializers/spree.rb` file
55
-
56
- ## Default Store
57
-
58
- If the system cannot find any Store that matches the current URL it will fall back to the Default Store.
59
-
60
- You can set the default Store via Rails console:
61
-
62
- ```ruby
63
- Spree::Store.find(2).update(default: true)
64
- ```
65
-
66
- To get the default store in your code or rails console type:
67
-
68
- ```ruby
69
- Spree::Store.default
70
- ```
71
-
72
- ## Custom Domains
73
-
74
- Spree supports managing custom domains for Stores. In the Admin Panel, you can manage custom domains for each Store in the **Settings -> Domains** page.
75
-
76
- ## Setup multi-store application
77
-
78
- [Follow the setup guide](setup.md) to get started.
@@ -1,38 +0,0 @@
1
- ---
2
- title: Multi-Store Setup
3
- sidebarTitle: Setup
4
- ---
5
-
6
- ## Root domain
7
-
8
- You need to set a wildcard `root_domain` on the store to enable multi-store setup
9
-
10
- ```ruby
11
- Spree.root_domain = ENV.fetch('SPREE_ROOT_DOMAIN', 'lvh.me')
12
- ```
13
-
14
- This will be used to generate the store URLs, eg. `store1.lvh.me`, `store2.lvh.me`, etc.
15
-
16
- `store1` part is the unique store `code` identifier, which is auto-generated based on the store name. You can change it in the admin panel in **Settings -> Domains**.
17
-
18
- > **INFO:** If you later change the `root_domain`, you will need to run:
19
- >
20
- > ```ruby
21
- Spree::Store.all.each(&:save)
22
- ```
23
- >
24
- > to update the store URLs.
25
-
26
- ## Creating new stores
27
-
28
- After you restart your application, you will see a new option in the admin panel, under new item menu:
29
-
30
- ![](/images/new_store_dropdown.png)
31
-
32
- You can also create a new store from the rails console:
33
-
34
- ```ruby
35
- Spree::Store.create!(name: 'New Store')
36
- ```
37
-
38
- This will create a new store with the given name, code and URL.
@@ -1,118 +0,0 @@
1
- ---
2
- title: Spree Multi Tenant Installation
3
- sidebarTitle: Installation
4
- description: Install and configure Spree Multi-Tenant to run a SaaS ecommerce platform, including prerequisites, gem setup, license keys, and tenant provisioning.
5
- ---
6
-
7
- > **WARNING:** This installation instructions assume you have a clean Spree Starter installation and you've purchased the [Spree Enterprise Edition license](https://spreecommerce.org/pricing).
8
- >
9
- > For migrating existing application from single-tenant to multi-tenant, please contact us at [support@spreecommerce.org](mailto:support@spreecommerce.org).
10
-
11
- ## Prerequisites
12
-
13
- * You need to be on Spree 5.1+, we recommend using [spree_starter](https://github.com/spree/spree_starter) as a base for your application
14
- * You need to have 2 environment variables set:
15
- * `KEYGEN_ACCOUNT_ID`
16
- * `KEYGEN_LICENSE_KEY`
17
- * We support both PostgreSQL and MySQL databases
18
-
19
- > **INFO:** Environment variables will be provided to you after purchasing the [Spree Enterprise Edition license](https://spreecommerce.org/pricing).
20
-
21
- > **WARNING:** You will need to add these environment variables to your CI/CD pipeline and production environments.
22
-
23
- ## Customer User Class
24
-
25
- Please follow [Authentication](/docs/developer/customization/authentication) documentation to create a new user class.
26
-
27
- Now we will need to make slight adjustments to the generated user class so it can work in a multi-tenant environment.
28
-
29
- If you're using Devise, you will need to remove `:validatable` module. This module is responsible for validating the user's email uniqueness. We need to change it to validate it in the scope of the tenant.
30
-
31
- Spree Multi-Tenant gem injects `SpreeMultiTenant::CustomerUserConcern` that handles that instead.
32
-
33
- ## Admin User Class
34
-
35
- For our multi-tenant setup we will need a separate Admin user class. Our standard User class will be only used for customer accounts which will be isolated by tenant.
36
- Admin user classes will be shared across tenants allowing them to manage multiple tenants from a single admin panel.
37
-
38
- Let's create a new model with Devise (unless you already have one):
39
-
40
-
41
- ```bash Spree CLI (Docker)
42
- spree rails g devise Spree::AdminUser
43
- ```
44
-
45
- ```bash Without Spree CLI
46
- bin/rails g devise Spree::AdminUser
47
- ```
48
-
49
-
50
- Replace the generated Devise code with the following:
51
-
52
- ```ruby
53
- class Spree::AdminUser < Spree::Base
54
- # Include default devise modules. Others available are:
55
- # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
56
- devise :database_authenticatable, :registerable,
57
- :recoverable, :rememberable, :validatable
58
-
59
- # Spree modules
60
- include Spree::UserMethods
61
- end
62
- ```
63
-
64
- If you already have a custom Admin user class, you can add the following code to it:
65
-
66
- ```ruby
67
- # Spree modules
68
- include Spree::UserMethods
69
- ```
70
-
71
- This will make sure that the Admin user class works well with Spree ecosystem.
72
-
73
- Register new model in `config/initializers/spree.rb`:
74
-
75
- ```ruby
76
- Spree.admin_user_class = "Spree::AdminUser"
77
- ```
78
-
79
- ## Installing gems
80
-
81
- 1. Add the following code to your `Gemfile`:
82
-
83
- ```ruby
84
- source "https://license:#{ENV['KEYGEN_LICENSE_KEY']}@rubygems.pkg.keygen.sh/#{ENV['KEYGEN_ACCOUNT_ID']}" do
85
- gem 'spree_enterprise'
86
- gem 'spree_multi_tenant'
87
- end
88
- ```
89
-
90
- 2. Install gems:
91
-
92
-
93
-
94
- ```bash Spree CLI (Docker)
95
- spree bundle install
96
- ```
97
-
98
- ```bash Without Spree CLI
99
- bundle install
100
- ```
101
-
102
-
103
-
104
- 3. Run generators:
105
-
106
-
107
-
108
- ```bash Spree CLI (Docker)
109
- spree generate spree_enterprise:install && spree generate spree_multi_tenant:install
110
- ```
111
-
112
- ```bash Without Spree CLI
113
- bin/rails g spree_enterprise:install && bin/rails g spree_multi_tenant:install
114
- ```
115
-
116
-
117
-
118
- > **INFO:** This will copy and run migrations for `spree_enterprise` and `spree_multi_tenant` gems.