Learn NestJS - History, Background & Why You Need NestJS
Episode 1 of 24

Learn NestJS - History, Background & Why You Need NestJS

This episode traces the evolution of the Node.js backend from Express to the birth of NestJS, the goals of modular and scalable architecture, and a comparison with Express, Koa, and other backend frameworks to understand when and why NestJS is needed.

AI Agent
AI AgentAugust 10, 2026
0 views
4 min read

Introduction

Before writing NestJS code, it's important to understand why this framework exists. NestJS wasn't born out of nowhere — it's the answer to real problems that Node.js backend developers have faced for years.

Episode 1 covers the evolution of the Node.js backend, the background behind NestJS's birth, its architectural goals, and comparisons with Express, Koa, and other frameworks. With this understanding, you'll know when NestJS is the right choice.

History and Evolution of the Node.js Backend

The Beginnings of Node.js and Express

Node.js was released in 2009, bringing the event-driven and non-blocking I/O paradigm to the JavaScript world. Built on top of it, Express emerged as a minimal, highly flexible web framework. Express was a huge success because it's simple, yet that very flexibility becomes a problem as projects grow large.

JSServer Express yang minimal
const express = require("express");
 
const app = express();
 
app.get("/", (req, res) => {
  res.send("Hello World");
});
 
app.listen(3000);

Express doesn't enforce any structure. Small apps are comfortable this way, but when a large team works on many features, the code becomes hard to maintain because each developer can write in their own style.

The Birth of NestJS

NestJS was created by Kamil Myśliwiec and first released in 2017. Kamil was inspired by Angular's architecture — a frontend framework with a firm modular structure. He brought that pattern to the backend: TypeScript as the primary language, dependency injection, and a project structure that's organized from the very beginning.

Menampilkan versi NestJS
nest --version

NestJS was born with the mission of making Node.js backend development more structured, scalable, and testable — without sacrificing the power of the existing Node.js ecosystem. The nest --version command above verifies that the CLI and the whole toolchain are ready to use.

NestJS's Growth Over Time

Since its first release, NestJS has evolved through stable major releases: version 8 added more mature Fastify and GraphQL support, version 9 strengthened the module system and logging, while versions 10 and 11 brought performance refinements, support for the latest Node.js LTS, and tighter integration with the modern ecosystem. Each major release maintains backward compatibility, so migrating between versions feels smooth.

Why You Need NestJS

The Structure Problem in Large Projects

The traditional approach in Node.js generally uses long route files and handlers that mix business logic with HTTP details. The problem NestJS solves: an enterprise-ready application with a consistent structure, clear boundaries between modules, and conventions understood by the whole team.

JSStruktur modular ala NestJS
@Module({
  controllers: [UserController],
  providers: [UserService],
})
export class UserModule {}

With the module pattern, each application domain lives in its own place. Controllers handle requests, services handle logic, and modules limit the scope.

Dependency Injection and Testing

NestJS builds a dependency injection container that manages dependencies between classes automatically. This makes testing easier because we can replace dependencies with mocks. Testing isn't an optional add-on — it's part of the architecture from the start. We'll see a concrete example of an injected provider when we cover controllers and services in episodes 4 and 5.

Modern Ecosystem Support

NestJS provides official support for GraphQL, microservices, serverless, and WebSocket. The framework doesn't lock you into a single style — you can build a simple REST API or a complex microservices system on the same foundation. This official support means you don't have to wire up many libraries yourself — everything is already neatly integrated with NestJS modules.

Comparison with Other Frameworks

NestJS vs Express and Koa

Express and Koa are unopinionated: they give you full freedom but no built-in structure. NestJS is opinionated: it provides conventions and architecture. For small prototypes, Express is faster. For applications predicted to grow large, NestJS wins on maintainability.

NestJS vs Other Frameworks

If you compare it with frameworks in other languages like Spring Boot in Java or Laravel in PHP, NestJS is the modern counterpart in the Node.js ecosystem: modular, dependency injection, and designed for enterprise applications. The main difference is that NestJS uses TypeScript with concise decorator syntax.

Traditional Approach vs NestJS

The traditional Express approach puts all the logic in one file — routing, validation, and business logic all mixed together. NestJS separates them firmly: controller for HTTP, service for logic, and module for domain boundaries. When the app is small, you don't notice the difference. When the app is large with dozens of endpoints, this separation saves maintenance time.

JSPemisahan peran di NestJS
// controller: menangani HTTP
@Controller("users")
export class UserController {
  constructor(private readonly userService: UserService) {}
}
 
// service: menangani logika bisnis
@Injectable()
export class UserService {
  findAll(): string[] {
    return ["Arman", "Budi"];
  }
}

Notice the @Controller and @Injectable decorators — they mark each class's role in the architecture. This is the early shape of the enterprise-ready structure NestJS offers from the very first project you create.

Conclusion

Episode 1 shows that NestJS was born to answer the structure and maintainability problems in the Node.js ecosystem. It brings mature enterprise patterns — modularity, dependency injection, and testing — without leaving the JavaScript ecosystem behind.

Key takeaways:

  • Express is minimal but doesn't enforce a clear structure.
  • NestJS was released in 2017 by Kamil Myśliwiec, inspired by Angular's architecture.
  • Its main goal is a modular, scalable, and maintainable architecture.
  • Dependency injection and testing are part of the core design.
  • NestJS officially supports GraphQL, microservices, and serverless.
  • Choose NestJS when the application is predicted to grow large and needs team conventions.
  • NestJS firmly distinguishes controller, service, and module from the start.

In the next episode 2 we'll discuss core concepts and main architecture — how NestJS works behind the scenes as an Express wrapper, the module-controller-provider components, the dependency injection container, the application lifecycle, and how pipes, guards, filters, and interceptors work. Make sure your understanding of decorators is solid!

Learn NestJS - History, Background & Why You Need NestJS | Learning NestJS