arissetyawan / spark-starter-kit

Rails, @spree, React, Redux, ES6, Webpack

Home Page:https://sparksolutions.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Rails, @spree, React, Redux, ES6, Webpack

https://sparksolutions.co

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Ruby 95.5%Language:JavaScript 2.6%Language:HTML 1.7%Language:CSS 0.2%