You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -529,3 +529,47 @@ Plug that method which we need to attach that middle ware
529
529
})
530
530
531
531
```
532
+
533
+
## Day 17 - NestJs
534
+
535
+
```https://docs.nestjs.com/``` <br />
536
+
- It is used to build serverside application microservices and RestAPI.
537
+
- It is proper framework like Asp.net, Django. It is provide you the architecture to build a server.
538
+
- It is Extensible, Versatile and prograssive javascript.
539
+
- If you are working with NestJs, type script is the default module. If you have worked with angular than NEST js is pretty similar.
540
+
- Nest makes use of robust HTTP Server frameworks like Express (the default) and optionally can be configured to use Fastify as well!
541
+
- Nest provides an out-of-the-box application architecture which allows developers and teams to create highly testable, scalable, loosely coupled, and easily maintainable applications.
- Nest is database agnostic, allowing you to easily integrate with any SQL or NoSQL database
546
+
- You can also directly use any general purpose Node.js database integration library or ORM,
547
+
- Nest provides tight integration with TypeORM and Sequelize out-of-the-box with the @nestjs/typeorm and @nestjs/sequelize packages respectively, @nestjs/mongoose package for mango DB.
- Passport is the most popular node.js authentication library, well-known by the community and successfully used in many production applications. It's straightforward to integrate this library with a Nest application using the @nestjs/passport module
551
+
At a high level, Passport executes a series of steps to:
552
+
a) Authenticate a user by verifying their "credentials" (such as username/password, JSON Web Token (JWT), or identity token from an Identity Provider)
553
+
b)Manage authenticated state (by issuing a portable token, such as a JWT, or creating an Express session)
554
+
c)Attach information about the authenticated user to the Request object for further use in route handlers
- Nest comes with a built-in text-based logger which is used during application bootstrapping and several other circumstances such as displaying caught exceptions (i.e., system logging). This functionality is provided via the Logger class in the @nestjs/common package.
- Nest also provides compatibility with other libraries such as, for example, Fastify.
561
+
Fastify provides a good alternative framework for Nest because it solves design issues in a similar manner to Express. However, fastify is much faster than Express, achieving almost two times better benchmarks results.
GraphQL is a powerful query language for APIs and a runtime for fulfilling those queries with your existing data. It's an elegant approach that solves many problems typically found with REST APIs.
566
+
- GraphQL queries access not just the properties of one resource but also smoothly follow references between them. While typical REST APIs require loading from multiple URLs, GraphQL APIs get all the data your app needs in a single request. Apps using GraphQL can be quick even on slow mobile network connections.
- Nest natively supports the microservice architectural style of development.In Nest, a microservice is fundamentally an application that uses a different transport layer than HTTP.
570
+
Nest supports several built-in transport layer implementations, called transporters, which are responsible for transmitting messages between different microservice instances. Most transporters natively support both request-response and event-based message styles.
- Automated testing is considered an essential part of any serious software development effort. It is provides integration with Jest and Supertest out-of-the-box, while remaining agnostic to testing tools.
0 commit comments