So you’re probably wondering how all that magic works? Let’s dive in.
Spree is a Ruby on Rails Engine, which means it’s an application that provides functionality to their host applications (that is your store application).
Spree is a collection of Models, Views and Controllers that your application gains access when you install Spree. You can easily combine Spree with any Ruby on Rails application meaning you can add e-commerce capabilities to your existing RoR applications.
All Spree models, controllers and other classes are namespaced by the
Spree keyword, eg.
Spree::Product. This means that those files are also located in
spree sub-directories eg. app/models/spree/product.rb.
Spree is divided into several modules / gems which you can opt-out if you would like. Installing Spree via Spree Starter gives you access to all of Spree features such as Stoprefront, API and Admin Panel. Not all of the modules are required, eg. headless installations will not require Storefront at all.
|api||REST API for your Store||no*|
|backend||Admin Panel UI||no|
|core||Models, Services and libraries||yes|
|sample||Sample seed data||no|
There are many other Spree-gems providing additional functionality to your Store called Extensions.
To change which Spree gems you would like to install you will need to modify your project
gem 'spree_api' gem 'spree_backend'
After changing the Gemfile please run
or if you’re using Spree Starter: