@spree/docs 0.1.0
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/README.md +54 -0
- package/dist/api-reference/platform/authentication.md +38 -0
- package/dist/api-reference/store-api/authentication.md +188 -0
- package/dist/api-reference/store-api/errors.md +277 -0
- package/dist/api-reference/store-api/idempotency.md +129 -0
- package/dist/api-reference/store-api/introduction.md +34 -0
- package/dist/api-reference/store-api/localization.md +279 -0
- package/dist/api-reference/store-api/metadata.md +160 -0
- package/dist/api-reference/store-api/monetary-amounts.md +65 -0
- package/dist/api-reference/store-api/querying.md +399 -0
- package/dist/api-reference/store-api/rate-limitting.md +103 -0
- package/dist/api-reference/store-api/relations.md +185 -0
- package/dist/api-reference/storefront/authentication.md +88 -0
- package/dist/api-reference/tutorials/adyen-integration-guide-for-android.md +165 -0
- package/dist/api-reference/tutorials/adyen-integration-guide-for-ios.md +194 -0
- package/dist/api-reference/tutorials/quick-checkout-with-stripe.md +248 -0
- package/dist/api-reference/v2/fetching-multiple-resources.md +26 -0
- package/dist/api-reference/v2/filtering-and-sorting.md +53 -0
- package/dist/api-reference/v2/introduction.md +22 -0
- package/dist/api-reference/v2/pagination.md +37 -0
- package/dist/api-reference/webhooks-events.md +883 -0
- package/dist/developer/admin/admin.md +205 -0
- package/dist/developer/admin/authentication.md +59 -0
- package/dist/developer/admin/components.md +711 -0
- package/dist/developer/admin/custom-css.md +243 -0
- package/dist/developer/admin/custom-javascript.md +116 -0
- package/dist/developer/admin/extending-ui.md +1964 -0
- package/dist/developer/admin/form-builder.md +444 -0
- package/dist/developer/admin/helper-methods.md +531 -0
- package/dist/developer/admin/navigation.md +805 -0
- package/dist/developer/admin/tables.md +491 -0
- package/dist/developer/advanced/adding_spree_to_rails_app.md +106 -0
- package/dist/developer/cli/quickstart.md +137 -0
- package/dist/developer/contributing/creating-an-extension.md +258 -0
- package/dist/developer/contributing/developing-spree.md +339 -0
- package/dist/developer/contributing/quickstart.md +32 -0
- package/dist/developer/contributing/updating-extensions.md +67 -0
- package/dist/developer/core-concepts/addresses.md +265 -0
- package/dist/developer/core-concepts/adjustments.md +107 -0
- package/dist/developer/core-concepts/architecture.md +177 -0
- package/dist/developer/core-concepts/calculators.md +323 -0
- package/dist/developer/core-concepts/customers.md +230 -0
- package/dist/developer/core-concepts/events.md +624 -0
- package/dist/developer/core-concepts/imports-exports.md +698 -0
- package/dist/developer/core-concepts/inventory.md +191 -0
- package/dist/developer/core-concepts/markets.md +250 -0
- package/dist/developer/core-concepts/media.md +167 -0
- package/dist/developer/core-concepts/metafields.md +187 -0
- package/dist/developer/core-concepts/orders.md +328 -0
- package/dist/developer/core-concepts/payments.md +710 -0
- package/dist/developer/core-concepts/pricing.md +163 -0
- package/dist/developer/core-concepts/products.md +360 -0
- package/dist/developer/core-concepts/promotions.md +322 -0
- package/dist/developer/core-concepts/reports.md +206 -0
- package/dist/developer/core-concepts/search-filtering.md +237 -0
- package/dist/developer/core-concepts/shipments.md +212 -0
- package/dist/developer/core-concepts/slugs.md +111 -0
- package/dist/developer/core-concepts/staff-roles.md +123 -0
- package/dist/developer/core-concepts/store-credits-gift-cards.md +317 -0
- package/dist/developer/core-concepts/stores.md +117 -0
- package/dist/developer/core-concepts/taxes.md +135 -0
- package/dist/developer/core-concepts/translations.md +120 -0
- package/dist/developer/core-concepts/users.md +299 -0
- package/dist/developer/core-concepts/webhooks.md +378 -0
- package/dist/developer/create-spree-app/quickstart.md +158 -0
- package/dist/developer/customization/api.md +93 -0
- package/dist/developer/customization/authentication.md +88 -0
- package/dist/developer/customization/checkout.md +204 -0
- package/dist/developer/customization/configuration.md +55 -0
- package/dist/developer/customization/decorators.md +523 -0
- package/dist/developer/customization/dependencies.md +232 -0
- package/dist/developer/customization/emails.md +21 -0
- package/dist/developer/customization/extensions.md +92 -0
- package/dist/developer/customization/metadata.md +236 -0
- package/dist/developer/customization/model-preferences.md +130 -0
- package/dist/developer/customization/permissions.md +265 -0
- package/dist/developer/customization/quickstart.md +229 -0
- package/dist/developer/customization/routes.md +24 -0
- package/dist/developer/customization/v4/admin-panel.md +78 -0
- package/dist/developer/customization/v4/authentication.md +210 -0
- package/dist/developer/customization/v4/checkout.md +212 -0
- package/dist/developer/customization/v4/deface.md +251 -0
- package/dist/developer/customization/v4/images.md +86 -0
- package/dist/developer/customization/v4/storefront.md +450 -0
- package/dist/developer/deployment/assets.md +87 -0
- package/dist/developer/deployment/aws.md +335 -0
- package/dist/developer/deployment/caching.md +27 -0
- package/dist/developer/deployment/cdn.md +39 -0
- package/dist/developer/deployment/database.md +155 -0
- package/dist/developer/deployment/docker.md +128 -0
- package/dist/developer/deployment/emails.md +77 -0
- package/dist/developer/deployment/environment_variables.md +111 -0
- package/dist/developer/deployment/heroku.md +51 -0
- package/dist/developer/deployment/render.md +95 -0
- package/dist/developer/getting-started/quickstart.md +82 -0
- package/dist/developer/how-to/custom-payment-method.md +374 -0
- package/dist/developer/how-to/custom-promotion.md +373 -0
- package/dist/developer/how-to/custom-report.md +387 -0
- package/dist/developer/how-to/custom-search-provider.md +230 -0
- package/dist/developer/multi-store/quickstart.md +71 -0
- package/dist/developer/multi-store/setup.md +38 -0
- package/dist/developer/multi-tenant/configuration.md +41 -0
- package/dist/developer/multi-tenant/core-concepts.md +75 -0
- package/dist/developer/multi-tenant/installation.md +96 -0
- package/dist/developer/multi-tenant/quickstart.md +20 -0
- package/dist/developer/multi-vendor/installation.md +45 -0
- package/dist/developer/multi-vendor/quickstart.md +17 -0
- package/dist/developer/sdk/admin/quickstart.md +22 -0
- package/dist/developer/sdk/authentication.md +89 -0
- package/dist/developer/sdk/configuration.md +225 -0
- package/dist/developer/sdk/quickstart.md +82 -0
- package/dist/developer/sdk/store/account.md +67 -0
- package/dist/developer/sdk/store/cart-checkout.md +140 -0
- package/dist/developer/sdk/store/markets.md +151 -0
- package/dist/developer/sdk/store/payments.md +96 -0
- package/dist/developer/sdk/store/products.md +149 -0
- package/dist/developer/sdk/store/wishlists.md +52 -0
- package/dist/developer/security/pci_compliance.md +15 -0
- package/dist/developer/security/security_policy.md +68 -0
- package/dist/developer/storefront/blocks.md +285 -0
- package/dist/developer/storefront/custom-css.md +260 -0
- package/dist/developer/storefront/custom-javascript.md +166 -0
- package/dist/developer/storefront/helper-methods.md +1288 -0
- package/dist/developer/storefront/links.md +298 -0
- package/dist/developer/storefront/nextjs/architecture.md +150 -0
- package/dist/developer/storefront/nextjs/customization.md +141 -0
- package/dist/developer/storefront/nextjs/deployment.md +180 -0
- package/dist/developer/storefront/nextjs/quickstart.md +92 -0
- package/dist/developer/storefront/nextjs/spree-next-package.md +314 -0
- package/dist/developer/storefront/pages.md +163 -0
- package/dist/developer/storefront/sections.md +569 -0
- package/dist/developer/storefront/storefront.md +56 -0
- package/dist/developer/storefront/themes.md +161 -0
- package/dist/developer/tutorial/admin.md +134 -0
- package/dist/developer/tutorial/extending-models.md +380 -0
- package/dist/developer/tutorial/file-uploads.md +121 -0
- package/dist/developer/tutorial/introduction.md +33 -0
- package/dist/developer/tutorial/model.md +41 -0
- package/dist/developer/tutorial/page-builder.md +487 -0
- package/dist/developer/tutorial/rich-text.md +73 -0
- package/dist/developer/tutorial/seo.md +332 -0
- package/dist/developer/tutorial/storefront.md +352 -0
- package/dist/developer/tutorial/testing.md +558 -0
- package/dist/developer/upgrades/2.0-to-2.1.md +46 -0
- package/dist/developer/upgrades/2.1-to-2.2.md +59 -0
- package/dist/developer/upgrades/2.2-to-2.3.md +44 -0
- package/dist/developer/upgrades/2.3-to-2.4.md +42 -0
- package/dist/developer/upgrades/3.0-to-3.1.md +47 -0
- package/dist/developer/upgrades/3.1-to-3.2.md +34 -0
- package/dist/developer/upgrades/3.2-to-3.3.md +70 -0
- package/dist/developer/upgrades/3.3-to-3.4.md +36 -0
- package/dist/developer/upgrades/3.4-to-3.5.md +44 -0
- package/dist/developer/upgrades/3.5-to-3.6.md +40 -0
- package/dist/developer/upgrades/3.6-to-3.7.md +62 -0
- package/dist/developer/upgrades/3.7-to-4.0.md +152 -0
- package/dist/developer/upgrades/4.0-to-4.1.md +92 -0
- package/dist/developer/upgrades/4.1-to-4.2.md +109 -0
- package/dist/developer/upgrades/4.10-to-5.0.md +129 -0
- package/dist/developer/upgrades/4.2-to-4.3.md +100 -0
- package/dist/developer/upgrades/4.3-to-4.4.md +125 -0
- package/dist/developer/upgrades/4.4-to-4.5.md +94 -0
- package/dist/developer/upgrades/4.5-to-4.6.md +119 -0
- package/dist/developer/upgrades/4.6-to-4.7.md +39 -0
- package/dist/developer/upgrades/4.8-to-4.9.md +24 -0
- package/dist/developer/upgrades/4.9-to-4.10.md +24 -0
- package/dist/developer/upgrades/4.x-to-4.8.md +52 -0
- package/dist/developer/upgrades/5.0-to-5.1.md +28 -0
- package/dist/developer/upgrades/5.1-to-5.2.md +127 -0
- package/dist/developer/upgrades/5.2-to-5.3.md +338 -0
- package/dist/developer/upgrades/5.3-to-5.4.md +248 -0
- package/dist/developer/upgrades/quickstart.md +36 -0
- package/dist/integrations/analytics/google-analytics.md +64 -0
- package/dist/integrations/analytics/google-tag-manager.md +78 -0
- package/dist/integrations/integrations.md +39 -0
- package/dist/integrations/marketing/klaviyo.md +99 -0
- package/dist/integrations/payments/adyen.md +90 -0
- package/dist/integrations/payments/paypal.md +41 -0
- package/dist/integrations/payments/razorpay.md +45 -0
- package/dist/integrations/payments/stripe.md +109 -0
- package/dist/integrations/search/meilisearch.md +236 -0
- package/dist/integrations/sso-mfa-social-login/admin-dashboard.md +57 -0
- package/dist/integrations/sso-mfa-social-login/storefront.md +56 -0
- package/package.json +27 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Sending out Emails
|
|
3
|
+
sidebarTitle: Emails
|
|
4
|
+
description: Learn how to send transactional emails from your Spree application.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Spree sends transactional emails such as order confirmation, password reset, shipping notifications, etc. You can use any SMTP provider — Resend, Postmark, Mailgun, SendGrid, Amazon SES, or your own SMTP server.
|
|
8
|
+
|
|
9
|
+
## Configuration
|
|
10
|
+
|
|
11
|
+
Set the following environment variables to enable email delivery:
|
|
12
|
+
|
|
13
|
+
| Variable | Default | Description |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| `SMTP_HOST` | — | SMTP server address (e.g., `smtp.sendgrid.net`, `smtp.resend.com`) |
|
|
16
|
+
| `SMTP_PORT` | `587` | SMTP server port |
|
|
17
|
+
| `SMTP_USERNAME` | — | SMTP auth username |
|
|
18
|
+
| `SMTP_PASSWORD` | — | SMTP auth password |
|
|
19
|
+
| `SMTP_FROM_ADDRESS` | — | Default "from" email address (e.g., `orders@mystore.com`) |
|
|
20
|
+
| `RAILS_HOST` | `example.com` | Host used in email URLs |
|
|
21
|
+
|
|
22
|
+
When `SMTP_HOST` is not set, emails are printed to the Rails log instead of being sent.
|
|
23
|
+
|
|
24
|
+
### Provider Examples
|
|
25
|
+
|
|
26
|
+
**SendGrid:**
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
SMTP_HOST=smtp.sendgrid.net
|
|
30
|
+
SMTP_USERNAME=apikey
|
|
31
|
+
SMTP_PASSWORD=SG.your-sendgrid-api-key
|
|
32
|
+
SMTP_FROM_ADDRESS=orders@mystore.com
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
> **WARNING:** Remember to verify the email address in SendGrid you intend to use for sending, otherwise emails will be rejected.
|
|
36
|
+
> [Read more about sender verification](https://www.twilio.com/docs/sendgrid/ui/sending-email/sender-verification).
|
|
37
|
+
|
|
38
|
+
**Resend:**
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
SMTP_HOST=smtp.resend.com
|
|
42
|
+
SMTP_USERNAME=resend
|
|
43
|
+
SMTP_PASSWORD=re_your-resend-api-key
|
|
44
|
+
SMTP_FROM_ADDRESS=orders@mystore.com
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Postmark:**
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
SMTP_HOST=smtp.postmarkapp.com
|
|
51
|
+
SMTP_USERNAME=your-postmark-server-token
|
|
52
|
+
SMTP_PASSWORD=your-postmark-server-token
|
|
53
|
+
SMTP_FROM_ADDRESS=orders@mystore.com
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Amazon SES:**
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
SMTP_HOST=email-smtp.us-east-1.amazonaws.com
|
|
60
|
+
SMTP_USERNAME=your-ses-access-key-id
|
|
61
|
+
SMTP_PASSWORD=your-ses-secret-access-key
|
|
62
|
+
SMTP_FROM_ADDRESS=orders@mystore.com
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Local Development
|
|
67
|
+
|
|
68
|
+
In local development, emails are printed to the Rails log by default. To preview emails with a web UI, run [Mailpit](https://mailpit.axllent.org):
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
docker run -d --name mailpit -p 8025:8025 -p 1025:1025 axllent/mailpit
|
|
72
|
+
SMTP_HOST=localhost bin/dev
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Open [http://localhost:8025](http://localhost:8025) to see all outgoing emails.
|
|
76
|
+
|
|
77
|
+
> **TIP:** If you're using `docker compose up` for development, Mailpit is included automatically and all emails are caught at [http://localhost:8025](http://localhost:8025).
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Environment Variables
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Spree uses environment variables for all deployment configuration. No secrets or credentials are stored in the codebase.
|
|
6
|
+
|
|
7
|
+
## Required
|
|
8
|
+
|
|
9
|
+
These variables are required to run Spree in production.
|
|
10
|
+
|
|
11
|
+
| Variable | Description | Example |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `DATABASE_URL` | PostgreSQL connection URL | `postgres://user:pass@localhost:5432/spree` |
|
|
14
|
+
| `REDIS_URL` | Redis URL for background jobs (Sidekiq) and Action Cable | `redis://localhost:6379/0` |
|
|
15
|
+
| `REDIS_CACHE_URL` | Redis URL for caching (optional — falls back to `REDIS_URL`) | `redis://localhost:6380/0` |
|
|
16
|
+
| `SECRET_KEY_BASE` | Secret key for session encryption. Generate with `bin/rails secret` | `2fad5c0b79d25e4765d3018d8c740f8c3a665f0e5c...` |
|
|
17
|
+
|
|
18
|
+
## Email (SMTP)
|
|
19
|
+
|
|
20
|
+
Spree works with any SMTP provider (Resend, Postmark, Mailgun, SendGrid, Amazon SES, etc.). Set `SMTP_HOST` to enable email delivery — when not set, emails are logged to stdout.
|
|
21
|
+
|
|
22
|
+
| Variable | Default | Description |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `SMTP_HOST` | — | SMTP server address (e.g., `smtp.sendgrid.net`) |
|
|
25
|
+
| `SMTP_PORT` | `587` | SMTP server port |
|
|
26
|
+
| `SMTP_USERNAME` | — | SMTP auth username |
|
|
27
|
+
| `SMTP_PASSWORD` | — | SMTP auth password |
|
|
28
|
+
| `SMTP_FROM_ADDRESS` | — | Default "from" email address |
|
|
29
|
+
| `RAILS_HOST` | `example.com` | Host used in email URLs |
|
|
30
|
+
|
|
31
|
+
## Web Server
|
|
32
|
+
|
|
33
|
+
| Variable | Default | Description |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `PORT` | `3000` | Web server port |
|
|
36
|
+
| `RAILS_MAX_THREADS` | `3` | Puma threads per worker |
|
|
37
|
+
| `WEB_CONCURRENCY` | `1` | Number of Puma workers. Set to `auto` for one per CPU core |
|
|
38
|
+
|
|
39
|
+
## Application
|
|
40
|
+
|
|
41
|
+
| Variable | Default | Description |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| `RAILS_ENV` | `production` | Rails environment |
|
|
44
|
+
| `RAILS_LOG_LEVEL` | `info` | Log level (`debug`, `info`, `warn`, `error`) |
|
|
45
|
+
|
|
46
|
+
## File Storage (S3 / Cloudflare R2)
|
|
47
|
+
|
|
48
|
+
By default, uploaded files (product images, assets) are stored on the local filesystem. Set the appropriate credentials to use cloud storage instead. Spree auto-detects the provider based on which credentials are present.
|
|
49
|
+
|
|
50
|
+
### Amazon S3
|
|
51
|
+
|
|
52
|
+
| Variable | Default | Description |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `AWS_ACCESS_KEY_ID` | — | AWS access key |
|
|
55
|
+
| `AWS_SECRET_ACCESS_KEY` | — | AWS secret key |
|
|
56
|
+
| `AWS_REGION` | — | AWS region (e.g., `us-east-1`) |
|
|
57
|
+
| `AWS_BUCKET` | `spree-production` | S3 bucket name |
|
|
58
|
+
|
|
59
|
+
### Cloudflare R2
|
|
60
|
+
|
|
61
|
+
| Variable | Default | Description |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| `CLOUDFLARE_ENDPOINT` | — | R2 endpoint URL |
|
|
64
|
+
| `CLOUDFLARE_ACCESS_KEY_ID` | — | R2 access key |
|
|
65
|
+
| `CLOUDFLARE_SECRET_ACCESS_KEY` | — | R2 secret key |
|
|
66
|
+
| `CLOUDFLARE_BUCKET` | `spree-production` | R2 bucket name |
|
|
67
|
+
|
|
68
|
+
## Search (Meilisearch)
|
|
69
|
+
|
|
70
|
+
Optional. When configured, Spree uses [Meilisearch](/integrations/search/meilisearch) for product search, filtering, and faceted navigation instead of SQL.
|
|
71
|
+
|
|
72
|
+
| Variable | Default | Description |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| `MEILISEARCH_URL` | `http://localhost:7700` | Meilisearch server URL |
|
|
75
|
+
| `MEILISEARCH_API_KEY` | — | Meilisearch master key. Not needed for local development — only required when Meilisearch is started with `MEILI_MASTER_KEY`. |
|
|
76
|
+
|
|
77
|
+
After setting these, enable the provider and reindex:
|
|
78
|
+
|
|
79
|
+
```ruby
|
|
80
|
+
# config/initializers/spree.rb
|
|
81
|
+
Spree.search_provider = 'Spree::SearchProvider::Meilisearch'
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
rake spree:search:reindex
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Error Tracking (Sentry)
|
|
89
|
+
|
|
90
|
+
| Variable | Default | Description |
|
|
91
|
+
| --- | --- | --- |
|
|
92
|
+
| `SENTRY_DSN` | — | [Sentry](https://sentry.io/) DSN. When set, errors are reported to Sentry |
|
|
93
|
+
|
|
94
|
+
## SSL
|
|
95
|
+
|
|
96
|
+
By default, Spree assumes it runs behind an SSL-terminating reverse proxy. Set these to `false` if running without SSL (e.g., local development or behind a proxy that doesn't do SSL termination).
|
|
97
|
+
|
|
98
|
+
| Variable | Default | Description |
|
|
99
|
+
| --- | --- | --- |
|
|
100
|
+
| `RAILS_ASSUME_SSL` | `true` | Assume requests arrive via SSL (sets `X-Forwarded-Proto`) |
|
|
101
|
+
| `RAILS_FORCE_SSL` | `true` | Redirect HTTP to HTTPS and use secure cookies |
|
|
102
|
+
|
|
103
|
+
## Local Development
|
|
104
|
+
|
|
105
|
+
These variables are used when running the `server/` app locally (not via `DATABASE_URL`):
|
|
106
|
+
|
|
107
|
+
| Variable | Default | Description |
|
|
108
|
+
| --- | --- | --- |
|
|
109
|
+
| `DATABASE_HOST` | `localhost` | PostgreSQL host |
|
|
110
|
+
| `DATABASE_PORT` | `5432` | PostgreSQL port |
|
|
111
|
+
| `DATABASE_USERNAME` | `postgres` | PostgreSQL user |
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Heroku
|
|
3
|
+
section: deployment
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Heroku
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Heroku is a Platform as a Service that makes deploying and hosting Spree applications super easy.
|
|
11
|
+
|
|
12
|
+
You should just follow [Heroku Rails 6 guide](https://devcenter.heroku.com/articles/getting-started-with-rails6).
|
|
13
|
+
|
|
14
|
+
We recommend you start and stick to Heroku if you do not have DevOps-skilled team members. [Spree Starter](https://github.com/spree/spree_starter) is pre-configured to work with Heroku out of the box.
|
|
15
|
+
|
|
16
|
+
## Dynos
|
|
17
|
+
|
|
18
|
+
[Heroku Dynos](https://www.heroku.com/dynos) are lightweight, isolated environments that provide compute and run your application.
|
|
19
|
+
|
|
20
|
+
There are 2 types of dynos:
|
|
21
|
+
|
|
22
|
+
* **Web** - for running the web interface of yuour Store Storefront, API, Admin Panel
|
|
23
|
+
* **Worker** - for running background jobs via [Active Job](https://guides.rubyonrails.org/active_job_basics.html) such as email send out, report generation, etc
|
|
24
|
+
|
|
25
|
+
### Recommended sizing
|
|
26
|
+
|
|
27
|
+
| Dynos | Staging environment | Production environment |
|
|
28
|
+
| :--- | :--- | :--- |
|
|
29
|
+
| **web** | 1 x Standard-2x | 1 x Performance-M or Performance-L |
|
|
30
|
+
| **worker** | 1 x Standard-1x | 1 x Standard-1x |
|
|
31
|
+
|
|
32
|
+
## Add-Ons
|
|
33
|
+
|
|
34
|
+
[Heroku Add-Ons](https://elements.heroku.com/addons) are tools and services for developing, extending, and operating your app.
|
|
35
|
+
|
|
36
|
+
### Recommended Add-Ons and plans
|
|
37
|
+
|
|
38
|
+
| Plan | Staging environment | Production environment |
|
|
39
|
+
| :--- | :--- | :--- |
|
|
40
|
+
| Bucketeer | Hobbyist | Micro |
|
|
41
|
+
| Edge | Hobby | Micro |
|
|
42
|
+
| Heroku Postgres | Hobby Basic | Standard-0 |
|
|
43
|
+
| Sendgrid | Free | Bronze |
|
|
44
|
+
| Sentry | Free | Small |
|
|
45
|
+
|
|
46
|
+
## Other resources
|
|
47
|
+
|
|
48
|
+
* [https://devcenter.heroku.com/categories/reference](https://devcenter.heroku.com/categories/reference)
|
|
49
|
+
* [https://devcenter.heroku.com/articles/getting-started-with-rails6](https://devcenter.heroku.com/articles/getting-started-with-rails6)
|
|
50
|
+
* [https://devcenter.heroku.com/categories/monitoring-metrics](https://devcenter.heroku.com/categories/monitoring-metrics)
|
|
51
|
+
* [https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server](https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Render
|
|
3
|
+
description: Deploy Spree to Render with one click.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## One-Click Deploy
|
|
7
|
+
|
|
8
|
+
The fastest way to get Spree running on Render:
|
|
9
|
+
|
|
10
|
+
[](https://render.com/deploy?repo=https://github.com/spree/spree-starter)
|
|
11
|
+
|
|
12
|
+
This creates all required services automatically:
|
|
13
|
+
|
|
14
|
+
- **Web** — Rails app serving the API and admin panel
|
|
15
|
+
- **Worker** — Sidekiq for background jobs
|
|
16
|
+
- **PostgreSQL** — database
|
|
17
|
+
- **Redis** — caching, jobs, Action Cable
|
|
18
|
+
|
|
19
|
+
The database is seeded on first deploy. Your store is ready in a few minutes.
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
- [Render account](https://render.com) with a credit card on file
|
|
24
|
+
- [GitHub account](https://github.com)
|
|
25
|
+
|
|
26
|
+
## Custom Deployment
|
|
27
|
+
|
|
28
|
+
If you need to customize the backend (add gems, models, etc.), start from the [Spree Starter](https://github.com/spree/spree-starter) template:
|
|
29
|
+
|
|
30
|
+
1. Go to [spree/spree-starter](https://github.com/spree/spree-starter) and click **Use this template** > **Create a new repository**
|
|
31
|
+
|
|
32
|
+
2. Clone your new repository and make your changes
|
|
33
|
+
|
|
34
|
+
3. In the Render dashboard, click **New** > **Blueprint** and select your repository
|
|
35
|
+
|
|
36
|
+
4. Render reads the `render.yaml` from your repo and creates all services. Review and click **Deploy Blueprint**.
|
|
37
|
+
|
|
38
|
+
The included [`render.yaml`](https://github.com/spree/spree-starter/blob/main/render.yaml) handles:
|
|
39
|
+
- Build: `bundle install`, asset precompilation, `db:prepare`, `db:seed`
|
|
40
|
+
- Web: Puma with health check on `/up`
|
|
41
|
+
- Worker: Sidekiq with shared `SECRET_KEY_BASE`
|
|
42
|
+
- PostgreSQL 18 and Redis
|
|
43
|
+
|
|
44
|
+
## After Deployment
|
|
45
|
+
|
|
46
|
+
### Admin Dashboard
|
|
47
|
+
|
|
48
|
+
Access your admin panel at:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
https://<your-app-name>.onrender.com/admin
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Default credentials are created during `db:seed`. Change them immediately after first login.
|
|
55
|
+
|
|
56
|
+
### Environment Variables
|
|
57
|
+
|
|
58
|
+
Render sets `DATABASE_URL`, `REDIS_URL`, and `SECRET_KEY_BASE` automatically from the blueprint. For additional configuration (SMTP, file storage, Sentry, etc.), see [Environment Variables](/developer/deployment/environment_variables).
|
|
59
|
+
|
|
60
|
+
## Production Sizing
|
|
61
|
+
|
|
62
|
+
The free/starter plans work for trying Spree. For production workloads, we recommend:
|
|
63
|
+
|
|
64
|
+
| Service | Plan | Resources | Auto-scaling |
|
|
65
|
+
|---|---|---|---|
|
|
66
|
+
| **Web** | Pro | 4 GB RAM, 2 CPU | 2–3 instances |
|
|
67
|
+
| **Worker** | Standard | 2 GB RAM, 1 CPU | — |
|
|
68
|
+
| **PostgreSQL** | Pro 4 GB | 4 GB RAM, 1 CPU | — |
|
|
69
|
+
| **Redis** (jobs) | Standard | 1 GB RAM | — |
|
|
70
|
+
| **Redis** (cache) | Standard | 1 GB RAM | — |
|
|
71
|
+
|
|
72
|
+
To enable auto-scaling, add this to the web service in your `render.yaml`:
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
- type: web
|
|
76
|
+
name: spree
|
|
77
|
+
plan: pro
|
|
78
|
+
scaling:
|
|
79
|
+
minInstances: 2
|
|
80
|
+
maxInstances: 3
|
|
81
|
+
targetMemoryPercent: 80
|
|
82
|
+
targetCPUPercent: 80
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Next Steps
|
|
86
|
+
|
|
87
|
+
Render provides ephemeral storage — uploaded files (product images, etc.) won't persist across deploys. Set up cloud storage:
|
|
88
|
+
|
|
89
|
+
- [Asset Storage](/developer/deployment/assets) (Amazon S3 / Cloudflare R2)
|
|
90
|
+
|
|
91
|
+
Before going to production:
|
|
92
|
+
|
|
93
|
+
- [Set environment variables](/developer/deployment/environment_variables) (SMTP, SSL, etc.)
|
|
94
|
+
- [Configure CDN](/developer/deployment/cdn)
|
|
95
|
+
- [Configure caching](/developer/deployment/caching)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Installing Spree"
|
|
3
|
+
sidebarTitle: Installation
|
|
4
|
+
description: "Follow the instructions below to learn how to build and deploy your Spree application."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Installation options
|
|
8
|
+
|
|
9
|
+
**create-spree-app:**
|
|
10
|
+
|
|
11
|
+
The quickest way to get started. Scaffolds a full Spree project with Next.js Storefront (optional).
|
|
12
|
+
|
|
13
|
+
**Requirements:** [Node.js](https://nodejs.org/) 20+ and [Docker](https://docs.docker.com/get-docker/) running.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx create-spree-app@latest my-store
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The CLI walks you through an interactive setup:
|
|
20
|
+
|
|
21
|
+
1. Choose **Full-stack** (Backend + Next.js Storefront) or **Backend only**
|
|
22
|
+
2. Optionally load **sample data** (products, categories, images)
|
|
23
|
+
|
|
24
|
+
Once complete, your store should be running at [http://localhost:3000/admin](http://localhost:3000/admin). The port can be different if `3000` is already used on your system.
|
|
25
|
+
|
|
26
|
+
See the full [create-spree-app documentation](/developer/create-spree-app/quickstart) for all CLI flags and options.
|
|
27
|
+
|
|
28
|
+
**Manual Installation:**
|
|
29
|
+
|
|
30
|
+
For developers who prefer full control over the setup, or want to add Spree to an existing Rails application.
|
|
31
|
+
|
|
32
|
+
1. Install [Ruby](https://www.ruby-lang.org/en/documentation/installation/)
|
|
33
|
+
2. Install [vips](https://www.libvips.org/install.html) for image processing
|
|
34
|
+
3. Install Rails gem:
|
|
35
|
+
```bash
|
|
36
|
+
gem install rails
|
|
37
|
+
```
|
|
38
|
+
4. Create a new Spree application:
|
|
39
|
+
```bash
|
|
40
|
+
rails new my_store -m https://raw.githubusercontent.com/spree/spree/main/spree/template.rb
|
|
41
|
+
```
|
|
42
|
+
To use a specific database, pass the `-d` flag:
|
|
43
|
+
```bash
|
|
44
|
+
rails new my_store -d postgresql -m https://raw.githubusercontent.com/spree/spree/main/spree/template.rb
|
|
45
|
+
rails new my_store -d mysql -m https://raw.githubusercontent.com/spree/spree/main/spree/template.rb
|
|
46
|
+
```
|
|
47
|
+
5. Navigate to the application directory:
|
|
48
|
+
```bash
|
|
49
|
+
cd my_store
|
|
50
|
+
```
|
|
51
|
+
6. Start the development server:
|
|
52
|
+
```bash
|
|
53
|
+
bin/dev
|
|
54
|
+
```
|
|
55
|
+
7. Optionally load sample data (products, categories, etc.):
|
|
56
|
+
```bash
|
|
57
|
+
bin/rails spree_sample:load
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
> **INFO:** Spree works with **PostgreSQL**, **MySQL**, and **SQLite** databases. The Rails template defaults to SQLite for quick setup. You can switch to PostgreSQL or MySQL at any time. [Learn more about database configuration](/developer/deployment/database).
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
## Accessing Admin Panel
|
|
64
|
+
|
|
65
|
+
Navigate to [http://localhost:3000/admin](http://localhost:3000/admin) and log in with the default credentials:
|
|
66
|
+
|
|
67
|
+
| | |
|
|
68
|
+
|---|---|
|
|
69
|
+
| **Email** | `spree@example.com` |
|
|
70
|
+
| **Password** | `spree123` |
|
|
71
|
+
|
|
72
|
+
Upon successful authentication, you should see the admin screen:
|
|
73
|
+
|
|
74
|
+
<img src="/images/spree_admin_dashboard.png" />
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
Congrats! You've set up your Spree Commerce and it's looking amazing!
|
|
79
|
+
|
|
80
|
+
Give Spree a [GitHub Star](https://github.com/spree/spree), why dont't ya? Thank you for supporting Spree open-source!
|
|
81
|
+
|
|
82
|
+
Need support or want to give some feedback? Join our [community](https://slack.spreecommerce.org/) with 6000+ members or drop us an email at [hello@spreecommerce.org](mailto:hello@spreecommerce.org).
|