Is anything wrong with using Sinatra to develop a full website? Is anything wrong with using Sinatra to develop a full website? ruby ruby

Is anything wrong with using Sinatra to develop a full website?


I've built my last two fairly complex projects using Sinatra and have enjoyed the process. What I like is that it encourages you to consider the API of the web application you are building up-front rather than as an afterthought.

What I tend to do now is get the API working and tested and then build the browser-facing front-end using jQuery. All interaction between the front end and the back is done via the API.

By breaking out helper methods into separate libraries and taking advantage of Ruby on Rails libs like ActiveRecord etc I find the code is no harder to maintain than any other code I have written, and it's certainly easy to test.

I've written some simple generic routes that allow me to cluster page level content (either written in markdown, textile, or haml) using similar ideas to the Nesta project which means that 99% of my routes are API calls rather than page-display calls. I've added some neat helpers for rule based navigation construction too that really help too.

So in short the answer is no, there is nothing wrong with building large websites with Sinatra, and in fact I believe it can lead to better designed web applications.


Building a Big site with Sinatra will not face you with scaling problems, but will definitely give u a very hard time maintaining code. Although i love Sinatra, convention over configuration in rails wins hands down. Also note that it isnt wrong/bad/impossible to use Sinatra for a huge site, just that it is hard doing it right and you would not want yourself regretting later. If you still are stubborn in using Sinatra you can try Padrino which is basically a wrapper over Sinatra(I have never used it so cant help you about that)