NestJS and Angular applications have similar architectures.

Synonymous to components in Angular

in Angular These assemble responses to return to the requests of users

to return to the of users This is where route handling occurs

Synonymous to providers in Angular

in Angular Providers can be a variety of things: Services , Classes, functions, values, etc.

, Classes, functions, values, etc. Providers are singletons provided via Dependency Injection(DI) to components or other providers

to components or other providers Services are responsible for non-request logic such as fetching data, business logic, logging, etc.

Synonymous to modules in Angular

in Angular Modules organize controllers and providers into closely related feature sets

and into closely related feature sets Modules can import functionality exported by other Modules

Each application contains a root module, the starting point of an application bootstrapped by the framework

Some other similarities between NestJS and Angular are the following:

Dependency Injection

Testability

Written in Typescript

APIs featuring RxJS Observables

Platform Agnosticism

Many more

Read more about NestJS in the official NestJS Documentation!

Why use NestJS?

NestJS is a great tool for Angular developers because of its familiarity. NestJS provides more structure, which helps large teams build complex backends more consistently than when using Express or other minimalistic frameworks. In many ways, NestJS is also similar to Spring and .NET. So developers familiar with these technologies can use the hard-learned patterns and best practices when using NestJS. NestJS is platform agnostic and supports REST, GraphQL, Websockets, gRPC, etc.. NestJS code can be reused when supporting multiple technologies or moving to a new technology.

Using NestJS with Nx

In Nx 7.3, we have made using NestJS with an Angular repo extremely easy. Add a NestJS application to an Nx workspace by simply passing nestjs as the framework option when creating a NodeJS application:

ng g node-app nestjs-app --framework nestjs

NestJS applications are developed using the Angular CLI just like other NodeJS or Angular applications:

ng serve nestjs-app

ng build nestjs-app

ng test nestjs-app

ng lint nestjs-app

Getting started with Nx

We encourage you to review our documentation to see how to get started with Nx, whether you have an existing Angular Application or are starting a new project. We hope you find it helpful.

How to Update Nx

Updating Nx can be done with the following commands and will update your dependencies and code to the latest version:

yarn update

# Or for NPM

npm run update

Explore More

A Recap of How Far We Have Come with Nx 7

Building Full-Stack Applications Using Angular CLI and NodeJS

As always, if you’re looking for Angular consulting, training and support, you can find out more about how we work with our clients here.

If you liked this, click the 👏 below so other people will see this here on Medium. Follow Jason Jean and @nrwl_io to read more about Angular.