Burning ideas in cooperation with Compojure and Backbone.js

Previous week I wrote my first application using Backbone.js and Compojure.

Compojure is a web framework written in Clojure.

My application, which code name is Burning Ideas, is very simple and it does not even allow to create user accounts neither sessions. It allows multiple users to brainstorm together and somehow rate their ideas. Rating of ideas will decrease with time. All users are brainstorming together (for now ;))

Burning Ideas screenshot

Code base is available at github. I will write about some conclusions from this not yet finished project.

My first attempt was to use SproutCore. After writing some frontend code I resigned as I found it quite inconvenient to use my custom html markup there. I switched to Backbone.js.

Backbone.js is very simple, clear and understandable. Well, at least for somebody with my backgrounds. Out of the box, it talks to restful JSON APIs which are easily implementable using majority of modern web frameworks. It uses jQuery which I also found very cool.

Compojure is also very simple and clear. It is rather Sinatra than Rails but it does its job. For development I used leiningen with some plugins which bootstraps clojure project and allows to perform different tasks on it. We can run our server with simple command:

lein ring server

What amazed me, it can also prepare war file automatically:

lein ring uberwar

This allowed me to deploy application using CloudBees in a few clicks. As I prefer Sass, Haml and CoffeeScript I used Sprockets for compiling and serving my assets in development mode.

I found myself quite productive using Compojure / Backbone combination and will definitely use it more in the future.

Feel free to submit any feedback or write about your experience with Backbone.js and Compojure.

Leave a comment