Wednesday, August 3, 2011

CouchBoard - Porting a ROR/JQuery application to CouchDB/JQuery

Looking for a replacement for our small company Scrummy taskboard I stumbled over CognifidesLabs Taskboard Ruby On Rails (ROR) application. It looked useful but it seemed stale and being a complete ROR imbecile and a JavaScript novice I initially gave up as the entry threshold just seemed to big.

But after fooling around with CouchDB in another context I realized that maybe I could scrap the entire ROR backend as the data exchange format was JSON and just port the http requests to the ROR backend to CouchDB JavaScript.

At first this seemed as a daunting task as most tutorials etc. for doing CouchDB application development uses couchapp so even a simple task as figuring out how to port the login logic was hard. Eventually I found couchdb-login-jquery and from there on the porting job was as easy a calling the CouchDB JavaScript CRUD functions.

The ROR back end is approximately 1700 lines of Ruby code this was exchanged for an additional 200 lines of JavaScript. For somebody used to setting up Eclipse, Maven, Tomcat, Spring, Spring Security, PostgreSQL just to get started it seems unreal to just use a text editor, reupholster and Firefox/Firebug for the entire developmet process.

On top of this all that is needed to host the application is a free account at cloudant where you get a scalable, fault-tolerant, distributed database to host your applications in.

In summary porting the ROR backend to pure CouchDB/JavaScript was surprisingly easy. The most diffuclt part was acctual to understand the CouchDB security model and then learn that the cloudant (BigCouch) model was incompatible.

In case you need a small and simple to manage scrum/kanban board you can get the code from here and you can test the application here

No comments:

Live Traffic Map