Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Exploring Nest.JS

Exploring Nest.JS

High level overview about Nest.JS framework.

Alfredo Bonilla

April 10, 2019
Tweet

More Decks by Alfredo Bonilla

Other Decks in Programming

Transcript

  1. WHAT IS NEST.JS? • Nest.js is a Node.js framework written

    in TypeScript for building back end applications. It combines elements of Object Oriented Programming, Functional Programming and Functional Reactive Programming. • It’s very reminicent to Angular.
  2. WHAT DOES IT TRY TO SOLVE? • It helps providing

    an opinionated architecture for complex node.js application by making easy to: • Decouple modules. • Organize code per feature. • Decouple Transfer Layer (HTTP, Web Sockets). • TypeScript.
  3. DEPENDENCY INJECTION • Dependency Injection is the technique of supplying

    a dependent object, such as a module or component, with a dependency like a service, thereby injecting it into the component’s constructor.
  4. MODULES • A module is a class annotated with a

    @Module() decorator. • The @Module() decorator provides metadata that Nest.JS makes use of to organize the application structure.
  5. MIDDLEWARE • Middleware is a function which is called before

    the route handler. • Middleware functions have access to the request and response objects, and the next() middleware function in the application’s request-response cycle.
  6. WEBSOCKETS • Nest.js make use of socket.io package under the

    hood, but also, provide compatibility with a wide range of other libraries, including native web sockets implementation.
  7. MICROSERVICES • Nest microservice is a type of application that

    uses a different transport layer than HTTP. • In general, Nest supports several built-in transporters. • This makes it easy to switch between transporters without changing the line of code.
  8. OPEN API • The OpenAPI (Swagger) specification is a powerful

    definition format to describe RESTful APIs. Nest provides a dedicated module to work with it.
  9. CQRS • Command Query Responsibility Segregation (CQRS) is the idea

    that each method should either be one that performs an action (command) or requests data (query), but not both.
  10. TESTING • The main Nest application starter is integrated with

    Jest framework to reduce an amount of overhead when it comes to start writing your tests, but still, you can get rid of it and use any other tool easily.
  11. TOOLING Nest CLI • Nest CLI is a command-line interface

    tool that helps to initialize and develop your applications. • The Nest CLI is based on the Angular Devkit package