- Видео 51
- Просмотров 407 485
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
Просмотров: 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 - Service Providers & Dependency Injection [03]
Просмотров 5 тыс.Год назад
NestJs - Service Providers & Dependency Injection [03]
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)
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
Bhai hindi mai bna leta to kya jata yll
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 ruclips.net/video/qR05wWeQ2OI/видео.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