Command Palette

Search for a command to run...

Getting Started with NestJS

A beginner-friendly introduction to NestJS — what it is, why it matters, and how to set up your first project with its core folder structure.

I’m currently working on a backend project using NestJS, so I thought I’d share a quick overview of what it is and how to get started with it — especially if you’re used to working with Express or similar frameworks.


What is NestJS?

NestJS is a progressive Node.js framework for building efficient, scalable, and maintainable server-side applications. It uses TypeScript by default and combines elements from:

  • Object-Oriented Programming (OOP)
  • Functional Programming (FP)
  • Functional Reactive Programming (FRP)

If you’ve ever worked with Angular, you’ll feel right at home — NestJS follows a similar modular and decorator-based architecture.


Why use NestJS?

  • Built-in TypeScript support
  • Powerful CLI for generating boilerplate
  • Modular architecture (split your app into reusable modules)
  • Integrates well with Express, Fastify, GraphQL, WebSockets, and more
  • Great for microservices and monoliths

Installation

To get started with NestJS, install the CLI globally:

pnpm add -g @nestjs/cli

Then create a new project:

nest new my-nest-project

To run your app:

pnpm start