Sinatra, MongoDB + Heroku base application
A simple Sinatra application with a number of popular gems: Rspec, Cucumber, Capybara, Mongoid for MongoDB, Slim, Sass
| 0 comments
I recently created a simple base application I can use for rapid prototyping applications. It's a simple Sinatra application with a number of popular gems installed and configured to work.
For the database I've decided to use MongoDB and the Mongoid gem. When prototyping an application it's common to need to change the database frequently and MongoDB allows me to do that without the need of generating migrations and keeping the DB schema in the model layer. There's a models folder in the application root which is loaded in via the Application file so you have access to your models.
For the views I've gone for slim as the templating language over haml as it's much lighter and faster than haml, haml is also included as I've used sass for the css templates. jQuery 1.5.1 is included in the layout from Google.
For testing I've gone for both RSpec 2 and Cucumber with Capybara. I've been a big fan of RSpec for over a year now and use it on all my Rails projects. Cucumber is a newer concept to myself but it's again another framework I'm quite passionate about.
Since I think releasing an application, even if only for testing, often is a good idea I've setup the MongoDB settings to use MongoHQ via Heroku . Heroku is an amazing deployment environment and this base Sinatra application is setup and ready for deployment.
You can view the application here: http://sinatra-base.heroku.com
And the code is fully available on Github: https://github.com/sprysoft/sinatra_base
I'm hoping to start adding a few features over the next couple of weeks for generating a model with simple CRUD capabilities via a REST interface.