Socket IO with React and Typescript
37:16
Deploy NodeJS Apps with Docker [2022]
10:30
Пікірлер
@ibrahimacar2702
@ibrahimacar2702 13 күн бұрын
hello in my case route is defining as follows: 'Loading route: get undefined/healthcheck' do u have an idea why it can be?
@TheNerdyCanuck
@TheNerdyCanuck 8 күн бұрын
This means the controller isn't properly giving you back the string inside the function that defines all the routing.
@pdsavard
@pdsavard 15 күн бұрын
Thanks for the great video. Got a small question, in the Cors Middleware, I can't add the return res.status(200).json({}) without getting a typescript error on the application.use(corsMiddleware). error: No Overload matches this call... Any idea?
@TheNerdyCanuck
@TheNerdyCanuck 8 күн бұрын
No overload matches makes me assume the function itself isn't defined properly. Still having this issue?
@pdsavard
@pdsavard 8 күн бұрын
@@TheNerdyCanuck solved! its because in typescript I can't do return res.status(200)...... something do not like that. I need to set the status then do a "empty" return;
@TheNerdyCanuck
@TheNerdyCanuck 8 күн бұрын
@@pdsavard strange, it should let you return but I'm happy you got it to work!
@KrzysztofLuczakPro
@KrzysztofLuczakPro 21 күн бұрын
Great playlist! Can you show how to do auth using decorators?
@TheNerdyCanuck
@TheNerdyCanuck 21 күн бұрын
Sure!
@lucascubile7141
@lucascubile7141 24 күн бұрын
Honestly at this point if you're using typescript you should just go NestJs cause this way of woking with express is just very VERY close to what nest does (as it uses express under the hood) so if you're gonna use express this way just save yourself the trouble and go Nest. Great vid nevertheless
@TheOnlyIchiban
@TheOnlyIchiban 27 күн бұрын
This is seriously a fantastic tutorial, i love the in depth explanations on what you're doing and the reasons, it's really important to understand. This was exactly what I needed, awesome work
@SayfSentinel
@SayfSentinel Ай бұрын
This way better than a Netflix series
@TheNerdyCanuck
@TheNerdyCanuck Ай бұрын
Appreciate that
@govindamishra3746
@govindamishra3746 Ай бұрын
Dude uses Javascript Classes in 2024 lmao 🤣 Tell me you use class components in react as well 😂😂😂😂
@TheNerdyCanuck
@TheNerdyCanuck Ай бұрын
Decorators can cascade a unlimited amount and reduce rewriting code
@rayrobinsongonzaga9681
@rayrobinsongonzaga9681 Ай бұрын
The perfect tutorial I've been looking for! Not just teaching the technologies but most especially best practices, testing, and error handling! Thank you! Make more videos please! Subscribed!
@CiceroRafaelSilvadeOliveira
@CiceroRafaelSilvadeOliveira Ай бұрын
Eu entendi porque a informação de usuários online está errada no client, é o seguinte, o dicionário de usuários conectados que temos no servidor é do tipo { [uid: string]: string } onde as chaves são os id's gerados no servidor usando o v4 e os valores são os socket id's. Ao enviar a lista de usuários do servidor para o client nós enviamos os valores do dicionário de usuários conectados, mas quando emitimos o evento 'user_disconnected' nós mandamos o uid do usuário que desconectou, ou seja, mandamos uma chave desse dicionário, só que o client não tem uma lista das chaves, ele tem uma lista dos valores desse dicionário, então quando o client tenta executar a ação 'remove_user' do SocketContext nenhum item da lista é retirado. Para corrigir isso é só trocar 'const users = Object.values(this.users);' por 'const users = Object.keys(this.users);' no arquivo socket.ts do servidor.
@atnguyen-qg6ze
@atnguyen-qg6ze Ай бұрын
Why can logging be used in handlelogging middleware?
@TheNerdyCanuck
@TheNerdyCanuck Ай бұрын
The middleware is designed to add logging to every request instead of using a third party library.
@atnguyen-qg6ze
@atnguyen-qg6ze Ай бұрын
@@TheNerdyCanuck thanks
@josephboyadjian6965
@josephboyadjian6965 Ай бұрын
Thanks for sharing, I had a question about going into production. Is it really the backend url (https) that needs to be entered in the okta console? thank you.
@TheNerdyCanuck
@TheNerdyCanuck Ай бұрын
Okta needs to be able to hit a backend API, so yes. You'll definitely need https for prod
@josephboyadjian6965
@josephboyadjian6965 Ай бұрын
@@TheNerdyCanuck thanks for your response!
@emranghanbari3217
@emranghanbari3217 2 ай бұрын
Which one do you recomend Joi or yup?
@TheNerdyCanuck
@TheNerdyCanuck 2 ай бұрын
joi
@fouratzitouni8564
@fouratzitouni8564 2 ай бұрын
This is a great series of videos, also I think you’re a great tutor. However I don’t think this is the best way to show people how to do, your application is coupled with mongo which is far from a best practice (n-tiers, clean,…)
@TheNerdyCanuck
@TheNerdyCanuck Ай бұрын
It entirely depends on what you are trying to accomplish. "Best Practices" for things like NodeJS and Express come in all shapes and sizes.
@chineduekeneokpala3407
@chineduekeneokpala3407 2 ай бұрын
So i noticed that the class `this` returns undefind, might this due to how the controller decorator was done?
@chineduekeneokpala3407
@chineduekeneokpala3407 2 ай бұрын
const handlers = routes.get(routeNames[k])?.map((item) => { return (req: Request, res: Response, next: NextFunction) => { return item.call(Controller, req, res, next); }, }); Making sure to pass the this(controller in our case)
@TheNerdyCanuck
@TheNerdyCanuck Ай бұрын
Which part are you referring to
@asap.bartek
@asap.bartek 2 ай бұрын
How can i handle form-data request? btw great video 👍
@beetpalm
@beetpalm 2 ай бұрын
best tutors, so clean, i added one decorators/mongoose aggregation.ts try{ const documents = await model.aggregate([...req.body]); req.mongoAggregation = documents } and declareHandler.ts mongoAggregation: Document[]; ... req.mongoAggregation = []; i'm try post body request [ { "$match": { "ecosId":"66978a23a8eb9f44d154914d" } }, { "$project": { "filedata":0 } } ] it work !! It's flexible. i love it. It makes working with Angular very easy and flexible. i'm try MEAN STACK <3
@attaullahsiddiqui3931
@attaullahsiddiqui3931 2 ай бұрын
Why are you not making more videos?
@TheNerdyCanuck
@TheNerdyCanuck 2 ай бұрын
I would like to make more! I am working on some testing ones right now, it's just hard to justify the time with the kids atm :)
@attaullahsiddiqui3931
@attaullahsiddiqui3931 2 ай бұрын
@@TheNerdyCanuck Cool. Plz make more vidoes on NodeJS Angular GraphQL
@RahmadRizkiJadida-
@RahmadRizkiJadida- 3 ай бұрын
we should use React Router Dom and BrowserRouter?
@TheNerdyCanuck
@TheNerdyCanuck 2 ай бұрын
Yes!!
@matias.9372
@matias.9372 3 ай бұрын
"Friend, I know it's been a long time since you created this video, but maybe you could help me with an answer. When I use `useSearchParams`, it re-renders my components, which is a problem because I want to create filters based on the params."
@TheNerdyCanuck
@TheNerdyCanuck 2 ай бұрын
That's strange. Do you have your code uploaded in git somewhere? I can look at it
@beetpalm
@beetpalm 3 ай бұрын
i love it, i'm from thailand I'm just starting to learn how to program. I really enjoy your videos.
@aliahmadi8816
@aliahmadi8816 3 ай бұрын
@TheNerdyCanuck Thank you for the content, I get an error if i try to log any of the config variables, I have to import them individually for it to work, what i mean is doing: import './config/config'; console.log(DEVELOPMENT) will throw an error that Cannot find name 'DEVELOPMENT Thank you!
@TheNerdyCanuck
@TheNerdyCanuck 3 ай бұрын
Its a setting in the config file to check the NODE_ENV env var
@adm7r
@adm7r 3 ай бұрын
great playlist. plus point could be adding auth and protected routes.
@adm7r
@adm7r 3 ай бұрын
i'd like to implement it myself. could you just give a brief on how could that be done? should i create another decorator called "Protected"?
@TheNerdyCanuck
@TheNerdyCanuck Ай бұрын
What kind of auth do you want to do?
@adm7r
@adm7r 3 ай бұрын
"super OCD about my code". ditto. that's why i'm here trying to learn all this, trying to perfect my express backend.
@TheNerdyCanuck
@TheNerdyCanuck 8 күн бұрын
I hate how much I overwrite and rewrite code because it's ugly
@JacquesOP
@JacquesOP 3 ай бұрын
Thank you Sir that was exactly what I was looking for. Simple and educative!
@sjorsklaassen3069
@sjorsklaassen3069 4 ай бұрын
Why do you make the decorator of the mongoose decorators in middleware form? You only showed one really briefly at the end and I want to know why I should or should not make the middleware variants.
@TheNerdyCanuck
@TheNerdyCanuck 3 ай бұрын
Middleware vs decorators is a complete prefferrence. I think that decorators are easier to implement / fun :)
@tovileo_
@tovileo_ 4 ай бұрын
How to add a session validation middleware?
@sebastianovalle8581
@sebastianovalle8581 4 ай бұрын
Hi, very helpful, do you know why these errors appear, when I use the example TS2339: Property 'defineMetadata' does not exist on type 'typeof Reflect'.
@TheNerdyCanuck
@TheNerdyCanuck 3 ай бұрын
I think you need to include reflect-metadata in your main server file or make sure your tsconfig is configured proeprly
@justinwang9660
@justinwang9660 5 ай бұрын
thank you. very nice toturial.
@TheKobraIRAQ
@TheKobraIRAQ 5 ай бұрын
Your videos are amazing with so much info in short time and you are doing very good job i hope you improve this channel and add more videos about react and nodejs❤thank you very much
@sdawdwadaufyuaiudi2148
@sdawdwadaufyuaiudi2148 5 ай бұрын
for a new comer Decorators kind da hard for me , is it from nextjs ?
@TheNerdyCanuck
@TheNerdyCanuck 3 ай бұрын
Nope, it's a language feature
@lukaslearning3549
@lukaslearning3549 5 ай бұрын
I hope you will cover Jest as well. I tried it before but I got trouble with type-checking inside test files.
@TheNerdyCanuck
@TheNerdyCanuck 3 ай бұрын
I am working on some test stuff now
@csguru8211
@csguru8211 5 ай бұрын
Thanks a lot for providing such a quality content
@daz1uk
@daz1uk 5 ай бұрын
Great video 👍
@jasonterry9343
@jasonterry9343 5 ай бұрын
Best guide on the net, amazing work. You should do a follow up explaining why some of these patterns are REALLY good, this would help the junior engineers out there a ton.
@muhammadfarhannudin5582
@muhammadfarhannudin5582 5 ай бұрын
THANKS YOU MASTER.....
@parsa264
@parsa264 5 ай бұрын
thank you, but how to use tailwind or sass for this library?
@gangstacoder4234
@gangstacoder4234 6 ай бұрын
but how do you test while developing a library
@mybackupvideos1103
@mybackupvideos1103 6 ай бұрын
lol you didn't explain how to deploy
@EndMan
@EndMan 6 ай бұрын
Hello, how can I turn on/off an object using the console? Declare this object in script DeveloperConsole?
@ytarame
@ytarame 6 ай бұрын
do you think this could be used to mod multiplayer into a simple game? like just sending the player positions since not many events matters. idk if mirror or unity's netcode will work if its a mod
@johnsanders3380
@johnsanders3380 6 ай бұрын
Wish you would have showed setting up the saml pem file.... :/
@sivasundarpt
@sivasundarpt 6 ай бұрын
Waiting for security implementation parts..........
@TheNerdyCanuck
@TheNerdyCanuck 6 ай бұрын
Which part of security friend?
@andresparra5828
@andresparra5828 6 ай бұрын
Take your star and your like good man
@piotrszymanski8325
@piotrszymanski8325 7 ай бұрын
M8, you are one of the best tutors, nice, clean, no trash talking, perfect tempo, pure and calm voice, and most important - pure essence. I keep fingers corssed for your success as a tutor.
@vivekgowda1576
@vivekgowda1576 7 ай бұрын
Could you please integrate cognito identity for authentication for the same?
@trieunguyentuan4589
@trieunguyentuan4589 7 ай бұрын
Thanks <3
@tamaniphiri
@tamaniphiri 7 ай бұрын
Yessir ❤
@trieunguyentuan4589
@trieunguyentuan4589 7 ай бұрын
why using package cors. Thanks
@TheNerdyCanuck
@TheNerdyCanuck 7 ай бұрын
You can use a package for it for sure, it's probably easier