Felocity

Felocity.com on node.js

Since the site’s inception, felocity (both com and org) have been running PHP with various blogging solutions. Recently, that all changed with the rollout of the newest layout. Given my programming has moved from server side to client, it seemed logical that my site should follow suit. Felocity is now running happily on node.js, pulling its data in from a variety of sources. Taking the leap into node was a bit unnerving as there’s a ton of unknowns whenever you begin learning a new language. For those familiar with JavaScript, it will feel slightly alien with landmarks of familiarity. For someone unfamiliar with JavaScript, hopefully reading this makes you go pick up a book and learn.

To recount the experience, I’m relaunching the site with a series of articles that provide details about the development process with nodejs. While most things can be found with careful Googling, having it in a single location is bound to help someone out. Think of this series as “an abridged guide to building something cool with nodejs”. I’ve broken the chronological process up into a few posts. As I get them written, I’ll enable them as links below.

Getting Started With node.js and npm: When starting out, you’re going to need to install things and get them running as soon as possible. In Unix, it’s 7 commands (and in Windows, it’s even less). You’ll end up with the classic hello world, and some links to the common frameworks out there for building sites.

Developing a Website Using npm: The “package.json” that powers your node modules is the same great file that can tie your entire web site together. Learn why all the node.js hosts out there require it, and how using it can make development on multiple machines easy-peasy.

Keeping node.js Running: In development, not having to restart node.js is a small favor that will add up to hours of savings. In production environments, it makes the difference between someone seeing your site or not. Between node modules and system level services, you’ll always have node.js running when you want it to be.

Asynchronous Flow Control: By this point, if you’ve been developing a site, you’ve solved all the development nits you had. All that’s left is making your code a bit more beautiful and readable. Two major players for asynchronous flow control called Step and Seq exist to help you avoid the misery of nested callback functions.

Deploying node.js to a Server: Eventually, development will end and you’ll want to put this on something other than localhost. While there are no really “free” solutions out there, cloud based development has created a suite of solutions. Learn how to deploy nodejs apps into Amazon Web Services, or get some links for heroku, nodejitsu, and other node.js hosters.

And that is how the new felocity came to be. It was trial and error, a ton of googling, and a few questions in the various IRC channels. Here’s to node.js, and enjoy building something amazing. The entire source tree is available on github, and will be referenced through later posts where appropriate.

This article was written on November 08, 2011

Share this

comments powered by Disqus