Saturday, April 02, 2011 : Procrastinating about taxes

Last weekend, I was supposed to do my taxes.  But, I found a good way to procrastinate -- build a web application.  The result was, a site where you can boast about the Groupon deals you bagged. This weekend, I am procrastinating by blogging about it.

My wife and I are huge fans of Groupon.  Through Groupon, we have tried numerous great restaurants, taken flying lessons, taken swimming lessons, biked the bay, etc. etc.  We thought it will be cool to blog about our Groupon adventures.  Why make a static page, when you can make a web app!  And thus was born.  Please check out deal wall at

"Build" is not really the right word to describe my activities over the weekend.  It's more like cobble together.  There are so many fantastic technologies and libraries available today, that putting together a simple web application is quick, simple and frustration-free.  In the rest of this article, I will describe the technologies/libraries that helped me put together over a weekend.
    Where should I store my code? 
    imgres.jpegBefore writing any code, I needed a version control system.  I went with Mercurial hosted on Bitbucket.  The main reason I went with Mercurial/Bitbucket instead of git/github is that Bitbucket offers free private repositories.  I am extremely happy with Mercurial/Bitbucket, and do not miss git at all.

    What web framework should I use?  
    I went with Ruby on Rails.   I had played with Ruby On Rails a couple of years ago when I was a grad student.  These days,  I do a lot of programming in Python/Django at my day job. I like Ruby On Rails a lot more than Django.  Ruby On Rails just looks much nicer and has better libraries, which mitigate a lot of programming frustration. 

    Where do I store data?  
    imgres.jpegA year ago, the answer was obvious - a relational database like mysql.  Today, there are many nosql choices, which are very apt for web apps like the one I was cobbling together.  I went with mongoDB, mainly because of the absolutely positive experience I had with it at work.  It was super simple to install and use.
    I did consider building a CouchApp using CouchDB.  It  probably would have been a good fit for my simple app.  However, I wanted to finish the app over the weekend, and the learning curve associated with CouchDB would not have made that possible (based on my experience twiddling with CouchApps a few months ago).

    What object relational mapper should I use?  
    If I were using sql with Rails, the most obvious choice would have been Rails' own ActiveRecord.  But I was using MongoDB.  I choose lightweight Mongomatic instead of the more heavyweight Mongoid and Mongomapper ORMs. Mongomatic is a very thin layer on top of the mongodb ruby drivers.  Since this was my first mongoDB + Ruby On Rails app, I wanted to have full control over how and when data is stored and accessed.  Mongomatic is very simple to use, and works great for my app's very simple model -- a wall which has a list of deals within it.

    How do I make my web app look pretty?
    I am not good at making websites look professional.  So I needed all the help I can get. That's where Blueprint, Compass and Fancy-Buttons provide a lot of support.  Blueprint is a CSS framework that provides a grid on which you can easily align various page elements.  Along with nice-looking default typography and sane style defaults, Blueprint gives a jumpstart towards building a professional looking website.

    Compass is a stylesheet authoring framework that makes it easy to organize your CSS.  No more CSS files containing hundreds of lines.  Instead, Compass allows you to break up your CSS into smaller re-usable parts called plugins, and to compose them into bigger files just like you use #include in C++.  Fancy-buttons is a compass plugin that provides neat looking CSS buttons.  See for an excellent article on how to quickly design a professional looking web app.

    How do I make my app social?
    Super simple.  Copy some Javascript from the Facebook dev site to embed Facebook Like buttons and the new Facebook commenting system.  I also added a ShareThis widget to enable easy sharing through email, twitter, and other social-networking sites.

    Where do I host my app?

    imgres.jpgThe code has been written.  The design looks reasonable.  Everything has been checked into Bitbucket.  The next task is to host the app somewhere so that it is accessible to the world.  I first considered using the free Amazon EC2 instance.  Since I did not have time to set up the webserver and other software infrastructure needed to host a Ruby on Rails app, I chose a shortcut - Heroku.  Heroku is probably the easiest way to deploy a Ruby on Rails app.  It is a real gem -- extremely simple to signup and get my first app running.  The whole process took less than an hour.  Deploying an app is as simple as one command --  hg push git+ssh://  Since Heroku relies on git,  I had to install hg-git using the instructions at

    imgres.jpegBy default, Heroku offers postgres as the data store.  Since I was using mongoDB, I installed the mongoHQ add-on.  It took just one click.  I chose the free 16MB plan. If my app takes off, that won't be sufficient.  But I will worry about upgrading to the $5/month plan if and when my app takes off.  

    Where do I get my domain?
    imgres.jpgI got mine from GoDaddy, $8.99 for  This was the only part where I had to shell out real money.  I usually buy my domains through my hosting account at bluehost.  However, they don't sell .me domains.

    How do I make money?
    Yes, I have a plan to make money.  Ofcourse, this assumes that the app takes off :-).  I have signed up as a Groupon affiliate.  All links associated with the deals users post on their walls are linked back to Groupon through my affiliate link.  I also display the Groupon daily deal widget on the side of each wall.  Anytime someone buys a Groupon deal through, I make money.

    How do I get users for my app?
    So, if I want to make money, I need users (obviously!).  Right now, I have just asked a few friends to try the app out.  I am planning to publicize the app on Facebook, by "Liking" it and also by sharing my deal wall.  However, I am going to wait for a week or two.   Currently, the Facebook activity streams of everyone I know are inundated with messages about India's victory in the Cricket World Cup.  Notifications from my little app have absolutely no chance of getting noticed.

    This is a lesson I learnt when publishing my first Android app -- frync.  You need to publish at the right time.   When an app is published, it stays on the "Just In" list for at least a few hours.  I should have published the app just after Christmas, when everyone would have been playing with their new smart phones received as gifts.  The app would have been noticed much more and would have received more installs, just by virtue of being visible at the right time.  So this is a lesson learnt.

    What next?

    Doing my taxes, ofcourse.  As soon as I finish writing this blog entry.... and if I don't get distracted into more web app building.
    The app is running fine at  It is still hard to use.  Since Groupon (obviously) does not offer an API to retrieve a particular user's deals, users have to login to Groupon and then paste the HTML source of their All Groupons page into my app.  I am still thinking about how to make this process easier.  Don't understand what I am talking about?  Please try creating your wall at  If you have any ideas about how to make it better, please leave a comment.

    1 comment:

    Ajay said...

    The deals listed are no longer available.So if the deals are good it can frustrate users.(as it is no longer available).I reckon this must show more of real time deals and if possible private deals (apart from Groupon) which can readily shared among friends in FB.Lets say I find a deal in SnapDeal (Indianized Groupon) I must be able to share it in the FB using some good NLP APIs you can actually parse the right contents from the deal webpage and publish on your FB wall.(like deal title,summary and price savings)