Learn Node.js by building a backend framework - Velocy
⚠️ Live stream: The content of this book, as well as the backend framework we're building, is being live-streamed on YouTube.
You can access the current version of the book in the chapters directory or in PDF format (both Light and Dark modes are available) by clicking here. Note that this version includes the current release of the content, and is not the final version.
This book is still in a very early stage. It contains an insignificant portion of the total content that the book is supposed to cover. There’s going to be 0 dependencies for our backend framework, as well as our logging library. Everything will be done using vanilla Node.js, the hard-way (the best way to learn).
If you're not familiar with javascript, you may also check out my other repository - Learn Javascript - The Easy Way that takes you on a deep and a fun journey into Javascript - from the very basics to the advanced concepts that you'd ever need, without diving into too much theory. Only practical code examples.
To master a new concept, it's often best to begin from the ground up. This isn't just another Node.js guide; it's a comprehensive, code-along experience aimed at building a real world product that may be used by thousands of developers. The product that we're going to build will be a backend framework, that too from scratch.
You won't just learn how Node.js works, but also why it operates in a particular way. The guide also includes discussions on relevant data structures and design patterns.
The book also includes a wide range of exercises specifically created to challenge you, that may require commitment and consistent effort on your part. The first exercises start from chapter 7
This guide goes beyond the basics. We're focused on delivering a modular, optimized backend framework that is close to being production-ready. Topics like performance optimization, security measures, and various testing approaches will be covered to ensure the framework is both reliable and extendable.
I highly recommend actively coding alongside this guide, rather than just reading through it, for a full understanding of Node.js and its more intricate aspects.
The repo for our backend framework- Velocy. (W.I.P)
- (optional) Node.js is way faster than you think
- What the hell is a web server any way?
- Your first web server with node.js
- Working with files
logtar
- Our Own logging library- Initializing a new project
- A little about
SemVer
- Creating a LogLevel class
- The Logger class
- Encapsulation with private fields
- The
LogConfig
class - Design Patterns
jsdoc
comments- The
RollingConfig
class - Finishing up the
RollingConfig
class - Let's recap
- Adding more useful methods in the
LogConfig
class - Why
readFileSync
?
- Refactoring the code
- Writing Logs
- Capturing metadata
- A small intro to
async
vssync
- Adding Rolling File Support
- HTTP Deep Dive
- HTTP Verbs, Versioning and the benefits of
HTTP/1.1
- User Agents
- MIME Type and
Content-Type
- Headers
- Request headers
- Response Headers
- Response and Status Codes
velocy
our backend framework- A basic
Router
implementation - The
Router
class - Improving the
Router
API - The need for a
trie
- Exercise 1 - Implementing a
Trie
- Exercise 2 - Implementing our Trie based
Router