Computerix
Computerix
  • Видео 51
  • Просмотров 407 485
NestJS Swagger Guide: OpenApi Documentation
We dive into using Swagger in a NestJS project to effortlessly generate API documentation that conforms to the OpenAPI specification.
You'll learn how to set up Swagger in your NestJS app, customize your API docs with various decorators, and ensure your backend is well-documented and easy to understand for other developers.
List of decorators: docs.nestjs.com/openapi/decorators
Buy me a coffee : buymeacoffee.com/computerix
Timestamps:
---------------------
0:00 - Introduction (Swagger + OpenApi )
1:03 - Setting up the Swagger Document
4:15 - Documentation Sections + @ApiTags()
6:04 - Documenting Requests
8:20 - Documenting Responses
13:03 - Protecting APIs with a Bearer Token
Просмотров: 594

Видео

Authorization in NestJs : Roles & Permissions
Просмотров 2,7 тыс.3 месяца назад
We implement Authorization using roles & permissions in NestJs. We create our own custom @Permissions decorator and apply it to our routes, and then use it inside of our Authorization Guard to compare it against our user's set of permissions. Github Repo: github.com/charbelh3/nestjs-auth-apis Donations Link: buymeacoffee.com/computerix Timestamps: 0:00 - Introduction Code explanation 1:45 - How...
The Key to Perfect API Responses in NestJS
Просмотров 1,1 тыс.4 месяца назад
We learn how to build consistent API responses in NestJS to ensure a predictable and easy to maintain API, by leveraging interceptors. Interceptors Video : ruclips.net/video/LHp6Jm9coSI/видео.htmlsi=vOsM_8RplN9-T9Xs Timestamps: 0:00 - Predictable API Responses 0:58 - Leveraging NestJS interceptors 3:30 - Testing our API responses
Request-Scoped Providers in NestJS: A Must-Know for Developers
Просмотров 6744 месяца назад
Everything You Need to Know About Request-Scoped Providers in NestJS will be taught in this video, on top of a comparison with the default singleton behavior. Buy me a coffee: buymeacoffee.com/computerix Timestamps: 0:00 - How NestJs Handles Provider Creations & Lifetime 1:15- The Singleton Scope (Default Behavior) 2:53 - Request Scoped Providers 4:30 - Real Use case for Request Scoped Provider...
Multitenancy Authentication in NestJs
Просмотров 2,4 тыс.6 месяцев назад
We learn how to authenticate users in a multitenant application, where each tenant has their own unique secret key for generating and verifying access tokens. Your donations are highly appreciated: buymeacoffee.com/computerix Timestamps: 0:00 - Multitenancy Implementation Recap 6:10 - Authentication: Single Tenant vs Multi-Tenant 9:40 - Overview of our tasks 11:24 - Create new tenant API 18:40 ...
NestJs Authentication: Change Password, Forgot Password, Reset Password
Просмотров 5 тыс.6 месяцев назад
In this video we learn how to handle a user changing their password, forgetting their password, receiving a reset password link and handling it properly in a Nestjs backend. Part 1 : ruclips.net/video/h-68sqxycJY/видео.htmlsi=p6S6f8nRpuXDyImw Feel free to donate: buymeacoffee.com/computerix Source Code: github.com/charbelh3/nestjs-auth-apis Timestamp: 0:00 - Part 1 Recap 1:30 - Overview and goa...
NestJs Authentication : Login, Signup, Refresh Tokens, JWT, Guards
Просмотров 15 тыс.6 месяцев назад
We implement : Login, Signup and Refresh Tokens APIs and learn the differences between an access and a refresh token, and how to handle them in our authentication flow. Configuration episode: ruclips.net/video/6MjjOsODYwU/видео.htmlsi=79fw-Iw_qPgurZyM MongoDB episode: ruclips.net/video/GV9quNoXRgg/видео.htmlsi=GQvEAaR0-N_o0Pib You can donate here: buymeacoffee.com/computerix Make sure to leave ...
Websockets in NestJs (Real-Time Chat App)
Просмотров 10 тыс.7 месяцев назад
We learn how to setup a websocket gateway in Nesjts, to subscribe to events, and emit messages. We learn different ways to broadcast messages, and consume them from a client, while building a simple chatting app Donations: buymeacoffee.com/computerix Timestamps: 0:00- Creating the Websocket Gateway 2:38- Listening to events 5:37- Emitting Messages to the client 7:55- Brodcasting messages Websoc...
NestJs Microservices with RabbitMQ
Просмотров 18 тыс.9 месяцев назад
We build a Producer and a Consumer that communicate through RabbitMQ in NestJs. We learn how to implement both event driven and RPC solutions. If this video was helpful, leave a like & subscribe! Github Repo: github.com/charbelh3/NestJs-Microservice-RabbitMQ Timestamps: 0:00 - Introduction 1:25 - Creating a RabbitMQ client instance 3:55 - Producing an event to RabbitMQ 6:40 - Connecting our Con...
NestJs - Best Practices + Implementations
Просмотров 9 тыс.10 месяцев назад
We discover different best practices and how to implement each with practical examples, to ensure a clean and maintenable nestjs project. Detailed Videos from my nestJs Course: Pipe & Validations: ruclips.net/video/-IJ2MynZqg8/видео.html Error Handling: ruclips.net/video/AWqqg9Dtnc4/видео.html Guards & Authorization: ruclips.net/video/w_ASqSZKhMQ/видео.html Donations Link : buymeacoffee.com/com...
NestJs caching with Redis
Просмотров 9 тыс.11 месяцев назад
We learn how to implement caching properly using the cache manager package in NestJs, and using the redis store to cache data in redis. Buy me a coffee at : buymeacoffee.com/computerix Timestamps: 0:00- Why use caching ? 1:02- Implementing caching in NestJs 6:28- Using the Cache Interceptor 9:19- Using the Redis Cache Store
Multitenancy in NestJS + Mongoose
Просмотров 8 тыс.11 месяцев назад
Learn how to handle multitenancy in NestJS with Mongoose in this easy-to-follow tutorial. Where we learn how to connect to the correct dedicated tenant database based on the tenant making the request. Github Repo: github.com/charbelh3/NestJs-Multi-Tenancy Buy me a coffee at : buymeacoffee.com/computerix Timestamps: 0:00- Single-Tenant vs Multi-Tenant 2:13- Our Multi-Tenant Application 4:45- Exp...
NestJs - MongoDB [11]
Просмотров 1 тыс.Год назад
We learn how to connect to a mongoDb database using the NestJs mongoose package. We cover multiple concepts: 1- Different ways we can connect to a database 2- Creating a Schema 3- Registering a model 4- Injecting that model and using it as a dependency 5- Exporting models 6- Using multiple databases 7- Accessing the mongoose Connection object Timestamps: 0:00- Introduction 1:00- Connecting to o...
NestJs - Configuration [10]
Просмотров 2,6 тыс.Год назад
We cover the importance of using .env files to ensure the security of our sensitive data, and we learn how we can use the nest ConfigModule to access our configuration variables. Timestamps: 0:00 - Avoid critical configuration mistakes 0:46- Using .env files to read variables 3:19- Registering and understanding ConfigModule 6:25- Loading custom configurations 8:18- Reading config variables with...
NestJs - Interceptors [09]
Просмотров 2,3 тыс.Год назад
We learn how we can intercept a request, and add logic BEFORE and AFTER getting a response from the route handlers. We learn different use cases in which providers could be useful, and more... Please like & subscribe ! Timestamps: 0:00 - Interceptors and their purpose 1:03 - Creating our custom interceptor 4:50 - Different ways of registering our custom interceptors 8:43 - Intercepeting the rou...
NestJs - Guards & Authentication & Authorization [08]
Просмотров 12 тыс.Год назад
NestJs - Guards & Authentication & Authorization [08]
NestJs - Pipes & Validation [07]
Просмотров 3,4 тыс.Год назад
NestJs - Pipes & Validation [07]
NestJs - Exception Filters [06]
Просмотров 5 тыс.Год назад
NestJs - Exception Filters [06]
Nestjs - Middlewares [05]
Просмотров 1,8 тыс.Год назад
Nestjs - Middlewares [05]
NestJs - Modules [04]
Просмотров 2,8 тыс.Год назад
NestJs - Modules [04]
NestJs - Service Providers & Dependency Injection [03]
Просмотров 5 тыс.Год назад
NestJs - Service Providers & Dependency Injection [03]
NestJs - Controllers [02]
Просмотров 2 тыс.Год назад
NestJs - Controllers [02]
NestJS - Introduction & Setup [01]
Просмотров 4,6 тыс.Год назад
NestJS - Introduction & Setup [01]
RabbitMQ - RPC with NodeJs (request-reply pattern)
Просмотров 9 тыс.Год назад
RabbitMQ - RPC with NodeJs (request-reply pattern)
Pagination in Nodejs using Mongoose (return totalPages, totalCount & More)
Просмотров 1,6 тыс.Год назад
Pagination in Nodejs using Mongoose (return totalPages, totalCount & More)
What is an API ? (Only video you need)
Просмотров 166Год назад
What is an API ? (Only video you need)
Best Global Error Handler Middleware in Nodejs !
Просмотров 9962 года назад
Best Global Error Handler Middleware in Nodejs !
Entity Framework Core Load FULL Related Entities (Lazy Loading and Eager Loading)
Просмотров 1,8 тыс.2 года назад
Entity Framework Core Load FULL Related Entities (Lazy Loading and Eager Loading)
Promise.race() to handle request timeouts in JS (explanation + examples)
Просмотров 3142 года назад
Promise.race() to handle request timeouts in JS (explanation examples)
ASP.NET Core 6.0 Code first approach using Entity Framework
Просмотров 11 тыс.2 года назад
ASP.NET Core 6.0 Code first approach using Entity Framework

Комментарии

  • @luckykhati3431
    @luckykhati3431 День назад

    Bhai hindi mai bna leta to kya jata yll

  • @bbbb7071
    @bbbb7071 2 дня назад

    thank you so much ><

  • @ayo-ju5sv
    @ayo-ju5sv 4 дня назад

    Thank you for this master piece🙏

  • @testuser-i9e
    @testuser-i9e 8 дней назад

    Hi brother, do you use passport js or do it without it?

  • @robings6489
    @robings6489 14 дней назад

    With this logic you can only be signed in on a single device with the same user right? So if I want users to be signed in on multiple devices I'd have to run some kind of cron job to delete every refresh token when it is expired?

  • @smohammadhn
    @smohammadhn 15 дней назад

    That was actually a great start for a beginner like me

  • @JOKENCANAL
    @JOKENCANAL 21 день назад

    such a legend!

  • @binhnguyenthanh5084
    @binhnguyenthanh5084 24 дня назад

    Hi, Can I ask you a question @Computerix, Why Refresh token use uuidv4 but resetToken use nanoid?

  • @enjoywithcoinee1966
    @enjoywithcoinee1966 25 дней назад

    your way is so great to approach and follow. many thanks

    • @enjoywithcoinee1966
      @enjoywithcoinee1966 25 дней назад

      it could be better with sending messages to specific roomId/topicId

  • @hamzazahidulislam3490
    @hamzazahidulislam3490 26 дней назад

    Thanks brother.

  • @hamzazahidulislam3490
    @hamzazahidulislam3490 26 дней назад

    Thanks brother

  • @HellGuyRj
    @HellGuyRj 26 дней назад

    I have a question, for now the connection string is having multiple dbs and useDb is being used to switch the dbs. But, what about the case in which the whole database instance is different, for example 5 dbs on 5 different EC2 machines. How to approach this situation?

  • @ashadulmridha6551
    @ashadulmridha6551 28 дней назад

    weel explanation

  • @PrashantSingh-pw1ze
    @PrashantSingh-pw1ze Месяц назад

    his whole series is soooo fucking useful, I really started learning nestjs 15 days ago, without him, I can't even getting this far

  • @ZeinShaban-l3p
    @ZeinShaban-l3p Месяц назад

    you are the best bro

  • @ВікаДеркач-ъ8э
    @ВікаДеркач-ъ8э Месяц назад

    thanks!!

  • @Webtech-nu7hq
    @Webtech-nu7hq Месяц назад

    I’ve done using postgres and microservices ruclips.net/video/qR05wWeQ2OI/видео.htmlsi=H40Y7u4bZ12ugdHr

  • @Naya-ss7vs
    @Naya-ss7vs Месяц назад

    Very insightful as usual 🤝

  • @Naya-ss7vs
    @Naya-ss7vs Месяц назад

    Thank you for the great content, keep going! 🩷

    • @Computerix
      @Computerix Месяц назад

      @@Naya-ss7vs Thank you for the support!

  • @od1ez
    @od1ez Месяц назад

    could you explain how to use server.of() syntax?

  • @ВікаДеркач-ъ8э
    @ВікаДеркач-ъ8э Месяц назад

    thank you!

  • @fsassiv
    @fsassiv Месяц назад

    Anything anyone needs to know to get started with NestJS is on your channel. Straightforward, simple and well explained content. Congrats man and Thank you.

    • @Computerix
      @Computerix Месяц назад

      @fsassiv I'm glad you found my content helpful ! Thanks for your comment

    • @shrikantjha5630
      @shrikantjha5630 Месяц назад

      @@Computerix good content.

    • @Computerix
      @Computerix Месяц назад

      @@shrikantjha5630 Thanks :)

  • @aabhishakemishra
    @aabhishakemishra Месяц назад

    U are the best , keep going bro 🙏🏻

  • @od1ez
    @od1ez Месяц назад

    Thanks a lot man, your content is amazing!

    • @Computerix
      @Computerix Месяц назад

      @@od1ez Appreciate it :)

  • @fsassiv
    @fsassiv Месяц назад

    23:33 - Suggestion so you dont need the if/elseif: this.schema[metadata.type].validate(value)

  • @fsassiv
    @fsassiv Месяц назад

    great work. Simple, straightforward

  • @gonzalonozikovsky654
    @gonzalonozikovsky654 Месяц назад

    hi! thanks for the video, i have a question at minute 5:40 you press something on the keyboard to see the available options that you can use according to the method typing, how do you do this? i press ctrl + space but i only see the version control menu like you see, i don't see the available options to use in the obje THANK YOU!

    • @Computerix
      @Computerix Месяц назад

      You are welcome ! Are you on mac? If that's the case CMD + I , instead of ctrl + space

    • @gonzalonozikovsky654
      @gonzalonozikovsky654 Месяц назад

      @@Computerix yOMG! thanks!!! now I can see the configuration keys that the object has, but when you go from one key to another you see the definition or a description of what each one does, but I don't see that :(

  • @Fullflexno
    @Fullflexno Месяц назад

    Thank you for this. Cheers from norway!

  • @ankushmishra9449
    @ankushmishra9449 Месяц назад

    Thank you so much ❤

  • @ismaelseck
    @ismaelseck Месяц назад

    when i try to execute the localhost:3000 request with the get method in postman i face a 404 Cannot GET /. I'm not using mongoose but typeOrm

  • @ahsanahmedrakib6450
    @ahsanahmedrakib6450 Месяц назад

    It''s really awesome. Thank you so much.

  • @avinashchirame1779
    @avinashchirame1779 Месяц назад

    If i need different sub domains for different tenants and wanted to keep users details in tenants database instead of Master, so as to manage GDPR norms, what should i do? could you please help to fix this problem.

  • @GabrielSantos-nx3zq
    @GabrielSantos-nx3zq Месяц назад

    thanks for the content! How would we registers the users for specific tenants ?

    • @Computerix
      @Computerix Месяц назад

      This is up to you / the requirements of your system. You could allow a user to create a company / tenant, and as the owner, they could invite users / register users under their company

  • @thomasfichtner9738
    @thomasfichtner9738 Месяц назад

    Best nestjs tutorial out here Thank you <3

    • @Computerix
      @Computerix Месяц назад

      Thanks :)

    • @thomasfichtner9738
      @thomasfichtner9738 Месяц назад

      @@Computerix Would it be possible for you to create a video explaining user authentification with sso (apple, google) ?

  • @tonyeneh8194
    @tonyeneh8194 Месяц назад

    thank you very much. This is gold!

  • @ilmanmanarulqori5632
    @ilmanmanarulqori5632 Месяц назад

    Amazing 🤩

  • @ChungLeeVN
    @ChungLeeVN 2 месяца назад

    Rất hay

  • @mAth4u657
    @mAth4u657 2 месяца назад

    Sir,Can I contact you, I need to ask and clarify my current ongoing prject related thing ,currenlty I am university students ,so I have question and blocker

  • @leson1601
    @leson1601 2 месяца назад

    Thank you for your tutorial. I still dont understand how to implement Authorization for user to update their own resources (posts, settings, etc)

    • @Computerix
      @Computerix 2 месяца назад

      You would need CRUD routes for roles, that only admins can access (So a user with let's say a resource of "roles" and available actions of "update" "create" etc..) can access, to modify the permissions on a certain role / create new roles, and so on. And your system would typically have a super admin role that can perform all the permissons

  • @es7729
    @es7729 2 месяца назад

    Thanks you very much! It was really good example to follow!

    • @Computerix
      @Computerix 2 месяца назад

      I'm glad! Thanks for the comment

  • @giftedbraintech5151
    @giftedbraintech5151 2 месяца назад

    Nice tutorial. Well done

  • @reconrecoil7617
    @reconrecoil7617 2 месяца назад

    Thanks you, you beautiful man

  • @kalinduabeysinghe8917
    @kalinduabeysinghe8917 2 месяца назад

    Great video, Thanks a lot!

  • @RmoviesTN
    @RmoviesTN 2 месяца назад

    thankyou good sir that was very helpfull

  • @waseemalhalabi5148
    @waseemalhalabi5148 2 месяца назад

    Isn't it a good approach to store the tenant_id inside the JWT token rather that create a separated secret for each tenant? so there is no need for the client to send his tenant_id in the header

    • @Computerix
      @Computerix 2 месяца назад

      Here there are 2 different points. I'm gonna reply to each separately : 1) "Isn't it a good approach to store the tenant_id inside the JWT token.. so there is no need for the client to send his tenant_id in the header" => It is a valid approach, and you can definitely do that. However, in our case, I believe sending the tenant_id in the request header is actually cleaner. By doing this, we can use a middleware to first ensure that the tenant_id is valid before even verifying the token. If we were to store the tenant_id inside the JWT token, we'd have to move the tenant validity check from the middleware to our Guard. This would require the following steps: 1- Decode the token to extract the tenant_id. 2- Check if this tenant_id is valid and fetch the correct secret key for that tenant (assuming each tenant has their own secret key, which is the recommended approach for security when using multiple DBs). 3- Use that tenant-specific secret key to verify the token. 2) "Rather that create a separated secret for each tenant?" => Using the same secret key for all tenants introduces a significant security risk. If that key is compromised, all tenants in your system are at risk. However, by giving each tenant their own secret key (stored in their own database), you minimize the impact of a breach. If one tenant's secret is compromised, it only affects that tenant, while the others remain secure. This adds an important layer of isolation and protection for tenant data. It's worth mentioning, that this reply is specific to our decision of using different DBs for each tenant