Sinatra: 29 Links and Resources For A Quicker, Easier Way to Build Webapps

By Peter Cooper

Sinatra, a Ruby "micro framework" for developing Web applications, is hot stuff! Despite being over a year since we first mentioned Sinatra (as used on a 100 line blogging app called Reprise), only now does Sinatra seem to have reached critical mass - it's on the cusp of becoming really popular. This is a good time, then, to check it out and see where it could fit into your own projects (with the new Rails Metal functionality (in edge/2.3 only) you can ever run a Sinatra app as a lightweight companion integrated with your Rails apps!)

Sinatra's official homepage provides an incredible number of alluring examples. Just install the sinatra gem or clone its git repository and you can have an ultra basic webapp running in just five lines of code:

require ' rubygems ' require ' sinatra ' get ' / ' do ' Hello world! ' end

Lots of awesome articles about Sinatra, Sinatra apps, and various links and resources have cropped up over the past few months. The remainder of this post links to the best we've found - most of which you should find useful as you start to explore Sinatra in detail. If you know of any others, please post links in the comments! Of course, if you ultimately agree with Ross Lawley that Sinatra's a "horrid looking ruby web framework that looks its born straight from the worst PHP frameworks" then you might also want to check out Ramaze!

Tutorials and Presentations

Sinatra Applications

git-wiki - A "quick and dirty" Git-powered wiki built on Sinatra by Simon Rozet. frankie - Easy creation of Facebook applications in Ruby using plugin for Sinatra web framework that integrates with the Facebooker gem. rifgraf - "Fire-and-forget" data collection and graphing service by Adam Wiggins. Integrity - A continuous integration server (you can see it in action here). Karel Minarik billed its source as "probably the most elegant Ruby I have seen lately." gaze - A quick way to serve up Markdown files. sinatra_wiki - An "ultralight, ultraminimal" wiki system that uses Markdown for formatting. toopaste - A Pastie clone in Sinatra - uses DataMapper. notable - Listens on Jabber and then relays messages back to you (on the Web). rash - Extremely small and simple app to display results of a hashtag search on Twitter. snail - A Web interface to Amazon Web Services. yaml_micro_chat - A basic YAML-powered "micro-chat" system by Karel Minarik.

Deployment

capinatra - A tool to quickly deploy Sinatra apps to a Phusion Passenger installation Deploying Sinatra on Dreamhost with Passenger - A tutorial by John Nunemaker that shows how to use Capistrano and Dreamhost to deploy your Sinatra apps.

Sinatra Blogging Engines

Marley - A blog engine by Karel Minarik. It works by publishing posts that you write in your favorite text editor, stored as plain files. This link goes to a post that explains Marley's operation in detail - well worth looking at. scanty - A tiny blogging tool by Adam Wiggins. It uses Sequel for ORM, supports Ruby syntax highlighting, tags, and uses Markdown. wink - A "minimalist blogging engine" by Ryan Tomayko. No longer actively maintained (but you can fork it!) but it powers a few blogs. sin - A mini blog engine in Sinatra with hAtom and MetaWeblog API. All in a single file! Particularly interesting for the MetaWeblog API support. Uses Active Record.

Sites Built on Sinatra

Calendar About Nothing - A "Seinfeld Calendar" based upon public Github feeds. The principle is simple.. commit something to Github every day and you get a streak. Long streaks are celebrated. Hurrah! Follow Cost - Find out how annoying it will be to follow specific people on Twitter, as measured in milli-scobles! Stuff - A random collection of mostly Ruby stuff.. IRCLogger - A Sinatra based app that runs irclogger.com, a site that shows logs from several Ruby related IRC channels.

Thanks go to Karel Minarik of Restafari for supplying many of these links (as well as Simon Rozet with his list on Gist). Got your own? Leave a comment!

Support from: 1st Easy offers UK Rails hosting (dedicated and shared) running Phusion Passenger (mod_rails) and LAMP stack. If you want to get to know us first, or simply want to evaluate the performance of your Rails applications running on Passenger, we'll arrange a trial hosting account for you (full technical support included!)