Going Down The Rabbit Hole

16 commentsWritten on July 10th, 2011 by
Categories: JavaScript

I've been wanting to work on a breakable toy project for a while now, and now i finally have enough spare time to spend on it. The objective of the project isn't very interesting: i just want to be able to generate invoices and timesheets for a task/project for a customer, and i want them in PDF format. I want to be able to do this from an easy-to-use web interface, and later on i want to add a mobile version of that interface to the project. I know there are tools available to do this but the whole point is to learn how to use new technologies, which is why i went with some interesting technological choices.

On the server, i'm going to use Node with Express as the web-development framework. For data storage, i'm going with MongoDB. On the client, i'll probably use jQuery (and later on, jQuery Mobile) together with Backbone. I want to test both the server-code and the client-code with a mixture of Jasmine and QUnit.

I want the resulting code to be clean, working, and fully tested. Of course, due to the fact that every technology i'm going to use (except for jQuery) is entirely new to me, this is going to be a bit of a challenge. I'm going to make tons of mistakes and i'm assuming that there will be continuous refactoring going on. I'm also going to do all that learning out in the open. You'll be able to follow the codebase on github and i'm going to document the whole experience on this blog. It might take a short while for code and posts to show up, because i've got some initial reading to do before i get started. All in all, i expect this to be a very interesting project that's going to teach me a lot, and i'm pretty sure i'm gonna have a lot of fun building it, and writing about it.

For those of you who already have experience with any of these technologies: if you catch me doing something stupid either in code or in a blog post, i'd appreciate a nudge in the right direction :)

  • http://profiles.google.com/roy.jacobs Roy Jacobs

    Instead of Backbone, it might also be worth investigating KnockoutJS (http://knockoutjs.com).

    • http://davybrion.com Davy Brion

      Yup, also an option but my first choice is Backbone. Knockout is an MVVM implementation and i’ve never really been a MVVM fan.

  • http://profiles.google.com/oskarwkarlsson Oskar Karlsson

    Ohh, I’m so envious. Have you given any thought to using coffee script instead of javascript? I have yet to do anything substantial in either, but from a 10 000 feet view coffee script looks like it does away with most of the sharp edges.. 

    btw just found http://jackhq.tumblr.com/post/736324773/express-coffee-a-template-for-nodejs-coffeescript

    • http://davybrion.com Davy Brion

      coffeescript looks great and you’re right in that it indeed takes away most of the sharp edges… but i really want to get very comfortable and even proficient in JavaScript before i switch to something that sort of abstracts it away. The primary reason is because i’d like to get in-depth knowledge of the frameworks and libraries that i’ll be using so i’m going to be looking at a lot of JavaScript code anyway which will be easier if i’m used to thinking in that language as opposed to constantly trying to map the JavaScript code i’ll see back to CoffeeScript

  • http://twitter.com/tanvani Tawani Anyangwe

    What IDE will you be using? Will your documents be converted from HTML template to PDF?

    • http://davybrion.com Davy Brion

      i won’t be using an IDE… just a great texteditor (TextMate is my favorite) and a terminal

      as for rendering the PDF’s, i plan on using PDF.JS for that, though i haven’t really given it a close look yet, so i’m not quite sure yet what kind of source input i’m going to have to feed it.

  • http://twitter.com/dagda1 dagda1

    I’ve been using backbone.js for a while now and I am a huge fan.

    We really need such organisational patterns in js to stop the inevitable slide into a big ball of mud.  THere are too many naive examples of javascript that just add behaviour to the global js object.

    i’ve just started using coffeescript after being very sceptical and I am now a fan boy.  

    Coffeescript is another deterrent to the big ball of mud that is very easy to fall down.You could use it for client and server code.  Pattern matching is a very interesting and fun thing to play with and is available in coffeescript.

  • Morten Jacobsen

    First off, I am not familiar at all (except at a VERY high level) with javascript.. This might explain my ignorance, but why do people choose to write their server-side code in javascript? Being predominantly a client-side language (as far as normal usage goes), it just seems like people trying to fit the language into a usage that it wasn’t intended for? It just seems to me that there are better alternatives (be it C#, ruby, PHP or something else entirely)? I’m probably completely misinformed and I understand that your choice of framework is based on the intention to learn, but maybe you can enlighten me? :)

    • http://davybrion.com Davy Brion

      the creator of Node didn’t have JavaScript in mind originally… the goals of the platform were to be (almost) entirely non-blocking and asynchronous in nature. Most of the core code is written in C, and JavaScript is actually just a relatively thin layer on top of that.  JavaScript was eventually chosen as the language because it just fit well within the paradigm: event-driven and making extensive use of callbacks. Its closure support also works to its advantage here.

      The result is a platform which offers great performance and scalability, with a (relatively) easy to use language.  And it certainly doesn’t hurt that a lot of cool stuff is being done in that community at the moment, so i thought it was definitely worthy of a deep-dive :)

  • James L

    Looking forward to this

  • Craig Cavalier

    Sounds great – really looking forward to following your experiences on this! 

  • Ganesh

    And I for one want to follow. I have very little idea of many of the things that has been said And I would like to dirty my hand as well.

  • http://twitter.com/lroal Lars-Erik Roald

    If I were you, I would go for a pure javascript client side – no frameworking, using good old MVP or MVC pattern. I would also considered implementing an Agatha like request/response layer in javascript. I’ve just had enough of frameworks for a while.

  • Pingback: First Steps With MongoDB, Mongoose and Jasmine-Node On Node.JS

  • http://www.facebook.com/verheyen Koen Verheyen

    Why not RavenDB?

    • http://davybrion.com Davy Brion

      It only runs on windows, and i’m assuming it’s only interesting if you’re using it from .NET