• Stars
    star
    361
  • Rank 117,957 (Top 3 %)
  • Language
    Ruby
  • License
    BSD 3-Clause "New...
  • Created about 9 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

@spree application starter template

Spree Starter

This a dockerized Spree Commerce application template ready to for local development and deployment to cloud providers.

Deploy in the cloud

Using Heroku

Deploy

Using Render

Deploy to Render

Note that sample data does not automatically get loaded when deploying to Render with the default configuration. In order to add sample data, run the following commands in the web service shell:

bundle exec rails db:seed
bundle exec rake spree_sample:load

Deploying to Render with Spree Legacy Frontend

To deploy to render with the Spree Legacy Frontend, first follow the instructions in the legacy frontend ReadMe on adding the appropriate gems to your gemfile, and update the web service build command to use bin/render-build-legacy-frontend.sh, like so:

services:
  - type: web
    name: spree
    env: ruby
    buildCommand: "./bin/render-build-legacy-frontend.sh"

After that, you'll be ready to deploy to render.

Local Installation

Using Docker (Recommended)

Install required tools and dependencies:

Run setup script

bin/setup-docker

(Optional) Import sample data such as products, categories, etc

docker compose run web rake spree_sample:load

After the setup is finished, launch the webserver with:

bin/start-docker

Using Hybrid installation

Install required tools and dependencies:

Run setup script

bin/setup-hybrid

(Optional) Import sample data such as products, categories, etc

bundle exec rake spree_sample:load

After loading all docker dependencies launch local server with:

bin/start-hybrid

Without Docker (not recommended for beginners)

Install required tools and dependencies

  1. HomeBrew - https://brew.sh/

  2. Install required packages: GPG, PostgreSQL, Redis, ImageMagick, and VIPS

    brew install gpg postgresql redis imagemagick vips
    createuser -P -d postgres
  3. RVM - https://rvm.io/

  4. NVM - https://github.com/nvm-sh/nvm

  5. Ruby - rvm install 3.2.0

  6. Node - nvm install

  7. Yarn - npm -g install yarn

Run setup script

bin/setup-no-docker

Adding Storefront

Spree is a headless e-commerce platform which you can use with any storefront you like. We have pre-built integrations with:

Updating

Connect to the docker container

docker compose run web bash

Run update commands

bundle update
bin/rails spree:install:migrations
bin/rails db:migrate

For additional instructions please visit Spree Upgrade Guides

Development

Launching rails console

docker compose run web rails c

Launching bash console

docker compose run web bash

Customization

Adding new gems

Update Gemfile and run

bundle install
docker compose build

You will need to restart the server if running:

docker compose restart

Environment variables

variable description default value
DEBUG_ASSETS Enables/disables asset debugging in development false
DB_POOL database connection pool 5
MEMCACHED_POOL_SIZE memcache connection pool 5
SENDGRID_API_KEY API key to interface Sendgrid API

Troubleshooting

libvips error

If you are building the application using the latest code, you may encounter the following libvips error:

LoadError: Could not open library 'vips.so.42'

This error is usually an indication that you do not have libvips installed locally on your machine. Check that libvips is installed with vips -v, and if it is not installed, follow installation instructions here.

disabled 'Add to Cart' button

This issue is specific to running with spree_legacy_frontend.

If you notice that the 'Add to Cart' button is disabled on product pages, try the troubleshooting instructions found in the spree_legacy_frontend ReadMe.

uninitialized constant Spree::Preference (NameError)

If upgrading your spree app to Rails 7, you may run into the following error:

/lib/spree/core/preferences/store.rb:96:in `should_persist?': 
uninitialized constant Spree::Preference (NameError)

To fix this error, you'll need to update your spree config initializer. In config/initializers/spree.rb, wrap the Spree.config block in a Rails.application.config.after_initialize block, like so:

Rails.application.config.after_initialize do
  Spree.config do |config|
    # config settings initialized here
  end
end

License

Spree Starter (formerly Spark Starter Kit) is copyright Β© 2015-2021 Spark Solutions Sp. z o.o.. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About Spark Solutions

Spark Solutions

Spree Starter is maintained and funded by Spark Solutions Sp. z o.o. The names and logos are trademarks of Spark Solutions Sp. z o.o.

We are passionate about open source software. We are available for hire.

More Repositories

1

spree

An open source eCommerce platform giving you full control and customizability. Modular and API-first. Build any eCommerce solution that your business requires. Developed by @vendo-dev
Ruby
12,821
star
2

spree_gateway

Huge collection of payment gateways for @spree. Stripe, Braintree, Apple Pay, Authorize.net and many others!
Ruby
219
star
3

spree_auth_devise

Provides authentication (user accounts, login & signup) for @spree by using Devise
Ruby
137
star
4

spree-api-v2-js-sdk

Spree Storefront API JavaScript / TypeScript SDK
TypeScript
104
star
5

spree-guides

Official Spree Documentation
CSS
88
star
6

spree_backend

Spree Admin Dashboard
Ruby
33
star
7

spree_wombat

Connect your Spree Commerce storefront to Wombat
Ruby
31
star
8

spree_gift_cards

Ruby
18
star
9

spree_rails_frontend

Spree Commerce Storefront built with Rails and Turbo/Hotwire
Ruby
17
star
10

amazon_endpoint

Ruby
12
star
11

spree_share

Share products with others via social networking (Facebook,Twitter, etc.)
Ruby
9
star
12

deployment_service_puppet

Ruby
8
star
13

endpoint_base

Ruby
7
star
14

spree-dev-docs

Spree Commerce Developer Documentation - https://dev-docs.spreecommerce.org
7
star
15

abandoned_carts_endpoint

Ruby
6
star
16

spreebot

Automated bot designed for helping out the Spree community
Ruby
6
star
17

spree_dev_tools

Spree Developer Tools
Ruby
5
star
18

api.spreecommerce.com

JavaScript
4
star
19

deployment_service_website

Deployment Service web interface extracted from spreecommerce.com
Ruby
4
star
20

hub_gem

Helper gem to help communication between a Spree Commerce storefront and hub
Ruby
3
star
21

google_analytics_endpoint

Ruby
3
star
22

spree_pro_connector

Ruby
2
star
23

desk_endpoint

Spree Commerce hub integration for Desk.com
Ruby
2
star
24

spree_hub_connector

Connects your storefront to the SpreeCommerce hub.
CSS
2
star
25

integration_tutorials

Ruby
2
star
26

spree_extension

Common tools and helpers for Spree Extensions developers
Ruby
2
star
27

spree-user-docs

1
star
28

spree_cli_data

1
star
29

smtp_endpoint

Ruby
1
star
30

spree-guides-gatsby

Old Spree Guides, please visit https://dev-docs.spreecommerce.org instead
JavaScript
1
star
31

spree_cli

TypeScript
1
star
32

spree_api_v1

Legacy Spree v1 API extracted from spree_api gem
Ruby
1
star