Reblogged and edited with permission from Doing It Right by Anil Maurya.
It was time for another Rails Rumble event, and I was looking for Ideas what to build. Through one of coding competition I had come across a problem in which you have to write an algorithm to outbid the computer. I am (and have always been) a fan of Computer Games, so why not build a Game based on this problem?
Rails Rumble was the ideal stage – it is a 48 hrs coding competition in which you have to build a Rails application from scratch.
At this point, I knew what to build and which framework to use, but I didn’t know how to build it or even if it’s possible in Rails, so I presented my idea at Open Source Friday. I ran my idea on white board and played a demo with Gautam Rege) on the white board. People liked the idea and suggested some changes and discussed how it can be done. Sanjiv Jha got interested in this game and joined me in this journey.
The day of competition arrived 19 Oct 2013. Sanjiv and I coded 2 days at a stretch. The tech stack we used in Bidder was Ruby 2, Rails 4, Bootstrap 2.3, JQuery 1.9. We used Pusher for broadcasting and receiving real time notifications. Although we didn’t win the competition, we had a great experience.
Bidder didn’t end with the competition, we took it to next level. We open sourced Bidder on github https://github.com/anilmaurya/bidder and asked our colleagues to contribute to it. In one of Open Source Friday we discussed Bidder Issues and took feedback from ruby hackers.
Now, after all this hacking on Bidder it was time to check how Bidder will scale. We organised a Bidder event on Friday evening and invited all rubyist in the city to play Bidder. Of course there was a prize for ultimate winner. Around 25 rubyist played Bidder in this event. Rishi Jain joined in and helped us organizing this event . Pratik Shah won this event beating Sandip Ransing in Final.
This event taught us many things that we had under-estimated like Pusher limitations on requests (we were using Pusher in free mode). This also made us think about cases if the internet is slow or there is no internet; and most important, some serious issues were discovered in this event.
Now we knew that Pusher can’t handle more than 4 users (10 connections) at a time, we had to look for alternatives. Jiren Patel come to rescue us and suggested to use Slanger – an open source implementation of Pusher.
Moving from Pusher to Slanger is really easy if you know how to setup Redis server on cloud. No need to change your code. We hosted Slanger on Amazon EC2(free version) with help from Shailesh Patil. After shifting to Slanger we can easily handle 25 users at time.
Men are mortal. So are ideas. An idea needs propagation as much as a plant needs watering. Otherwise both will wither and die.
B. R. Ambedkar
Ruby Conferences are the best platform to share Ideas among rubyist. RubyConf India 2014 was to be held in about one month, we took the opportunity to share Bidder with every rubyist out there. We got a booth outside Conference hall to showcase our Game. Thanks to Josh Software for sponsoring T-shirts for bidder winner and arranging us booth. This was our Flyer outside Conference Hall.
We hosted 70 knockout Games and distributed 35 T-shirts to winners, response at RubyConf was overwhelming. Pramod Shinde, Aditya Shedge and Siva Gollapalli helped us in organizing this.
So far it has been a great journey and thanks to everyone who joined us in this journey and made it more awesome. We will be looking for more rubyists to join in.
Source code of bidder is on Github.
Play Bidder