Code Monkey home page Code Monkey logo

spree's Introduction

SUMMARY

Spree is a complete open source commerce solution for Ruby on Rails. It was originally developed by Sean Schofield and is now maintained by a dedicated core team. You can find out more about by visiting the Spree e-commerce project page.

Spree actually consists of several different gems, each of which are maintained in a single repository and documented in a single set of online documentation. By requiring the Spree gem you automatically require all of the necessary dependency gems. Those gems are as follows:

  • spree_api
  • spree_auth
  • spree_core
  • spree_dash
  • spree_promotions
  • spree_sample

All of the gems are designed to work together to provide a fully functional e-commerce platform. It is also possible, however, to use only the pieces you are interested in. So for example, you could use just the barebones spree_core gem and perhaps combine it with your own custom authorization scheme instead of using spree_auth.

Using the Gem

Start by adding the gem to your existing Rails 3.x application's Gemfile

gem 'spree'

Update your bundle

bundle install

Then use the install generator to install all of the necessary migrations, assets, etc.

rails g spree:install

NOTE: This takes a while since its actually calling several generators (one for each of the dependencies) and apparently Rails generators are quite slow.

Now you just need to run the new migrations

rake db:migrate
rake db:seed

If you also want some sample products, orders, etc. to play with you can run the appropriate rake task.

rake db:sample

Browse Store

http://localhost:nnnn

Browse Admin Interface

http://localhost:nnnn/admin

Working with the edge source (latest and greatest features)

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

  1. Clone the git repo

     git clone git://github.com/railsdog/spree.git spree
     cd spree
    
  2. Install the gem dependencies

     bundle install
    
  3. Create a sanbox rails application for testing purposes

     rails new sandbox -m sample/sandbox_template.rb
     cd sandbox
    
  4. Generate the necessary Spree files

     rails g spree:install
    
  5. Bootstrap the database (run the migrations, create seed data, optionally load sample data.)

     rake db:migrate db:seed db:sample
    
  6. Start the server

     rails server
    

Running Tests

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.

rails new testapp -m spec/test_template.rb -T -J
cd testapp
rails g spree_core:install
rake db:migrate db:seed db:test:prepare

Then run the tests

rspec spec

Note that each project has its own generator for "installing." This basically sets up the test app with what it needs to run (primarily migrations.) So for the spree_auth gme, for example, you would use the following

rails g spree_auth:install

Contributing

Spree is an open source project. We encourage contributions. Please see the contributors guidelines before contributing. Do not send a Github pull request - it will be ignored.

spree's People

Contributors

adhlssu07 avatar akitaonrails avatar bdq avatar bmarini avatar bregor avatar bullrico avatar calas avatar cmaujean avatar crossblaim avatar davidnorth avatar docelic avatar dracito avatar edmundo avatar eliotsykes avatar fbrubacher avatar gregg avatar jonathantron avatar jonjensen avatar jseifer avatar maxendpoint avatar mguterl avatar paulcc avatar romul avatar schof avatar shadowmaru avatar sonny avatar spariev avatar swistak avatar timcase avatar wapcaplet avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.