- 51
- 407 042
Computerix
เข้าร่วมเมื่อ 5 ก.ย. 2013
Programming & Tech channel that covers many topics, mostly backend-related 💻
Feel free to suggest any video idea at any time!
Feel free to suggest any video idea at any time!
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
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
มุมมอง: 587
วีดีโอ
Authorization in NestJs : Roles & Permissions
มุมมอง 2.7K3 หลายเดือนก่อน
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.1K3 หลายเดือนก่อน
We learn how to build consistent API responses in NestJS to ensure a predictable and easy to maintain API, by leveraging interceptors. Interceptors Video : th-cam.com/video/LHp6Jm9coSI/w-d-xo.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
มุมมอง 6724 หลายเดือนก่อน
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.4K6 หลายเดือนก่อน
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
มุมมอง 5K6 หลายเดือนก่อน
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 : th-cam.com/video/h-68sqxycJY/w-d-xo.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
มุมมอง 15K6 หลายเดือนก่อน
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: th-cam.com/video/6MjjOsODYwU/w-d-xo.htmlsi=79fw-Iw_qPgurZyM MongoDB episode: th-cam.com/video/GV9quNoXRgg/w-d-xo.htmlsi=GQvEAaR0-N_o0Pib You can donate here: buymeacoffee.com/computerix Make sure to leave ...
Websockets in NestJs (Real-Time Chat App)
มุมมอง 10K7 หลายเดือนก่อน
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
มุมมอง 18K9 หลายเดือนก่อน
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
มุมมอง 9K10 หลายเดือนก่อน
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: th-cam.com/video/-IJ2MynZqg8/w-d-xo.html Error Handling: th-cam.com/video/AWqqg9Dtnc4/w-d-xo.html Guards & Authorization: th-cam.com/video/w_ASqSZKhMQ/w-d-xo.html Donations Link : buymeacoffee.com/com...
NestJs caching with Redis
มุมมอง 9K11 หลายเดือนก่อน
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
มุมมอง 8K11 หลายเดือนก่อน
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]
มุมมอง 1Kปีที่แล้ว
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.6Kปีที่แล้ว
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.3Kปีที่แล้ว
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]
มุมมอง 12Kปีที่แล้ว
NestJs - Guards & Authentication & Authorization [08]
NestJs - Service Providers & Dependency Injection [03]
มุมมอง 5Kปีที่แล้ว
NestJs - Service Providers & Dependency Injection [03]
RabbitMQ - RPC with NodeJs (request-reply pattern)
มุมมอง 9Kปีที่แล้ว
RabbitMQ - RPC with NodeJs (request-reply pattern)
Pagination in Nodejs using Mongoose (return totalPages, totalCount & More)
มุมมอง 1.6Kปีที่แล้ว
Pagination in Nodejs using Mongoose (return totalPages, totalCount & More)
Best Global Error Handler Middleware in Nodejs !
มุมมอง 9942 ปีที่แล้ว
Best Global Error Handler Middleware in Nodejs !
Entity Framework Core Load FULL Related Entities (Lazy Loading and Eager Loading)
มุมมอง 1.8K2 ปีที่แล้ว
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
มุมมอง 11K2 ปีที่แล้ว
ASP.NET Core 6.0 Code first approach using Entity Framework
thank you so much ><
Thank you for this master piece🙏
You're welcome 😁
Hi brother, do you use passport js or do it without it?
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?
That was actually a great start for a beginner like me
I'm glad!
such a legend!
Hi, Can I ask you a question @Computerix, Why Refresh token use uuidv4 but resetToken use nanoid?
your way is so great to approach and follow. many thanks
it could be better with sending messages to specific roomId/topicId
Thanks brother.
Thanks brother
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?
weel explanation
his whole series is soooo fucking useful, I really started learning nestjs 15 days ago, without him, I can't even getting this far
❤️❤️
you are the best bro
thanks!!
I’ve done using postgres and microservices th-cam.com/video/qR05wWeQ2OI/w-d-xo.htmlsi=H40Y7u4bZ12ugdHr
Very insightful as usual 🤝
Thank you for the great content, keep going! 🩷
@@Naya-ss7vs Thank you for the support!
could you explain how to use server.of() syntax?
thank you!
No worries!
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.
@fsassiv I'm glad you found my content helpful ! Thanks for your comment
@@Computerix good content.
@@shrikantjha5630 Thanks :)
U are the best , keep going bro 🙏🏻
Thank you 🙌
Thanks a lot man, your content is amazing!
@@od1ez Appreciate it :)
23:33 - Suggestion so you dont need the if/elseif: this.schema[metadata.type].validate(value)
great work. Simple, straightforward
Thanks!
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!
You are welcome ! Are you on mac? If that's the case CMD + I , instead of ctrl + space
@@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 :(
Thank you for this. Cheers from norway!
You're welcome !
Thank you so much ❤
You're welcome!
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
It''s really awesome. Thank you so much.
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.
thanks for the content! How would we registers the users for specific tenants ?
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
Best nestjs tutorial out here Thank you <3
Thanks :)
@@Computerix Would it be possible for you to create a video explaining user authentification with sso (apple, google) ?
thank you very much. This is gold!
Amazing 🤩
Rất hay
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
Thank you for your tutorial. I still dont understand how to implement Authorization for user to update their own resources (posts, settings, etc)
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
Thanks you very much! It was really good example to follow!
I'm glad! Thanks for the comment
Nice tutorial. Well done
Thanks !
Thanks you, you beautiful man
Great video, Thanks a lot!
thankyou good sir that was very helpfull
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
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
Why don't you use nestjs/passport for auth?
Thank you
wow, dude. it`s what i needed. i`ll try that
I'm glad :)