Awesome Open Source
Awesome Open Source
Sponsorship

Spark Starter Kit

Circle CI Maintainability

This is a starting point for all Spree/Rails related projects at Spark Solutions, it contains:

  • Ruby on Rails
  • Spree Commerce
  • Webpack via Webpacker gem
  • React with Redux

Installation

Install required tools and dependencies

Run setup script

bin/setup

Development

Running rails console

docker-compose run web rails c

Running tests

Before running the test suite remember to fire up docker-compose (if it's not running already):

docker-compose run web bash

And after that you can just use plain normal rspec:

bundle exec rspec

Adding new gems

Update Gemfile and run:

bundle install
docker-compose build

You will need to restart the server if running:

docker-compose restart

Updating gems

bundle update spree
docker-compose build

Conventions

Namespaces

  • Spree - Spree-specific models, controllers, services
  • SparkStarterKit - all custom-made models, controllers, services specifically for SparkStarterKit application

Using Dependencies system

Rather than writing decorators for Services please use dependency injecton.

Spree Decorators

All decorators should use Module.prepend pattern.

  1. Controllers

    Place them in app/controllers/spark_starter_kit/spree/home_controller_decorator.rb, eg.

    module SparkStarterKit
      module Spree
        module HomeControllerDecorator
          # ...
        end
      end
    end
    
    ::Spree::HomeController.prepend(SparkStarterKit::Spree::HomneControllerDecorator)
    
  2. Models

    Place them in app/models/spark_starter_kit/spree/product_decorator.rb, eg.

    module SparkStarterKit
      module Spree
        module ProductDecorator
          # ...
        end
      end
    end
    
    ::Spree::Product.prepend(SparkStarterKit::Spree::ProductDecorator)
    

License

Spark Starter Kit is copyright © 2015-2020 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

Spark Starter Kit 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.


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
ruby (12,147
react (4,756
redux (1,099
rails (618
ecommerce (185
commerce (22

Find Open Source By Browsing 7,000 Topics Across 59 Categories