Node.js Roadmap for Beginners
Tags: node, javascript, beginners
Published: 2022-02-20 18:14:12

JavaScript is a great programming language. These days it’s probably the easiest way to become a Full-stack developer. No wonder that many people are trying to taste Node.js right after JavaScript fundamentals. 

But where should one start? 🤔

In this article I will try to draw a decent roadmap for the first steps in learning Node.js with the best resources I marked after learning it by myself.

*I will assume you already have a solid understanding of JavaScript so I will not include it below.*

## 1. First steps

Before you jump right into some courses or tutorials it’s always good to understand some basic things and prerequisites. It’s always good to read some info about the technology you want to learn and how it works in general.
- [What is Node.js](https://nodejs.dev/learn)
- [What is V8 engine](https://nodejs.dev/learn/the-v8-javascript-engine)

In most of the cases and especially for the learning purposes you will definitely build REST APIs. That’s why I think you should learn just a bit about it before writing some code. 
- [What is Rest API](https://www.youtube.com/watch?v=-MTSQjw5DrM)
- [Request Methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)
- [Request Status Codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)

For some people it may sound weird but there are two things you need to understand.

### JavaScript in browsers and JavaScript in Node.js are working differently
Node.js is using a C library called [libuv](https://github.com/libuv/libuv) to implement the Event Loop. I think every developer should also know about it and have a basic understanding about this difference to avoid some mistakes in future.

- [Node.js Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/)
- [Node.js Event Loope explained by Ahmad Awais](https://www.youtube.com/watch?v=y3V0ChRs-9Y)
- [More info about libuv](https://www.youtube.com/watch?v=sGTRmPiXD4Y)

### You need to change the way you write JavaScript
While client-side JavaScript don't have that much asynchronous code, in Node.js you will use it all the time.
- [Async JavaScript in Node.js](https://css-tricks.com/node-javascript-compared-to-javascript/)

## 2. Fundamentals
Most courses and tutorials immediately start with building a simple server with Express. It’s not a big deal as you can run such a server with only 3 lines of code.

![carbon.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1645379432179/YAhzPJtDr.png)

But what you should really care about is not how to create a [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) server but how to work with Node.js. That’s why you need to learn some Node.js fundamentals before jumping to your first server. Official documentation is very nice so I recommend using it.
- [Node.js Guides](https://nodejs.org/en/docs/guides/)

But if you're a visual person like me and you prefer to learn via videos, I recommend watching Mosh Hamedani Node.js tutorial for beginners:
- [Node.js tutorial for beginners](https://www.youtube.com/watch?v=TlB_eWDSMt4)

## 3. Time to practice
There was a lot of theory before but I think it’s super important to build a strong and correct foundation before moving to active coding. This will help you to avoid some common mistakes in advance and write better code. 
I’ve passed a bunch of tutorials and here is the list of the most valuable in terms of the content quality and detailed explanations:
- [How to build a Node.js REST API](https://www.youtube.com/watch?v=vjf774RKrLc)
- [How to build a Node.js API with JWT](https://www.youtube.com/watch?v=2jqok-WgelI)
- [Node.js Crash Course](https://www.youtube.com/watch?v=zb3Qk8SG5Ms&list=PL4cUxeGkcC9jsz4LDYc6kv3ymONOKxwBU)
- [How to build a MERN stack App](https://www.youtube.com/watch?v=-0exw-9YJBo&list=PLillGF-RfqbbQeVSccR9PGKHzPJSWqcsm)
- [Node.js JWT Auth](https://www.youtube.com/watch?v=mbsmsi7l3r4)
- [How to build CRUD API in 20 min](https://www.youtube.com/watch?v=EzNcBhSv1Wo)
- [How to build a PEVN stack forum](https://www.youtube.com/watch?v=aqiJQaPDy7o)
- [How to build a MERN Travel Blog](https://www.youtube.com/watch?v=5pQsl9u_10M)
- [How to build a Real-time chat with Socket.io](https://www.youtube.com/watch?v=ZKEqqIO7n-k)

## 4. Advanced topics
The first three chapters should teach you how to work with Node.js and build any kind of apps. But it’s not the end of the journey. There’s a lot more to learn in terms of Node.js and backend in general. So I will give you a couple of hints and directions you will definitely need to check and learn deeper.

### Error handling 
This is actually the topic from the fundamentals section but I just wanted to make an additional focus on it. Handling errors is important for the serve. If you will have some errors on the frontend side, in most of the cases the app will still be running (framework’s errors is another story). But Node.js server will crash. That’s why it’s very important to work with errors in the proper way. 
- [Error handling in Node.js](https://nodejs.dev/learn/error-handling-in-nodejs)
- [Error handling in Express](https://expressjs.com/en/guide/error-handling.html#error-handling)

### Node.js threads 
I highly recommend learning more about how Node.js is working with threads. Especially to understand the difference between Worker threads, Cluster and Child process and their use cases.
- [Not so single-threaded Node.js](https://www.youtube.com/watch?v=zphcsoSJMvM)

### Node.js speed and optimization
You should always care about your app speed and performance. If you have some troubles or you just want to optimize your server I recommend you to check the video below and do your own research.
- [Take your server to ludicrous speed](https://www.youtube.com/watch?v=gltzZjKYK1I)

### Security
Just make your app secure. 
- [JWT vs Sessions](https://www.youtube.com/watch?v=UBUNrFtufWo)
- [Node.js Vulnerability Cheatsheet](https://blog.shiftleft.io/node-js-vulnerability-cheatsheet-447b0c9bdb99)

### Different topics
If you really want to improve your Node.js skills I would also recommend you to follow the Node.js YouTube channel and watch some conferences like NodeConf when they are active. 
- [Node.js on YouTube](https://www.youtube.com/channel/UCQPYJluYC_sn_Qz_XE-YbTQ)
- [NodeConf playlist](https://www.youtube.com/watch?v=uTzBHPpMEhA&list=PL0CdgOSSGlBbvNDKMs1RTA-NS-ZwtUm0G)

I hope this roadmap will me the Node.js learning path more clear for you. Wish you good luck in this journey!

Follow me on 🐦 [Twitter](https://twitter.com/StasKlymenko) if you want to see more useful content like this.