Skip to content
Spree is a complete open source e-commerce solution for Ruby on Rails.
Ruby HTML CSS JavaScript CoffeeScript Shell
Failed to load latest commit information.
api Changed version of versioncake to 3.1.0, updated engine and spec config. Apr 30, 2016
backend Adds missing media tag to main stylesheet in admin panel (#7385) May 29, 2016
cmd add rake task `test_app` for cmd gem May 9, 2016
core Updates pre_tax_total for items without tax rates (#7357) May 29, 2016
frontend update canonical-rails to 0.1.0 May 25, 2016
guides Removing Spree CMD installer instructions from guides Apr 9, 2016
lib use spree-state_machine. Jan 15, 2015
sample samples fix - product properties May 4, 2016
.editorconfig Reduce hound spam. Apr 22, 2015
.gitignore Cleanup i18n duplication. Dec 23, 2014
.hound.yml point houndCI to our local rubocop.yml Nov 20, 2014
.rubocop.yml rubocop fix: TrailingComma is deprecated Feb 7, 2016
.teatro.yml Fix teatro assets compiling Nov 26, 2014
.travis.yml Bump ruby version for CI. Jan 13, 2015
CHANGELOG.md Tweak formatting. Jul 24, 2015
CODE_OF_CONDUCT.md add code of conduct from contributor covenant v1.2 Jul 23, 2015
CONTRIBUTING.md Fix documentation links. May 13, 2015
Gemfile Isolate each component of Spree Mar 21, 2012
README.md Update README.md May 12, 2016
Rakefile SPREE_VERSION removed, total cleanup of gemspecs and rakefiles, spree… Feb 28, 2016
build-ci.rb silencing migrations & asset compilation output for builds on CI - mo… Mar 2, 2016
build.sh Fix build.sh Jan 27, 2016
circle.yml add support for circleci with ruby 2.2.4 Feb 1, 2016
common_spree_dependencies.rb FactoryGirl updated to 4.7.0 Apr 14, 2016
license.md Update year range to 2016 Jan 16, 2016
spree.gemspec SPREE_VERSION removed, total cleanup of gemspecs and rakefiles, spree… Feb 28, 2016
spree_logo.png new streamlined README.md without spree installer Mar 11, 2016

README.md

Spree

Circle CI Code Climate codebeat Slack Status Issue Stats Issue Stats

Spree is a complete open source e-commerce solution built with Ruby on Rails. It was originally developed by Sean Schofield and is now maintained by developers from Spark Solutions and Vinsol. We're open to contributions and accepting new Core Team members.

Spree consists of several different gems, each of which are maintained in a single repository and documented in a single set of online documentation.

  • spree_api (RESTful API)
  • spree_frontend (Customer frontend)
  • spree_backend (Admin panel)
  • spree_cmd (Command-line tools)
  • spree_core (Models & Mailers, the basic components of Spree that it can't run without)
  • spree_sample (Sample data)

Getting Started

required rails rails (~> 4.2.6)

Add Spree gems to your Gemfile:

gem 'spree', '~> 3.1.0.rc1'
gem 'spree_auth_devise', '~> 3.1.0.rc1'
gem 'spree_gateway', '~> 3.1.0.rc1'

Run bundle install

Use the install generators to set up Spree:

rails g spree:install --user_class=Spree::User
rails g spree:auth:install
rails g spree_gateway:install

Installation options

Alternatively, if you want to use the bleeding edge version of Spree, add this to your Gemfile:

gem 'spree', github: 'spree/spree'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise'
gem 'spree_gateway', github: 'spree/spree_gateway'

Note: The master branch is not guaranteed to ever be in a fully functioning state. It is unwise to use this branch in a production system you care deeply about.

By default, the installation generator (rails g spree:install) will run migrations as well as adding seed and sample data. This can be disabled using

rails g spree:install --migrate=false --sample=false --seed=false

You can always perform any of these steps later by using these commands.

bundle exec rake railties:install:migrations
bundle exec rake db:migrate
bundle exec rake db:seed
bundle exec rake spree_sample:load

Browse Store

http://localhost:3000

Browse Admin Interface

http://localhost:3000/admin

Performance

You may notice that your Spree store runs slowly in development enviornment. This can be because in development each asset (css and javascript) is loaded separately. You can disable it by adding the following line to config/environments/development.rb.

config.assets.debug = false

Developing Spree

Spree is meant to be run within the context of Rails application and the source code is essentially a collection of gems. You can easily create a sandbox application inside of your cloned source directory for testing purposes.

Clone the Git repo

git clone git://github.com/spree/spree.git
cd spree

Install the gem dependencies

bundle install

Sandbox

Create a sandbox Rails application for testing purposes which automatically perform all necessary database setup

bundle exec rake sandbox

Start the server

cd sandbox
rails server

Running Tests

We use CircleCI to run the tests for Spree.

You can see the build statuses at https://circleci.com/gh/spree/spree.


Each gem contains its own series of tests, and for each directory, you need to do a quick one-time creation of a test application and then you can use it to run the tests. For example, to run the tests for the core project.

cd core
bundle exec rake test_app
bundle exec rspec spec

If you would like to run specs against a particular database you may specify the dummy apps database, which defaults to sqlite3.

DB=postgres bundle exec rake test_app

If you want to run specs for only a single spec file

bundle exec rspec spec/models/spree/state_spec.rb

If you want to run a particular line of spec

bundle exec rspec spec/models/spree/state_spec.rb:7

You can also enable fail fast in order to stop tests at the first failure

FAIL_FAST=true bundle exec rspec spec/models/state_spec.rb

If you want to run the simplecov code coverage report

COVERAGE=true bundle exec rspec spec

If you're working on multiple facets of Spree to test, please ensure that you have a postgres user:

createuser -s -r postgres

And also ensure that you have PhantomJS installed as well:

brew update && brew install phantomjs

To execute all the tests, you may want to run this command at the root of the Spree project to generate test applications and run specs for all the facets:

bash build.sh

Contributing

Spree is an open source project and we encourage contributions. Please review the contributing guidelines before contributing.

In the spirit of free software, everyone is encouraged to help improve this project.

Here are some ways you can contribute:

License

Spree is released under the New BSD License.

Something went wrong with that request. Please try again.