Over the past year, the City and County of Honolulu and Code for America pushed to make the city's data open to the public. The city has a tight budget and can only dedicate a small amount of resources to the creation of applications using this data, so opening it up allows people in the community to work with this data. Recently, they published a list of their available datasets online. These datasets include traffic data, parking structures, and lots more.
One of the datasets that was recently made available is a list of HI-5 redemption centers. Personally, I don't go out and redeem my bottles and cans very often. Like most people, I have a bin for these redeemable cans and bottles and take them to a redemption center when the bin is full. In my area, the redemption centers aren't always open. Some are only there on certain days of the week. Using the city's data, I wanted to create an app where I could see where the nearby redemption centers are and their hours. I also took this opportunity to use technologies I haven't really used before. My goal was to create an web application that used CoffeeScript on both the front-end and the back-end.
The front-end uses a combination of jQuery Mobile and Backbone.js. While I have used jQuery Mobile before, this is the first project where I used Backbone.js. Even though I've done a few tutorials with Backbone, I had some early struggles with getting it set up. It turns out it also doesn't play well with jQuery Mobile because they both want to do routing their own way. Fortunately, I found a blog post that shows how to disable jQuery Mobile's routing in favor of Backbone's.
For the backend, I chose to use Node.js and MongoDB. While I could use Backbone.js to get the recycling centers directly from the API provided by the city, I wanted to be able to calculate distance from a location, which could be expensive to do on the user's browser. Fortunately, MongoDB has built-in support for geospatial indexing, so I set up an index when I import the data from the city's API. Then, a simple query can get me the locations sorted by distance from a provided latitude and longitude. The Node.js server is just there to set up the first page of the application and serve as an API.
The app is hosted on Nodejitsu and is available at http://www.redeemhi5.com. The source code is also available on GitHub. Feedback is welcome. I already have a few features to work on when I have the time.