Spree

Nowadays, there are many e-commerce websites. There are more and more e-commerce development platforms. Among them, Spree Ecommerce is becoming more and more chosen

There are many reasons to choose Spree, such as: fast and simple installation, easy to use, many templates, optimized for PC, tablet, phone, etc. However, in my opinion there are 3 reasons. Main reasons for Spree being used a lot:

The interface is designed to be user-oriented, built on the views and buying habits of customers. Simple and easy payment, all payments are processed at Spree

Ability to develop and upgrade. Spree is quite easy to customize, can extend the system

Detailed instruction manual. At https://spreecommerce.com/ you can find documentation for both developers and users

There are many e-commerce development platforms available today. However, until now Magento is still the most used platform. So in this article I will give some comparison between Magento and Spree

Source code: Both Spree and Magento offer open source versions. With Magento being Magento Community Edition (CE), Spree is also an open source platform. However, Spree is more reliable than Magento’s community version even though the 2 have almost the same functionality.

Management: Spree manages more efficiently, has fewer tabs and sub-menus, is more streamlined and focused

Line of code: Magento has more than 8.2 million lines of code and Spree has only about 45000 lines.

Request handling: Spree can handle more than twice as many requests per second as Magento, with an average response time of 413ms.

Payment: Spree can support more than 125 payment gateways, and Magento has about 75 payment gateways

Installing Spree Ecommerce is extremely fast and simple. First you need to add the following lines and Gemfile and bundle install:

 gem ‘spree’, ‘~> 3.1.0’

 gem ‘spree_auth_devise’, ‘~> 3.1.0’

 gem ‘spree_gateway’, ‘~> 3.1.0’

 

Next run the lines below to set up Spree:

  rails g spree:install –user_class=Spree::User

  rails g spree:auth:install

  rails g spree_gateway:install

 

Spree assists users in generating data for first run:

  bundle exec rake db:migrate

  bundle exec rake db:seed

  bundle exec rake spree_sample:load

link :https://viblo.asia/p/tim-hieu-ve-spree-ecommerce-DZrGNDNWkVB

 

Interface homepage:

What is Spree Commerce?

Spree Commerce (also known as Spree) is an open-source framework targeted at e-commerce resources. In essence, this is just a free codebase that web developers can use to build beautiful online stores of any complexity.

The platform was created by Sean Schofield in 2007; since then it has managed to gain great popularity: the number of Spree Commerce developers is increasing year by year (along with the number of framework’s downloads). In July 2011, AOL and True Ventures invested $ 1.5 million in Spree, and their financial contribution served as a new breakthrough for the project.

Overview of Spree Commerce Features

  • Headless Commerce – build mobile apps or custom storefronts in any technology, JS/TS SDK available
  • PWA – offline shopping experiences like native mobile apps
  • Global Commerce – multi currency and multi language support out of the box, different shipping methods / costs for different regions, advanced tax calculation
  • Multi-Store – host multiple brands / stores on one Spree instance with different branding, configuration, payment methods, shipping options, product catalogs etc
  • Multi-vendor marketplace – run your own marketplace with multiple suppliers with dedicated Supplier Dashboard
  • Responsive Admin Panel – manage and curate products, users, orders, returns, shipments & more
  • Orders – robust system for orders, shipments, returns and refunds
  • Carts – comprehensive and advanced discounts system
  • Payments – over 30 payment provider integration out of the box plus API to integrate any other gateway
  • Run everywhere – cloud, VPS, Docker, Kubernetes
  • Battle Tested – used by thousands of merchants around the globe in all categories since 2007!
  • Fully customizable – pick and choose parts you want to use and customize everything else (storefront, order processing, API, etc) to create unique solutions that your business requires
  • More features available via extensions – dozens of extensions built by community, ready for use for free!

 

Integration Flexibility

Spree Commerce features aren’t limited to payment tools and allow to integrate other third-party solutions either. Such as… 

Prerequisites

Before starting this tutorial, make sure you have Ruby and RubyGems installed on your system. This is fairly straightforward, but differs depending on which operating system you use.

By following this tutorial, you will create a simple Spree project called mystore. Before you can start building the application, you need to make sure that you have Rails itself installed.

To run Spree 2.3 you need the latest Rails version, 4.1.2.

 Installing Rails

In most cases, the easiest way to install Rails is to take advantage of RubyGems:

$ gem install rails -v 4.1.2

 

 Installing Bundler

Bundler is the current standard for maintaining Ruby gem dependencies. It is recommended that you have a decent working knowledge of Bundler and how it used within Rails before attempting to install Spree. You can install Bundler using the following command:

$ gem install bundler

 

 Installing Image Magick

Spree also uses the ImageMagick library for manipulating images. Using this library allows for automatic resizing of product images and the creation of product image thumbnails. ImageMagick is not a Rubygem and it can be a bit tricky to install. There are, however, several excellent sources of information on the Web for how to install it. A basic Google search should help you if you get stuck.

If you are using OSX, a recommended approach is to install ImageMagick using Homebrew. This can be done with the following command:

$ brew install imagemagick

 

If you are using Unix or Windows check out Imagemagick.org for more detailed instructions on how to setup ImageMagick for your particular system.

 Installing Spree

The easiest way to get Spree setup is by installing the spree_cmd gem. This can be done with the following command:

$ gem install spree_cmd

 

 Creating a New Spree Project

The distribution of Spree as a Rubygem allows it to be used in a new Rails project or added to an existing Rails project. This guide will assume you are creating a brand new store and will walk you through the process, starting with the creation of a new Rails application.

 Creating the Rails Application

Let’s start by creating a standard Rails application using the following command:

$ rails _4.1.2_ new mystore

 Adding Spree to Your Rails Application

Now that we have a basic Rails application we can add Spree to it. This approach would also work with existing Rails applications that have been around for a long time (assuming they are using the correct version of Rails.)

After you create the store application, switch to its folder to continue work directly in that application:

$ cd mystore

 

Add the following lines and Gemfile and bundle install:

 gem ‘spree’, ‘~> 3.1.0’

 gem ‘spree_auth_devise’, ‘~> 3.1.0’

 gem ‘spree_gateway’, ‘~> 3.1.0’

Run command to install Spree to the project

bundle install

Note: Maybe you are using Rails 5.0 so it may cause an error when bundle install will cause you to run the following command bundle update

Basic Settings for Spree

rails g spree:install user_class=Spree::User

 

If successful you will get the following:

Devise.secret_key = “a6f8cc232fe9219e5d1bdfaaa7cd03934c6e412f608ba380f881cb75477b1568e232e4d0d308d10a6c4f237f00c4c4c5e871”

Running via Spring preloader in process 10313

      create  config/initializers/spree.rb

      append  public/robots.txt

      create  vendor/assets/javascripts/spree/frontend

      create  vendor/assets/javascripts/spree/backend

      create  vendor/assets/stylesheets/spree/frontend

      create  vendor/assets/stylesheets/spree/backend

      create  vendor/assets/images/spree/frontend

      create  vendor/assets/images/spree/backend

      create  vendor/assets/javascripts/spree/frontend/all.js

      create  vendor/assets/stylesheets/spree/frontend/all.css

      create  vendor/assets/javascripts/spree/backend/all.js

      create  vendor/assets/stylesheets/spree/backend/all.css

      create  app/overrides

      append  db/seeds.rb

     copying  migrations

    creating  database

     running  migrations

    loading  seed data

        rake  db:seed 

Create config for Spree config/initializers/spree.rb

Spree.config do |config|

  # Example:

  # Uncomment to stop tracking inventory levels in the application

  # config.track_inventory_levels = false

end

 

Spree.user_class = “Spree::User”

 

  • Create interface for spree with full javascript, css . . .
  • Create migrations
  • Create databases
  • Create sample data for project
  • Create admin account for project use gem device

Email [spree@example.com]: giang.phan1106@gmail.com`

Password [spree123]:

Install gateway for Spree

rails g spree_gateway:install

Now let’s add Spree to our Rails application:

$ spree install –auto-accept

link : https://agilie.com/en/blog/7-reasons-to-choose-spree-commerce-for-your-online-store

 

link : https://spree-guide-2-3-x.hoshinotsuyoshi.com/developer/getting_started_tutorial.html

Buy us some coffee Thank You for your support as we work to give you the best of guides and articles.

 

top