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.

8dbca2c5e7e0296afd964af7d1f7b55e?s=128

Alfredo Bonilla

April 10, 2019
Tweet

Transcript

  1. EXPLORING NEST.JS Alfredo Bonilla @brolag

  2. 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.
  3. 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.
  4. MAIN FEATURES

  5. CONTROLLERS • Controllers are responsible for handling incoming requests and

    returning responses to the client.
  6. CONTROLLERS

  7. CONTROLLERS

  8. 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.
  9. DEPENDENCY INJECTION

  10. DEPENDENCY INJECTION

  11. 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.
  12. MODULES

  13. MODULES

  14. MODULES

  15. MODULES

  16. 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.
  17. MIDDLEWARE

  18. ORM • Nest.js can be integrated with: • TypeORM •

    Mongoose • Sequelize
  19. 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.
  20. 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.
  21. MICROSERVICES

  22. OPEN API • The OpenAPI (Swagger) specification is a powerful

    definition format to describe RESTful APIs. Nest provides a dedicated module to work with it.
  23. OPEN API

  24. 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.
  25. 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.
  26. SERVER SIDE RENDERING • Nest.js supports Angular Server Side Rendering

    by using Angular Universal features.
  27. 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
  28. RESOURCES • https://docs.nestjs.com/ • https://twitter.com/kammysliwiec • https://github.com/juliandavidmr/aweso me-nestjs • https://youtu.be/f0qzBkAQ3mk

    • https://youtu.be/ixz0IefmecI • Book
  29. THANKS