Duration: about 2 weeks
Prerequisite: JavaScript knowledge of 5/10
This is the most exciting time to be a JavaScript developer, and it will only get better, particularly because of the advent of HTML5, the abandonment of Flash, the ubiquity of mobile devices, and most certainly because of Node.js, which allows developers to use JavaScript on the server.
Node.js itself is revolutionary and it is the immediate and near future of modern web application development with JavaScript as the sole server-side language. I provide you with a detailed roadmap for learning Node.js that has worked for me (an eCommerce Node.js web app I developed), and I am confident it will work for you. You will learn Node.js completely and you should approach this course with confidence, because you are only 2 to 3 weeks away from building amazingly fast, real-time, modern web applications in short time.
Why Learn Node.js
JavaScript is the language of the web today and unquestionably for the near future, because there is no alternative to JavaScript on the horizon. The ECMAScript organization has been moving full pace ahead with advancing the JavaScript language. And Node.js allows developers to develop modern applications with JavaScript as the sole server-side language.
With a thorough understanding of Node.js, you will be able to develop real-time, fast, scalable, data-driven web applications, and you will have the requisite knowledge to quickly adapt to any of the emerging, cutting-edge JavaScript frameworks such as Derby.js and Meteor.js.
It is worth noting that unlike just a couple of years ago when you needed to know a true server-side language (such as PHP, Rails, Java, Python, or Perl) to develop scalable, dynamic, database-driven web applications, today you can do as much and more with JavaScript alone.
How Not to Learn Node.js
- There are countless tutorials on Node.js, but most are not good enough resources for learning Node.js thoroughly, and it is very frustrating to discern which tutorials, if any, are best for learning Node.js properly. Most of them lack the requisite depth and structure you need to learn Node.js completely.
I read a good bit of Node.js tutorials when I learned Node.js about a year ago. I also wasted a good bit of time on some of the tutorials. Some of them were disappointing (I didn’t learn anything substantive) and frustratingly unedifying. I will neither name the unhelpful tutorials nor list the links here, but suffice to say, don’t waste your time following lots of Node.js online tutorials to learn Node.js from the ground up.
I am confident there are some excellent Node.js tutorials, but you have to weed through many mediocre tutorials to find the great ones. It is an inefficient way to learn Node.js. I did it and I am hopeful this guide will help you, so that you wouldn’t waste as much time as I did.
- Don’t go to Amazon and choose a Node.js book based on the reviews. Even though this is the customary way to decide on a book (it is how I choose my books), because Node.js is still a new platform, most of the books don’t have a large enough sample of reviews to provide you with a clear picture of the book’s usefulness and value. And collectively, the reviews are not great.
If you go to Amazon.com and type “Node.js,” you will see at least 21 Node.js books. While I have only ready 4 of them (the 4 best of the lot), I found a pattern in the books that were not good: the authors do not appear to have a thorough, vast understanding of the Node.js architecture and platform, and the books appear to be a collection of mediocre tutorials aggregated for the book. Of the 4 Node.js books I have read, 2 were good, but I recommend only one. The two books were Professional Node.js: Building JavaScript Based Scalable Software, by Pedro Teixera; and Smashing Node.js: JavaScript Everywhere, by Guillermo Rauch. I recommend Pedro Teixera’s book, but you can learn quite a bit from Guillermo Rauch’s book, too, so you should get both, if you are very serious about developing with Node.js
As of this writing, there are only two reviews of Professional Node.js: Building JavaScript Based Scalable Software (Pedro Teixera’s book) on Amazon.com; one of them is excellent (5 stars) and the other is a bad review–it is best if you read it yourself. This is the bad review of the book:
I have no idea if this book is well written or not because the formatting is so bad as to make it virtually unreadable in some places.
Obviously, the author of this review has not read the book and his review is completely about the formatting, which I have not experienced. I would give the book 5 stars because it is by far the best Node.js book I have read. But I didn’t buy it on Amazon, so I didn’t review it there.
Also note that I know neither of the authors of the two books I recommend in this article.
Resources
- Get a copy of The Node Beginner Book by Manuel Kiessling. It is a tiny book: it is really a Node.js tutorial. The book sells in a bundle with another book, Hands-on Node.js written by the aforementioned Pedro Teixeira, for $9.99. But interestingly, I didn’t find the companion book (by Pedro) to be as useful, so you don’t need it and we will not use it in our study of Node.js. But since you get both books for $9.99, take the deal and run. Get the Node Beginner Book here:
- Get a copy of:
— Paperback Version: Professional Node.js: Building Javascript Based Scalable Software, by Pedro Teixera.
— Kindle Version: Professional Node.js: Building Javascript Based Scalable Software, by Pedro Teixera.
Roadmap to Mastering Node.js
- If you already know JavaScript very well, and you feel invincible when you sit to code in JavaScript, carry on with step 2 below.
If you don’t know JavaScript well enough to develop a full, interactive quiz application with just JavaScript (no jQuery), you should learn JavaScript properly.
If you know enough JavaScript and want to proceed, but you feel you need a JavaScript refresher, read these 3 articles (in the order they are listed):
— JavaScript Objects in Detail
— JavaScript Variable Scope and Hoisting Explained
— (Must Read ) Understand JavaScript Closures With Ease - Read chapter 1 of Professional Node.js and follow the instructions on how to setup Node.js on your development computer.
- Read the entire Node Beginner Book. As I noted above, it is a tiny book; basically a tutorial. This tutorial will give you a gentle introduction into Node.js and a very basic understanding of what Node.js development involves. It is good to start with this before you read the rest of the Professional Node.js book.
- Read chapter 2 of Professional Node.js .
- Read the CommonJS section of the article at the link below. You need not read the entire article. Here is a link to just the CommonJS section.
- Read chapter 3 to 6 of Professional Node.js .
- Read the entire Part III section (chapter 7 to 15) of Professional Node.js .
- Optional: If you have got the Smashing Node.js book I referenced earlier, read chapters 8 and 9.
- Read chapter 17 to 22 of Professional Node.js .
- And finish up by reading the last 3 chapters of Professional Node.js .
- Now that you have learned enough Node.js to build the backend of a modern web application, you have to learn Backbone.js so you can rapidly build web applications on the frontend. You are a Node.js developer if you know only Node.js, but with Backbone.js and Node.js, you are a badass JavaScript developer with the skills and tools to build all sorts of web applications. Go learn Backbone.js completely.
- With a complete understanding of Node.js and Backbone.js, you are ready to build any type of web application. You can go ahead and build a startup at this juncture, if you are intrepid.
But before you head off for your adventure, build the NodeApp web application at the link below; this exercise provides you with a real-world practical in Node.js/Backbone.js web application development:
http://dailyjs.com/web-app.html - Further Learning: There are two more technologies you should learn to help consolidate your Node.js and Backbone.js skills: Handlebars.js for templating and MongoDB for database. Indeed, you have learned the simple Underscore.js template engine that comes with Backbone.js and you have learned a bit of MongoDB in step 10 above.
But you have to learn Handlebars because it is more robust and feature rich that the Underscore.js template engine. Read my post, Handlebars.js Tutorial: Learn Everything About Handlebars.js JavaScript Templating.
And you have to learn more MongoDB to build complex applications. I will have an upcoming post on MongoDB in the coming 5 to 8 days.
Best of luck and stay focused until you complete the entire course: DO NOT GIVE UP. And do not take longer than 3 weeks to complete the course.
Twitter led me here. There’s wrong link : for “entire article” in point #5. Didn’t finish reading the article and didn’t start reading “Professional Node.js”, but your approach seems nice and I DO want to master Node.js, Backbone and the other stuff mentionned. Thanks for the pointers. !
Thanks for pointing out the broken link, DjebbZ.
I just fixed it.
Thanks also for the kind words
This could not possibly have been more hlepful!
Hi Richard…
Glad I found your blog. As a newcomer to server side JS, I think your “sweat” recommendations will help many newbies skip a painful first step… digging through dirt to find gold.
Kudos… and Thanks!
Richard, this site is treasure trove of JavaScript goodness!
Thank you very much for the wonderful words, Anthony. I am happy to hear the website is helpful.
Hey great article. Nowadays we have everything at our fingertips, yet we don’t know in which order to digest it since its so much. Showing a basic path on achieving things and limiting the consumption is crucial, thanks.
Thank you, Ignacio.
I am happy to hear the roadmap was helpful.
Hi Richard,
Thanks a bunch for the blog, it has been very helpful. I had a question regarding your e-commerce app. Are you using some kind of CMS for your client? From what I gather node doesn’t have any mature CMS yet. Anything I don’t know about? The project I am working on has a lot of products, therefore I value a good CMS very much… Anyways, I guess I am just wondering if there is a good CMS solution for e-commerce in node.js?
Thanks.
Cheers!
I am not using a CMS for that app, but I did offer to build one for the client, which they did not want at the time, since they only sell one product.
I have not seen any Node.js CMS either, but to add CMS functionality in the eCommerce app I created would not have been too difficult, although it would have been specific to that eCommerce app and not versatile like most open source CMS solutions.
I suspect we will see some Node.js CMS’es in the next couple years.
Richard I have a vps with nodejs installed, Now I am trying to get a site built with node and express up and running, what do I need to do to get it up and running? I have my nameservers pointing at the url but I can’t seem to keep an instance running, and I don’t want the URL to be something like this:
domainName:3000
Can you point me in the right direction or make a tutorial?
-Cheers
Hi Anthony,
I am definitely not a server admin guru, but the engineer who setup Node.js on our server passed on these instructions:
1. Use the following guide to install node.js: https://github.com/joyent/node/wiki/Installation
To install NPM, use the following guide: http://npmjs.org/doc/README.html
To install Express, use the following: http://expressjs.com/guide.html
For the installs, you can modify the install directory to /opt/node
You will need an initscript, instructions can be found here: https://gist.github.com/715255
(have to modify certain parameters to match your configuration)
Each app.js requires an initscript.
Thanks a bunch Richard, I’m actually doing pretty good. I have node, npm , git, basically a LEMP stack set up with PHP5.4 and a postgreSQL and a mySQL set up for good measure and mongoDB to take care of the noSQL side of things. This is a great learning experience for me, working on setting up NGINX reverse-proxy for the nodejs application. I will be able to host up to 18 sites on this puppy.
Honey-Boo-Boo reference.. in object article classic
Have you thought of writing a series of articles on the node.js Express framework and writing libraries for it? (unless that’s in some of the professional node.js book).
Again loving the site, thank you for such wonderful examples.
@Pete,
Thanks for you comment
I don’t plan to write on the Node.js Express framework anytime soon, because it is covered (a full section) in the book I recommended above.
I’m looking forward to your article about MongoDB
Alright, I have it queued up for next, after the HTML5/CSS3/Responsive/Bootstrap 3.0 tutorial I am set to publish on Monday.
Hi Richard,
I would like to see a tutorial, some references about how to create CMS in node js, if you will have time for this in the future.
Thanks
Hi, Thanks for you advise here. Can you advise how many hours per week you should spend on doing this?
Thanks