Thursday, September 27, 2012 5:47 PM

Hello, node! How I set up this blog.

Author: matthias - Last modified: Tuesday, October 9, 2012 8:35 AM

en blog  nodejs  express  mongodb  twitter bootstrap jade  nodejitsu

Hello, world - hello, node!

I just launched this new site and - though far from a perfect state - I'm quite happy with the results. About two weeks ago I had the idea to start this as a project aiming three goals:

  • Relaunching my personal homepage - the agile way
  • Getting in touch with and a better understanding for the world of node.js
  • Testing and evaluating some fancy JS plugins and cloud services (SaaS/PaaS)

It took me about a week studying various blogs, articles, docs and of course code for getting an idea and roundup of the current development state, packages, paradigms and concepts. In the end, it was definitive worth reading! Not only that I now know how to npm install something but that I now got a clearer understanding of e.g. what kind of loose coupling is the preferred node way and so on.

So, what software packages make up this site? Here we go:

express: Ready-to-roll on node

Starting from scratch, I decided to write a little blog engine on my own as a node/JS exercise. Currently there's likely no way around using the beautiful and simple mvc/mvr framework express which is basically comparable to Ruby Sinatra and other lightweight web DSLs/frameworks.

mongodb: No SQL? noSQL!

As a storage backend for the blog entries and user authentication a my decision was made in favour of the document-oriented database mongoDB. I utilized the node-mongodb-native driver and mongojs as a convenient wrapper around it. Well, using a noSQL database for the first time was fun to me (and less painful than many other learning curves), but haven't gone any deeper than storing, updating, finding and sorting at a starters' level by now.

Some tests with popular modules like mongoose, other key-value-stores and multi-db orm layers are on my todo list. Stay tuned for updates on my experiences with noSQL!

Twitter Bootstrap: Solid UI layout foundation - finally!

Hard to ignore: Twitter Bootstrap helped me out a lot building this blog. I' making use of a pure boostrap 2.1.1 CSS / JS, a slightly customized bootstrap-responsive and few additional inline styles. Though I'm planning to move the layout towards a more individual style, I'm happy with the current state as a solid starting point.

jade: Templating, the convenient way

Templating with express is a matter of choice again. I decided to go with jade. I've never been a big friend of HTML templating languages that forces you to learn yet another syntax, but - since jade seems currently to be the no.1 choice for node/express applications - it was time to give it a try. And, okay... now I know what I was missing.

nodejitsu: Good bye old servers - hello, cloud!

Last but not least: The node app running this site is just freshly installed and currently hosted on nodejitsu. The service is still in a public beta stadium but as far as I can tell it works great: Easy account setup and deployment, great toolkit and excellent response times. A basic mongodb instance is easy to install with the "jitsu" tool as well - although it will be installed in the cloud of nodejitsus partner mongoHQ. No problems here either so far - welcome to the cloud!

Next time I'll also go for a deployment on heroku. Let's see who's winning the "simple agile approach for quick results".

Next: Read my blog!

The upcoming days and weeks I'll frequently

$ jitsu deploy

my site, extend its functionality and add new modules. I'm going to share my individual experiences with the world of node, related projects and my progress in building a real-world application.

Stay tuned!

Comment / Share ¬Ľ