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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Adds ability to generate Headless Sandbox application
Damian Legawiec85823a999e50
diff --git a/guides/src/content/developer/tutorials/developing_spree.md b/guides/src/content/developer/tutorials/developing_spree.mdindex c22caf50bf..7e805ac1cf 100644--- a/guides/src/content/developer/tutorials/developing_spree.md+++ b/guides/src/content/developer/tutorials/developing_spree.md@@ -41,6 +41,30 @@ Create a sandbox Rails application for testing purposes which automatically perfbundle exec rake sandbox```+For headless sandbox please run:++```shell+SPREE_HEADLESS=true bundle exec rake sandbox+```++By default Sandbox uses SQLite database. But you can switch to PostgreSQL:++```shell+DB=postgres bundle exec rake sandbox+```++or MySQL:++```shell+DB=mysql bundle exec rake sandbox+```++You can also combine those options:++```shell+SPREE_HEADLESS=true DB=postgres bundle exec rake sandbox+```+Start the server```shelldiff --git a/lib/sandbox.sh b/lib/sandbox.shindex dabd8363b6..a4f6915fbb 100755--- a/lib/sandbox.sh+++ b/lib/sandbox.sh@@ -50,11 +50,32 @@ elseSPREE_GATEWAY_GEM="gem 'spree_gateway', github: 'spree/spree_gateway', branch: 'master'"fi+if [ "$SPREE_HEADLESS" != "" ]; thencat <<RUBY >> Gemfile-gem 'spree', path: '..'+gem 'spree_core', path: '..'+gem 'spree_api', path: '..'+gem 'spree_backend', path: '..'+gem 'spree_sample', path: '..'+gem 'spree_cmd', path: '..'+$SPREE_AUTH_DEVISE_GEM$SPREE_GATEWAY_GEM+gem 'spree_i18n', github: 'spree-contrib/spree_i18n', branch: 'master'++group :test, :development do+ gem 'bullet'+ gem 'pry-byebug'+ gem 'awesome_print'+end++gem 'rack-cache'+RUBY+else+cat <<RUBY >> Gemfile+gem 'spree', path: '..'+$SPREE_AUTH_DEVISE_GEM+$SPREE_GATEWAY_GEMgem 'spree_i18n', github: 'spree-contrib/spree_i18n', branch: 'master'gem 'spree_static_content', github: 'spree-contrib/spree_static_content', branch: 'master'gem 'spree_related_products', github: 'spree-contrib/spree_related_products', branch: 'master'@@ -69,13 +90,14 @@ end# ExecJS runtimegem 'mini_racer'-gem 'rack-cache'-# temporary fix for sassc segfaults on ruby 3.0.0 on Mac OS Big Sur# this change fixes the issue:# https://github.com/sass/sassc-ruby/commit/04407faf6fbd400f1c9f72f752395e1dfa5865f7gem 'sassc', github: 'sass/sassc-ruby', branch: 'master'++gem 'rack-cache'RUBY+ficat <<RUBY >> config/environments/development.rbRails.application.config.hosts << /.*\.lvh\.me/@@ -88,6 +110,9 @@ bundle exec rails g spree:install --auto-accept --user_class=Spree::User --enforbundle exec rails g spree:mailers_previewbundle exec rails g spree:auth:installbundle exec rails g spree_gateway:install-bundle exec rails g spree_related_products:install-bundle exec rails g spree_static_content:install-bundle exec rails g spree_multi_domain:install++if [ "$SPREE_HEADLESS" == "" ]; then+ bundle exec rails g spree_related_products:install+ bundle exec rails g spree_static_content:install+ bundle exec rails g spree_multi_domain:install+fi