Тёмный

Realtime Chat With Users & Rooms - Socket.io, Node & Express 

Traversy Media
Подписаться 2,3 млн
Просмотров 880 тыс.
50% 1

In this project we will build a chat app using Node, express & websockets in under 60 minutes
Code:
github.com/bra...
💖 Become a Patron: Show support & get perks!
/ traversymedia
Website & Udemy Course Links:
www.traversyme...
Follow Traversy Media:
/ traversymedia
/ traversymedia
/ traversymedia

Опубликовано:

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 948   
@tinymooshmallow6181
@tinymooshmallow6181 Год назад
This video is VERY underrated. Not only does Brad show you the code, he explains everything and even does some debugging. I know this comment came 3 years late. +1 like
@sazzadanwar4802
@sazzadanwar4802 4 года назад
Thanks, Brad! Your tutorial helped me to develop the skills of web development in a faster way and at last, I got a job from a company before being a graduate. Again Thanks a lot! You are the tutor of professional life for many students like us.
@danielgn6227
@danielgn6227 4 года назад
Our web development teacher did something like this. He opened the chat to the whole class so we could try it and I thought 'mmm I wonder if he's sanitizing HTML before broadcasting the messages', so I tried to send an H1 and... it worked. Not two minutes after the whole class was sending pictures (what kind I'll leave to your imagination), changing the CSS and even crashing the app. One of the funniest days in the course, for sure.
@workingTchr
@workingTchr 3 года назад
Thanks for a great tutorial. The "rooms" stuff which is what I really needed starts at 34:20. One quip (but it applies to all coding videos I've seen) is that I'd like to see a totally bare-bones explanation first and then, in a series of steps, build on that up to the final end product like was made here. That would help me separate the essential from the incidental, but other than that, this was a super useful and well thought out presentation of a difficult subject.
@Kngdmio
@Kngdmio 4 года назад
Brad: “Hello John” *John has left the chat.. John wanted none of that 😂
@TraversyMedia
@TraversyMedia 4 года назад
lol!! Screw John
@goldfishbrainjohn2462
@goldfishbrainjohn2462 4 года назад
Who is calling me? XD
@sharathm710
@sharathm710 4 года назад
Hey how to connect to server its showing [nodemon] clean exit - waiting for changes before restart 7:56
@nicolasanelli
@nicolasanelli 3 года назад
@@Kingelodeon you have to configure some build, and then, any javascript/node server should handle it
@adriaanstips1407
@adriaanstips1407 3 года назад
@@sharathm710 i had errors in my terminal the whole time but all worked out so if your code is exactly the same just test the website
@cosminsmokyn6989
@cosminsmokyn6989 4 года назад
Hi Brad, I am curently on the MERN stack, will finish it later today and I can't wait to build with you this chat app :D, Thank you again for your work!
@yousseftayea2014
@yousseftayea2014 3 года назад
Had you built it?
@syntaxed4365
@syntaxed4365 4 года назад
Ayyyy, I'm building a messaging app right now with the principles from your MERN course, and what do I see this morning? You put out a sockets video. Legend.
@wingsaber629
@wingsaber629 4 года назад
Yeah! It would be excellent to add a Chat feature to his Developer Connector MERN course.
@TraversyMedia
@TraversyMedia 4 года назад
Hope everyone is staying safe and trying not to go nuts :) Here is a little project to keep you busy for a little bit and take your mind off of everything Also should be: const PORT = process.env.PORT || 3000;
@MULTICODE
@MULTICODE 4 года назад
Thanks, please can you make a videos on how to setup laravel and Angular together buy building a small project please
@aniskarim1934
@aniskarim1934 4 года назад
Thank you Brad
@ln9808
@ln9808 4 года назад
Thank you so much, Brad, for all your fantastic tutorials!
@ahmedaltaai69420
@ahmedaltaai69420 4 года назад
brad, my man! 2 days ago I bought your latest course on vanilla js and I must say your teaching style IS AMAZING! I have been a fan since 2016 are you planing on making a nodejs udemy course? I would buy it right away!
@rashidbehnam2139
@rashidbehnam2139 4 года назад
Thanks bro , God bless you
@codu
@codu 4 года назад
Oooh refreshing some of my Node skills at the moment so this is perfect timing! Looking forward to it, keep up the awesome work Brad 💜
@paritoshbatish9984
@paritoshbatish9984 4 года назад
I am new to NodeJS but don't we have to set app.get("/", ()); and send index.html here How does it work without app.get("/");
@MeAsMeButMe
@MeAsMeButMe 3 года назад
Brad you're honestly such a gift to the developer community! Your content has helped me more than anything else! Have the greatest 2021 and stay safe!
@KahlilAshanti
@KahlilAshanti 4 года назад
this is the only channel where I feel compelled to like the video before I've even watched it. keep up the great work
@aymanjaber2585
@aymanjaber2585 4 года назад
Spent about half an hour debugging it, turns out I had a "user", instead of "users". Great video thanks.
@PushpakSharmaworkandenjoy
@PushpakSharmaworkandenjoy 4 года назад
It happens. 😅
@jimhalpert9803
@jimhalpert9803 4 года назад
Everyone can relate
@yousseftayea2014
@yousseftayea2014 3 года назад
Have you built it?
@fevicoI
@fevicoI 3 года назад
This is what happens when you copy something word for word.
@manavpatnaik1948
@manavpatnaik1948 3 года назад
I could hear your "Ohhhhh" when you found that out.😂😂
@kokoqui
@kokoqui 4 года назад
Amazingly well done tutorial! This was my first experience with web sockets and I had no issues understanding the process. I am excited to add more features. Thank you!
@learnsomething9838
@learnsomething9838 2 года назад
Is it complete project or any other continuation video is there please respond anyone
@Just_one_more-bv3bg
@Just_one_more-bv3bg 6 месяцев назад
it is complete video@@learnsomething9838
@dean6046
@dean6046 4 года назад
Thank you Brad! You're the man as always. Keep your head up and I'm looking forward to talking to you more on patreon.
@josimarramos91
@josimarramos91 4 года назад
i only found your videos lesson this week man you are the best, simple easy and very clear and u give all material for easy learn thanks too much, keep like that i recomend your channel 4 everyone
@DuyTran-ss4lu
@DuyTran-ss4lu 4 года назад
Oh god! My man Brad can read my mind or what? I just started to build a Chat app with Socket.io and Express yesterday.
@bewellegoist
@bewellegoist 2 года назад
So cool that you've actually debugged your app and showed it to us. I mean, it is very nice you didn't cut that part. Shows the real process as is
@maxm1nd
@maxm1nd 4 года назад
I'm sorry, but at 6:18 a mistake was made: PORT never will be equal process.env.PORT. Most likely Brad wanted to write the following: const PORT = process.env.PORT || 3000;
@sunguru981
@sunguru981 4 года назад
Correct. He usually does that, kind of reversed only in this video actually.
@tannerbarcelos6880
@tannerbarcelos6880 4 года назад
Reaffirming this comment. He always usually builds the port as seen in your comment correction. Incase anyone is questioning it
@TraversyMedia
@TraversyMedia 4 года назад
Lol brain fart 😕 sorry about that
@tannerbarcelos6880
@tannerbarcelos6880 4 года назад
Traversy Media don’t worry, Brad, notice how we all knew what you meant! Your teaching is legendary man!
@maxm1nd
@maxm1nd 4 года назад
@@TraversyMedia I didn't want to belittle this great masterclass in any way. On my part, it was a desire for perfectionism and nothing more... :)
@anonymous_basics
@anonymous_basics 6 месяцев назад
everyone says socket io is really hard to implement. seeing your this video took the fear out of me. thank you. your teaching style is so amazing. ❤
@moritzw42
@moritzw42 4 года назад
Hey Brad, you're awesome. I think you have a great positive impact on society with the free content you put out! It's also cool to see more backend tutorials like this coming. *Now* *to* *my* *Question* : In one of your last videos, you mentioned that you're planning to go a little more into *coding* *challenges* . I am currently looking to learn about Algorithms and Data structure but *in* *a* *practical* *and* *project-based* *way* . This could be something like cloning a repo on building a small example dataset/project to then implement some sorting algorithm or and learn how to make use of different algorithms and optimizations. I was wondering if you can recommend any *resources* in that realm or produce some content like this. I would be happy to help you to produce such content. Perhaps there is an open-source-way we can all collaborate on this. Cheers Mortiz ✌🏼
@mladendubovac335
@mladendubovac335 3 года назад
Hands down , The Best Teacher on RU-vid .
@smsibasish
@smsibasish 4 года назад
Cool. I will try to implement it in React and add to your DevConnector MERN stack course.
@ednethgirao
@ednethgirao 4 года назад
I'm so glad to find this tutorial, I was actually studying about websockets hours ago, and setting up a lot of documentations this lesson will probably make it easier to understand, thank you, your content had already reached Africa
@pablomotta___
@pablomotta___ 4 года назад
I can't wait to go through this tutorial. Thanks, Brad! Government: "Coronavirus is out and ya'll gotta stay home and find something to do" Brad: " Ooo, I'm gonna teach people how to create a chat room so they can hang out online... 😁"
@mrnobodyy96
@mrnobodyy96 4 года назад
You are so helpful! I love you. Please never change. I can see that you are doing this for the sake of teaching and money is not a priority which reflects on your good quality work. I truly appreciate that!
@nakulshyamkumar9122
@nakulshyamkumar9122 4 года назад
You're the best, Brad! I just bought a bunch of your Udemy courses while I practice social distancing. I can't wait to do this project, too.
@SaiPrakash16
@SaiPrakash16 3 года назад
By far a better version of a good chat-app tutorial Ive looked so far. Subscribed.
@GoldNugget
@GoldNugget 4 года назад
Brad could you continue this tutorial by connecting everything to database. Also I'd never actually uploaded my projects to any kind of hosting so it worked online, I don't really know how to do that, could you use some free web-hosting to do tutorial of that?
@danieloliveira9815
@danieloliveira9815 3 года назад
You can deploy your project on heroku. It is free (has its limitations of course) and I personally like it very much. It has an intuitive UI and if you have a github repo with your code you can deploy your app in just a couple of clicks :) My first-ever web app I deployed there and that taught me a lot. I hope this helps you as well.
@GoldNugget
@GoldNugget 3 года назад
Pão de Forma I will try it out, thx
@JC-vh7vy
@JC-vh7vy 2 года назад
Brad, you are awesome! I have been looking at similar tutorials all week and there is nothing as useful as this one by far. I wish RU-vid had a way to rank videos within categories, this one would top the Realtime chat list. I wish you all the success in the world.
@mssadewa
@mssadewa 4 года назад
wow, I don't know. But this is what I need now. Node Express Socket.io! Thank you!
@thunderboltxtra2811
@thunderboltxtra2811 3 года назад
does he use react in this...i hvnt watched the video yet just wanted to know
@mssadewa
@mssadewa 3 года назад
@@thunderboltxtra2811 I'm wrong, he doesn't use react
@tippififestarr6519
@tippififestarr6519 3 года назад
just finished watching, really appreciate your excellence in building my mental models and muscle memories, not to mention the perfect way to jumpstart my project... after the tutorial, now my hard work begins 🤓
@tastyrobot9369
@tastyrobot9369 4 года назад
Possibility of XSS? innerHTML is used. Not much to be stolen but you can still execute stuff to like crash browser
@jimhalpert9803
@jimhalpert9803 3 года назад
Very easy to XSS this project. I don't like how he just adds the raw message from server to as html to the client. That's textbook level fuck up.
@programmingpython584
@programmingpython584 4 года назад
The bast part of your videos is that you are always to the point and we always learn a lot from them.Thanks a lot!
@JustMe20132
@JustMe20132 4 года назад
Great job like always. Just can you add call/video feature to this project and how?
@starkstraitosTV
@starkstraitosTV 4 года назад
Probably a different library
@cerebroferby9163
@cerebroferby9163 3 года назад
Great tutorial! I don't have much experience and could understand almost everything just by the video itself and a bit of documentation.
@sohamsuvarna
@sohamsuvarna 4 года назад
I'm new to coding, this project is helping me alot, the only help I need is how to store all message in database so that when a new user joins or old users join again they could see previous messages. Please help me with that, Thank you
@sharathm710
@sharathm710 4 года назад
Hey how to connect to server its showing [nodemon] clean exit - waiting for changes before restart 7:56
2 года назад
Hi Soham, Iam facing the same problem. Did you find a good solution? best regards Pete
@gurparkashsinghrandhawa
@gurparkashsinghrandhawa 2 года назад
To anyone who still has this problem, the easiest way to implement this would be to save each message into the database as a message event emits.
@rameezroot5225
@rameezroot5225 2 года назад
@@7heMech yeah I need help do you have any link from where I can learn that?
@jpg6113
@jpg6113 4 года назад
Who could possibly downvote this. Thank you Brad!
@vaniad555
@vaniad555 3 года назад
Did I miss connecting with MongoDB ? Part ||
@darrenedwards7517
@darrenedwards7517 4 года назад
Just now finished the app Thanks so much really enjoyed learning from this keep up the good work.Stay safe and thanks once again for the distraction from crazy times. hope you and your family are save and all the subscribers are as well.
@sharathm710
@sharathm710 4 года назад
Hey how to connect to server its showing [nodemon] clean exit - waiting for changes before restart 7:56
@bhupendranagda9563
@bhupendranagda9563 4 года назад
waiting for mongodb version please make it fast you are such a life saviour
@muhammadzaakirmungrue3146
@muhammadzaakirmungrue3146 2 года назад
Thanks Brad, I used this code to build a chat component for my React app. Instead of adding the tag I had to install socketio-client on the front end and change the submit actions of the index.html page and chat.html pages.
@jemjem8902
@jemjem8902 4 года назад
Haven't used express for a while since I am busy in school, I just realized I forgot a lot of simple things. Thanks for this I recalled some!!
@Winedineandrhyme
@Winedineandrhyme 3 года назад
how do you integrate a database to store the messages, users, etc.
@maheshmahadar4780
@maheshmahadar4780 3 года назад
there is no any database
@The__Leo69
@The__Leo69 3 года назад
At the point when we recieve message on server, you can add mongodb etc db query.
@kevinm5898
@kevinm5898 3 года назад
@@maheshmahadar4780 Of course there's no database, that's why he was asking how to implement one.
@kumarvishalben
@kumarvishalben 3 года назад
You could use a queue service which puts the bulk of messages on db once the bulk size is at specific size or time passed since last message is specific time.
@therandomsomeone.
@therandomsomeone. 3 года назад
DON'T. this requires a lot of setup to do. stay with this good old simple one.
@jingnuan815
@jingnuan815 4 года назад
This is a fantastic tutorial, instructions are clear and easy to follow, thank you Traversy Media! I followed on and was able to create a web chat that functions as expected. Now I'm going to build upon it, give it a database and hopefully add more functions to it. Thank you so much!
@Chrosam
@Chrosam 4 года назад
06:19 process.env.PORT should come first before the 3000
@tanayraj2991
@tanayraj2991 4 года назад
Can you explain the reason??
@user-v2eqj8xiz4l
@user-v2eqj8xiz4l 3 года назад
One of the best tutorials I ever have seen! Everything was neat and clean and I did not get bored at all. learned some interesting points. thank you.
@anshikgupta2993
@anshikgupta2993 4 года назад
Sir can teach this project as full stack that is with react and mongodb
@CapeSkill
@CapeSkill 4 года назад
yes i'd like to see with react and mongodb :)
@adarshpandya
@adarshpandya 4 года назад
Brad already have mern stack series
@anshikgupta2993
@anshikgupta2993 4 года назад
@@adarshpandya but there is no socket.io in it
@khandoor7228
@khandoor7228 4 года назад
yes exactly what i would like to see
@DavidAinsworth37
@DavidAinsworth37 4 года назад
Perfect timing to release this really interesting little project, thank you, lots of fun completing it.
@uuutttuuubbbee
@uuutttuuubbbee 3 года назад
Thank you! This is I was getting really frustrated trying to go through socketio documentation but this is 1000x better.
@ebentee
@ebentee 4 года назад
I just want to say, God bless you for the wonderful work
@martinn1071
@martinn1071 3 года назад
Aamazing stuff as usual! I've watched this video like 37 Times and I always get something new out of it. Thanks for sharing! Can't wait too see what you come up as a follow up. You're the man!
@wcyoutube
@wcyoutube 4 года назад
Wanted to learn about WebSocket for a while and this video is awesome!
@sahanweerakoon8544
@sahanweerakoon8544 4 года назад
If it wasn't for Brad Traversy I will never be a developer. Thanx a lot dude.
@Kangleipak09
@Kangleipak09 4 года назад
Hello Brad! Hope you are safe and healthy! We are all lockdown at home. Perfect time to watch all of your videos!
@may-if9de
@may-if9de 4 года назад
Thanks for your hand-to-hand sharing that how to build the chat room by Socket.IO, I learn a lot 😀 Hopefully, we're all good in this time. 💜
@r-i-ch
@r-i-ch 4 года назад
Brad, as always you are the MAN! Want to share a tweak I did - Instead of moment.js, I used this function for HH:MMap time format: function getTime() { const currTime = new Date(); return currTime.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true })// you can add .toLowerCase().replace(' ','') too }
@mintrecords1699
@mintrecords1699 4 года назад
Really helpful project to get into while you are quarantined. Thanks!
@alexkey9372
@alexkey9372 4 года назад
I've been looking for a good socket.io lesson so long!! thank you so much Brad!
@ngocvunguyen4695
@ngocvunguyen4695 4 года назад
just finish following the video. thank you, Brad. I can't wait to learn more about Nodejs contents from you!
@sulaimanbaig5978
@sulaimanbaig5978 4 года назад
I love the way you teach... Thank you so much sir for sharing indispensable knowledge.
@umardev4608
@umardev4608 2 года назад
Brilliant sir. I watched many videos on RU-vid, but this is very helpful.......
@Javoke
@Javoke 4 года назад
Wow!! You are amazing!! The explanation is so clear, and this exercises help a lot in the understanding of all those tools!! Thanks a lot for sharing!!
@FreyrFox
@FreyrFox 3 года назад
This was incredibly thorough and helped teach me a ton along the way, big noice.
@faridisayev1570
@faridisayev1570 3 года назад
I suggest this video for everyone! Waiting for similar videos!
@techtechtuts
@techtechtuts 4 года назад
mIRC revolved again with node and socket.io, Thanks Brad
@jasonzhang6534
@jasonzhang6534 5 месяцев назад
this tutorial is very intuitive and easy to follow. Thanks for sharing.
@Vic08654
@Vic08654 3 года назад
Thank you for this tutorial! This is the first tutorial I have seen with this good explanation and help.
@raviprakashsingh9782
@raviprakashsingh9782 4 года назад
One of the best explanations and videos ever made on this topis Thanks a lot!!!!
@degraphe8824
@degraphe8824 4 года назад
This was wonderful needed this exact tutorial for a job. Thanks so much Brad... thanks so much for everything bro. Please Stay Safe :) we need you to keep helping us out after this craziness around the world ends. God bless you
@carlosmaralit8784
@carlosmaralit8784 11 месяцев назад
This man is so good at explanation and writing code :)
@isaacweber2397
@isaacweber2397 4 года назад
Love your stuff man. Been watching you for years. Stay healthy!
@DanielWinterAt
@DanielWinterAt 3 года назад
At 56:40 I think everything was already working perfectly fine. It was just that one user was in Python and one in Javascript :) The Join method works without a string as well, although it would combine the values separated by a comma, so it would still look wonky.
@prathamchoudhary
@prathamchoudhary 3 года назад
Your videos are awesome helps to create a better cv thank you man
@josephwong2832
@josephwong2832 4 года назад
Brad, during this pandemic I am binge watching all of your tutorials! I hope you and your family stay safe and healthy as well
@aamirkhan-ql8er
@aamirkhan-ql8er 4 года назад
Hi Brad. I am your huge fan. I love your teaching style and your content. I humble request to you please make video on most commonly used rxjs operator in angular with practical guide. Rxjs operators are most confusing for me.
@alicendeh8048
@alicendeh8048 4 года назад
Who on Earth dislikes a video from Brad Traversy???
@faxxo9635
@faxxo9635 4 года назад
I wanted to build this yesterday, now brad gave me. Thnx
@goldfishbrainjohn2462
@goldfishbrainjohn2462 4 года назад
Appreciate that you spent your time for making this video. It is very helpful
@azerate3573
@azerate3573 2 года назад
Thank you! This was an awesome project and experience =D Had a really good time writing this, you're an awesome instructor ..
@shabarish2727
@shabarish2727 4 года назад
This is an amazing tutorial. Now i know a little about Socketio and can further research on it. Thank you sir !
@rockylikespocky
@rockylikespocky 4 года назад
Awesome tutorial as always! Would love to see you continue this chat app into a series. Possibly implementing a login system with Google, Facebook, and Twitter?
@djunidjuna4768
@djunidjuna4768 Год назад
Very good presentation!!! Merci beaucoup, c'est très bien expliqué. Vous méritez des encouragement. Thank's for the explanations🙏
@ts3798
@ts3798 4 года назад
Just a tip to people who are just starting out. Even if tutorials like this might seem to advanced for you, just code along anyway. You might not understand everything, but you'll still pick up things here and there that will help you out in the long term.
@theprocoder6324
@theprocoder6324 3 года назад
my observation: you can write and execute HTML code in the chat for eg: type code in the input and press enter, u will see the chat has taken the role of HTML. i hope u understood :)
@jimhalpert9803
@jimhalpert9803 3 года назад
Which is very very insecure as a person could send a javascript script as message and everyone would recieve it on their end and the script will execute for everyone who recieved the message.
@bankytechs
@bankytechs 4 года назад
God bless you Brad. Been waiting for this for long.
@dre1997ful
@dre1997ful 11 месяцев назад
Thank you for the tutorial! It took me awhile to figure out why I was getting bugs. But it all work out
@jamil_mikael
@jamil_mikael 3 года назад
Awesome i have my own chat app ......it took a while but listening to you has been quite the experience thanks yo!!
@VTKFJK
@VTKFJK 3 года назад
This was actually very helpful. Thanks for putting this together.
@PritamBohra
@PritamBohra 3 года назад
You are one of the best teachers Brad :)
@julianranieri6014
@julianranieri6014 2 года назад
" But we are doing this all vanilla javascript" - Brad 💪 Thank you so much!
@ztube2279
@ztube2279 Год назад
Thank you brad, it's an amazing tutorial. You're so generous.
@camillerungette5050
@camillerungette5050 3 года назад
This video is really really great ! Your explanations are very clear and understandable, thanks a lot you saved my day :)
@koljaehmling4534
@koljaehmling4534 Год назад
Just completed it, thanks for the tutorial. If you follow the instructions step by step, there is a little hickup between minute 10 and 14. Tthe check on 11:54 doesnt work without the complete io.on('connection',.... function on line 14 in server.js which is complete enough around minute 14.
@SihaoCao
@SihaoCao 4 года назад
Thanks for the tutorial Brad! This is a cool app using socket.io. Thanks for sharing it with the community and stay safe!
@Toxicblackmambahs
@Toxicblackmambahs 3 года назад
@25:59 this is what I been looking for, thanks so much
@luigidavidemicca4278
@luigidavidemicca4278 4 года назад
Hi I'm a follower of yours from Italy. This video gave me the idea to rebuild it using python and Django channels along with websocket. Anyway since node js remains pretty unknown to me PLEASE make another video with mongodb integration and so on. Hope you guys all over the best. Stay safe, here it's really no fun the situation.
@3nails1cross11
@3nails1cross11 4 года назад
Notification from Brad? This must be good ^^ Thanks Sir Brad. ^^ Love lots from Philippines.
@willmakk
@willmakk 4 года назад
Good god Brad you're a machine. Cheers from Spain, stay safe out there.
@shukhpakhi9353
@shukhpakhi9353 4 года назад
you are awesome for the web application...........i am so glad and impress to your watching application...many many thnx
@Imabsarkhan
@Imabsarkhan 4 года назад
Good job Brad, i was just thinking about the same kind of project and you made it. Awesome 👍
Далее
Express JS Crash Course
1:14:01
Просмотров 966 тыс.
小路飞嫁祸姐姐搞破坏 #路飞#海贼王
00:45
Build an Expense Tracker | React Hooks & Context API
49:41
socket io crash course | easy way
40:57
Просмотров 100 тыс.
The Importance of Specialization in Coding
7:13
Просмотров 232 тыс.
Learn Socket.io In 30 Minutes
27:27
Просмотров 503 тыс.
Node.js Crash Course
2:06:35
Просмотров 189 тыс.
Node.js With Passport Authentication | Full Project
1:24:56