This week, thanks to the hard work of our CEO Damian Legawiec, we have open sourced our very own kick-off bundle which we use as a starting point for all eCommerce and Rails related projects at Spark Solutions.
The spark-starter-kit is available on GitHub and should be very helpful not only to Spree developers, but to anyone who is seeking a reliable platform for a scalable online store. Quick and easy setup makes the repository a remarkable ready-to-develop foundation, which is packed with all of the newest technologies shortening time-to-value for your client or yourself.
Goodies inside the repo:
- Ruby on Rails 4.2 – the MVC framework of our choice
- Spree Commerce 3.0 – a fully featured open source e-commerce solution
- Webpack – module bundler for asset bundling (JS/CSS/Sass/images) with Hot Reload
- ReactJS – the View of our MVC with Hot Reload, Redux, React-router and server side rendering via therubyracer and react-rails gem
- SPA frontend + classic rails views (simple layout switcher)haml as a template engine for rails views
- haml as a template engine for rails views
What is different?
Say goodbye to Assets-Pipeline
Why use the confusing Assets-Pipeline when you have the Webpack and possibility to finally manage all the assets from one central point? Moving all JS, CSS and image references to the client allow us to keep all frontend related files in one place.
Say hello to Hot Reload
Another motivation to move all assets to one central point was the ability to use Hot Reload with them. Now saving a file, while developing on a running server will have reload the changes without the need of refreshing the page. It is very helpful when working on some React code!
No more ‘rails -s’ – forman FTW
Because the bundle is not only working with Rrails, but also dependent on node.js we suggest using forman to run all servers with one simple command. The pack already contains the prepared procfiles.
Easy deployment on Heroku
The repository is prepared for Heroku deployment with assets hosting on Amazon S3 for production and Amazon Cloudfront as a CDN.
Just make sure that before the first deploy, in the project directory you run:
heroku buildpacks:add heroku/nodejs
heroku buildpacks:add heroku/ruby
heroku buildpacks:add https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks
… and that’s it! Now go on and get it on GitHub!