Nest Introduction

What is NestJS?

Full stack MVC development framework for NodeJS. Give you the framework to spin up a NodeJS backend API, microservice, or full-stack website with common integrations for GraphQL and Web Sockets. Uses model, view, and controller architecture for structuring apps.

Like Laravel, if someone was a fan of Angular and JS decorators, with more open wrappers around underlying libraries (like Express/Fastify for routing).

Big on "dependency injection", meaning the app won't import your library unless you explicitly inject it into the app:

// Not used by app
import CustomService from "module-name"
// Used by app because it's injected
import ProductController from "./controllers/product"
@Module({
controllers: [ProductController]
})

Why use NestJS?

Pros:

  • Simplifies development with things like decorators.
  • Frontend agnostic (can use as backend with React/Vue/etc)

Supports:

  • Express/Fastify (uses Express by default)
  • GraphQL (wrapper around Apollo)
  • Web Sockets

Built in:

  • First class Typescript support
  • Unit testing using Jest
  • E2E testing

How do I use NestJS?

  1. Make sure NodeJS is installed.
  2. Setup a new project with CLI (or clone template). See getting started docs here.

Limitations of NestJS?

Compatibility

References

Official Documentation

Tutorials

3rd Party Integrations

Videos / Media

Learn Nest.js from Scratch by building an API

Nest.js with MongoDB - Complete Example

NestJS Crash Course

Demystifying Dependency Injection: Angular vs NestJS - Kamil Mysliwiec | NG-DE 2019

Kamil Myśliwiec - Revealing framework fundamentals: NestJS behind the curtain