Blog /Head First

March 06, 2008 18:11 +0000  |  Activism Programming 0

I know that I've been falling behind on the blogging lately. In fact, I think this is the longest dry spell I've ever had here. I'm going to chalk it up to adapting to the dramatic changes in my social, professional, and activist life resulting from my move out West. In an effort to deal with all of it though, I've made a conscious decision to prioritise the latter two to the detriment of the first. There's a considerable learning curve at work both technically and in terms of leadership, and my role with the VPSN is getting more exciting, so a strategy like this only seems appropriate.

The rest of this post is pretty technical, so if you don't read geek, you might just wanna skip it.

Donat currently has me working on a really cool project, for which I'm writing the most interesting part. We have multiple sites with the need to share user information between them, so for example, if you log into site A, change your profile to include a new favourite book, people looking at sites B, C, and D should be able to see that new book on your profile page there. Eventually it'll also track user relationships, group assignments etc., and it's all managed through my nifty API layer.

The layer uses a framework I wrote from scratch, but based loosely on the one used on this site, which in turn looks a little like Fusebox. The magic of the whole thing is that not only is everything built according to a strict MVC model, but because of this model, the View layer is able to output data in any format you like. Currently the framework supports standard XHTML, XML, JSON, TEXT, XMLRPC and SOAP, but it's infinitely extensible with limited overhead. On top of that, everything is managed through mod_rewrite so that the URLs are stupid-easy to reference:

  site.com/xml/user/add
  site.com/soap/user/get/someUserName
  site.com/json/user/getFriends/someUserName

I've been talking to the brass here at Donat about making the code available on my site to help other geeks shave time off research for something like this since it's a pretty common task in large-scale projects and there's no reason people should have to reinvent the wheel (like I had to), and they've been receptive. We'll see how it goes.

The VPSN has me working on a really exciting mapping project that plugs into GoogleMaps. It's based on a similar (but slightly improved) framework to the above, but I've dropped the XMLRPC and SOAP stuff in favour of a simpler REST-based setup. So what's this site going to do? Imagine pulling up an interactive map of Vancouver and being able to see any or all of the following:

  • All the bike lockers
  • Bike lanes
    • Rated by difficulty
  • CCTV cameras
    • Their range and model
  • Community gardens
  • Public parks
  • Green roofs

The list is long and growing and we'll be doing it all with a volunteer army and a few GPS units. A lot of the above data is already collected and I'm writing a CSV importer that'll geocode the addresses and map the data to a coordinate class. The data will then be pulled dynamically through an AJAX interface, redrawing the map for each element you request. This also means that if other people want to use or contribute to our data, it'll be available through simple REST URL. It's really exciting and it's been consuming pretty much every night these past few weeks.

The code for the VPSN will be GPL, but frankly, it's nothing novel. It was the SOAP & XMLRPC integration that made things nifty, so I do hope the brass at Donat come out in favour of me sharing that code.

Alright, that's it. I've got too much work to do and I've already burnt a considerable amount on this post.

Comments

Post a Comment

Markdown will work here, if you're into that sort of thing.