DEV Community

Abhinav Saxena
Abhinav Saxena

Posted on • Updated on • Originally published at abhinav.co

Scoop - a production-ready Sinatra boilerplate project

Bootstrap Sinatra projects using Corneal, Capistrano, Puma, and Nginx

Scoop - a production-ready Sinatra boilerplate project

Sinatra is a Ruby framework that helps you quickly create web applications, APIs and microservices. Its minimalism not only attracted a lot of developers, but it also inspired Flask in Python and Express in Node.js

If you are developing microservices or web APIs, Sinatra is a great choice. However, bootstraping a Sinatra project that is optimized for development speed as well as is easy to deploy has become non trivial because

  1. Documentation is not easy to find (you mostly find Ruby on Rails specific tips)
  2. You need to write code to set up and connect DB, manage migrations etc.
  3. You need to create a right directory structure yourself and configure it accordingly
  4. You also miss a boot file that you can use with console and with custom rake tasks/scripts
  5. Setting up projects for deployment is tedious and error prone, with a lot of details to be filled in for Capistrano, Puma and Nginx.

Scoop solves it by providing a good boilerplate that can be a starting point for your next project. It solves all the above mentioned problems and comes up with easy to edit configuration files that can help you correctly configure servers.

Scoop uses

  1. Corneal to make scaffolding models, controllers and views
  2. ActiveRecord as database ORM
  3. Capistrano for deployment
  4. Puma as app server
  5. Nginx as a proxy server

In addition,

  1. it is also JSON API ready with JSON, CORS and JSONP support already enabled,
  2. has a RoR like console, and
  3. comes up with example script and rake task that can be used to perform tasks that load the environment

Try Sinatra & Scoop by forking Scoop Repository. Scoop's README has detailed steps to set up development and production systems as well as the deployment process.

Please let me know in comments if you would want to try it out or have any suggestions - would love to improve the project.

Top comments (0)