Build a Real Time Chat App With Node.js And Socket.io

Поделиться
HTML-код
  • Опубликовано: 15 июл 2024
  • In this video you will be creating a real time chat application complete with usernames and connect/disconnect messages. You will use Socket.io to manage real time web socket connections to a Node.js server that will allow you to communicate real time chat messages to all clients connected to a single server.
    This entire project will take less than 100 lines of JavaScript and almost no HTML/CSS, but it is incredibly powerful what can be done with such little code. By the end of this video you will have a strong understanding of how to send and receive messages using web sockets and Socket.io to make any real time application.
    📚 Materials/References:
    GitHub Code: github.com/WebDevSimplified/R...
    Socket.io: socket.io
    🧠 Concepts Covered:
    - Using Socket.io to create web sockets
    - How to send messages to clients in real time
    - Handling user connection/disconnection
    - Appending elements with JavaScript
    - Sending messages to the server in real time
    🌎 Find Me Here:
    Twitter: / devsimplified
    GitHub: github.com/WebDevSimplified
    CodePen: codepen.io/WebDevSimplified
    #ChatApp #RealTimeChat #JavaScript

Комментарии • 772

  • @theartlegend3772
    @theartlegend3772 3 года назад +377

    I'm gonna go make Twitter now

  • @yamogebrewold8620
    @yamogebrewold8620 3 года назад +19

    Real-time sockets are so awesome. I love how it's all built around the publish and subscribe pattern too. So easy to follow along. Awesome tutorial, thanks!

  • @smallzebra19
    @smallzebra19 3 года назад +22

    He doesn't time pass, but goes straight to the point.

  • @AustinBeaufort
    @AustinBeaufort 4 года назад +19

    This is exactly what I needed man, thanks!
    I've been trying to use arduino with johnny-five and web sockets for a while to
    be able to change the color of an rgb led from my phone, and this has helped
    a ton in seeing how web sockets work.
    Awesome content!

  • @raeedchat4113
    @raeedchat4113 2 года назад +2

    We used this tutorial and now we've come such a long way! Thank you web dev simplified!

  • @patrickc.6183
    @patrickc.6183 4 года назад +4

    That intro was great! I love your sense of humor in these videos :).

  • @kevinsetazate4502
    @kevinsetazate4502 4 года назад +12

    Thank you bro!!! this is what i'm looking for, no templating engines or frontend frameworks just native.

  • @arifkasim3241
    @arifkasim3241 2 года назад +6

    Succinct, lucid and a calm, soothing explanation. You are an ideal tutor. Enjoyed the video very much.

  • @God5147
    @God5147 4 года назад

    I'm just learning node and express...etc because of my future, then I got a good page finally so I'm really thankful for this opportunity

  • @elenakout
    @elenakout 5 лет назад +23

    excellent as always!!
    You are the best company on afternoons that I want a break and to just have fun with a project and learning new things!!

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +7

      Thank you! I'm really glad I can make your afternoons and learning something to look forward to.

  • @ansuman4233
    @ansuman4233 4 года назад

    This was very helpful to start with the basics!
    I have subscribed to this channel and would go through the rest of the content.
    Thank you :)

  • @A68AGaming
    @A68AGaming 3 года назад +1

    thanks so much for the tutorial, i always had a lot of trouble doing the networking stuff and this helped me a lot!

  • @jeyzzz696
    @jeyzzz696 5 лет назад +4

    thank you for having tutorials that does not go beyond 20mins. more power to you man

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +3

      I try to keep the videos as short as possible since I hate long videos.

    • @lordofdawn6871
      @lordofdawn6871 2 года назад

      @@WebDevSimplifiedMe too

  • @MaNiMaBaLLa
    @MaNiMaBaLLa 5 лет назад +233

    This is perfect for what I needed for my website.
    I'm definitely gonna put this to use.
    You da man.

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +26

      I'm glad I could help.

    • @samishafi6535
      @samishafi6535 3 года назад +2

      @Shlok Jain haha you dont need to download just use npm i socket.io on terminal

    • @_.sunnyraj._
      @_.sunnyraj._ 3 года назад

      @Shlok Jain Gawar

    • @mathewsjoy8464
      @mathewsjoy8464 3 года назад

      @@WebDevSimplified how did you get the local host at the start?

    • @plamam7
      @plamam7 2 года назад

      @@mathewsjoy8464 vs code live server

  • @talibelm5792
    @talibelm5792 Год назад +1

    I have made my first Javascript& Node.js project 😊 Thank you very much!

  • @erensarikaya8767
    @erensarikaya8767 5 лет назад

    perfect.
    no much talk, no blabla, only what you need to know

  • @MegaNightdude
    @MegaNightdude 3 года назад +3

    That is so awesome! God bless you, man!

  • @aaronj6571
    @aaronj6571 3 года назад

    cant believe i faced click bait on other videos like THIS..... THANKS A LOT..subed

  • @scottmcmahon7209
    @scottmcmahon7209 3 года назад +1

    I've said it before and I'll say it again, you're a very smart young man :)

  • @denisedrey921
    @denisedrey921 4 года назад +1

    Thank you dude, that was amazing!

  • @PandaciteYT
    @PandaciteYT Год назад +1

    This is exactly what i was looking for!

  • @mathewsjoby6455
    @mathewsjoby6455 2 года назад

    Wow! That was awesome and I loved it! Hoping for more amazing content!!! 🤓🤓

  • @lolglolblol
    @lolglolblol 4 года назад

    This is great for my school project. I think I now have a better idea of how to do it
    thanks!

  • @myworldbox
    @myworldbox 4 года назад +12

    Priceless content
    Applause from Hong Kong student
    XDDDD

  • @moneyisenergy
    @moneyisenergy 4 года назад +1

    Thank you that was a great tutorial!

  • @luis96xd
    @luis96xd Год назад

    Amazing tutorial, everything was well explained, thanks!

  • @nithinkjoy2158
    @nithinkjoy2158 4 года назад

    i am very new to javascript... i didnt understand anything.. but i believe that after 6 months i will be clearly able to understand it... thank you

  • @richardlatham7927
    @richardlatham7927 4 года назад

    Thanks for this. I was looking for an example to work through to help me learn about connect.io. This has worked well,

  • @asdasddas100
    @asdasddas100 4 года назад

    This gave me a great idea. Thank you

  • @ib6548
    @ib6548 4 года назад

    This perfect for what I needed right now. Thank you

  • @tanayraj2991
    @tanayraj2991 4 года назад

    Best video to understand the basic of socket.io library 💖

  • @anandpari24
    @anandpari24 5 лет назад

    Nice man, Love it

  • @mhdyousuf3392
    @mhdyousuf3392 5 лет назад

    I always wondered how chatting works... Awesome content and thanks a lot!

  • @electrotsmishar
    @electrotsmishar 4 года назад

    Perfect tutorial. Thanks again

  • @chungtunguyen6135
    @chungtunguyen6135 4 года назад +1

    thanks for this tutorial my brother! keep going! i'll give you sub and like your video!

  • @maverick4636
    @maverick4636 2 года назад +2

    FINALLY! A good tutorial that ACTUALLY is what i was looking for! thankyou soo much!

    • @SahilSharma-gu2kx
      @SahilSharma-gu2kx 2 года назад

      ruclips.net/video/URMS-08eCA8/видео.html

    • @KeskilChnProgram
      @KeskilChnProgram Год назад

      Has that code worked?

    • @maverick4636
      @maverick4636 Год назад

      @@KeskilChnProgram i cant remember, i think it ended up with quite a few issues

    • @KeskilChnProgram
      @KeskilChnProgram Год назад

      @@maverick4636 did you fix that issues?

  • @JCDZK
    @JCDZK 2 года назад

    Short videos ftw. Cheers buddy, subscribed

  • @abdulazizalghafli5240
    @abdulazizalghafli5240 5 лет назад +1

    Great topic. It's easy to understand from you. Thank you.

  • @andylib
    @andylib 4 года назад +10

    This is amazing, what I'd be interested to see is a live ticker application e.g. for a football game

    • @matstacy6830
      @matstacy6830 4 года назад +1

      what is a live ticker?

    • @NoName-ui5ou
      @NoName-ui5ou 4 года назад +2

      Mat Stacy basically a description of a live football (or any other sports) game. So fe when someone scores you‘ll get a message like „X scored. Current score: 2:1“ or smth like that

  • @BluePhoenixGames1
    @BluePhoenixGames1 5 лет назад

    Thank you, awesome as always :)

  • @lazyworkroom
    @lazyworkroom 4 года назад

    Thanks as always! :)

  • @balance_andbliss
    @balance_andbliss 4 года назад +1

    Thank you so much for this. Please make a tutorial video showing how we can create PWA chat app ? Great work dude! I speak for all newbies out there when i say... THANK YOU!

  • @saitejagatadi9711
    @saitejagatadi9711 4 года назад

    You have explained in a superb way bro..
    Keep doing these amazing videos...

  • @klznpch7512
    @klznpch7512 3 года назад

    thanks for teaching me how to use disconnect :)

  • @Legitivity
    @Legitivity 3 года назад

    Great video! very helpful! thank you!

  • @avineakduwal1518
    @avineakduwal1518 3 года назад

    Thanks a lot.... Really searching for short sweet to the point vdo...

  • @emr3364
    @emr3364 4 года назад +80

    Normal people: social distancing
    Developers: socket io chat

  • @surajvijay1937
    @surajvijay1937 2 года назад +5

    "and that is going to be easy" - Quote of this video

  • @realdlmgang3486
    @realdlmgang3486 3 года назад

    Guys this man is a legend thank u

  • @saswatisinha7735
    @saswatisinha7735 3 года назад

    thanks....it worked..i have learned so may things from this

  • @ParrotPentester
    @ParrotPentester 3 года назад

    Best Intro EVER!

  • @danielmadison4451
    @danielmadison4451 Год назад

    Hey Kyle what a great video. I have a running Apache server and a Mysql server running from scratch. Now I want to hook up my Database to this chat server. Then I will have 3 ports all doing something important. LOL I love a challenge.

  • @Tsukasa1929
    @Tsukasa1929 4 года назад +39

    Hey nice channel, I like the way you explain programming and how clear you manage the information, will you extend this topic using a different app, not a chat, mb a real time post update or a new DM receive??

    • @WebDevSimplified
      @WebDevSimplified  4 года назад +15

      Thank you! I do want to expand upon the idea of web sockets and real-time communication since I think it is fun to work with an really useful. I right now do not have any project ideas for such a project, but I am sure I will come up with one eventually.

    • @afonsonzango
      @afonsonzango Год назад

      @@WebDevSimplified You used the port 3000, what If I wanna deploy this aplication? It won't be in localhost, so, what do I do?

  • @soultouchingsongs
    @soultouchingsongs 4 года назад

    Thanks a ton👍. You are just awesome..

  • @dpaul3447
    @dpaul3447 3 года назад +1

    Your Intro's are pretty cool...👍👍

  • @nnnpooh
    @nnnpooh 3 года назад

    This video is perfect, which is perfect.

  • @Tri-lime_Spanish
    @Tri-lime_Spanish 2 года назад

    YOU´RE SO GOOD MAN

  • @sudonick2161
    @sudonick2161 3 года назад

    This guy makes node js look so easy..

  • @suelingsusu1339
    @suelingsusu1339 Год назад

    Well done... this is nifty!!!👏👏👏🙏🙏🙏🙏👌👌👌👌👌🖖🖖🖖🖖🖖

  • @robertomoura552
    @robertomoura552 4 года назад +3

    Awesome video! Thanks! Can you also make a tutorial on how to deploy it? (On AWS for example)

  • @sherifsalah5563
    @sherifsalah5563 5 лет назад

    Wow, you are absolutely amazing.

  • @Lolo5
    @Lolo5 4 года назад

    thanks. good video as always

  • @migueldomingos4570
    @migueldomingos4570 3 года назад

    Loved the intro

  • @thinkhub1003
    @thinkhub1003 4 года назад

    Great thing is, you've done it in under 20mins.

  • @telugucult1629
    @telugucult1629 3 года назад

    Thank you I am Searching for this

  • @sadico8344
    @sadico8344 4 года назад +1

    A bit complicated but useful and interesting :)

  • @lucasdf8694
    @lucasdf8694 3 года назад

    Thank you very much!

  • @mohammeddhillshaardthd2122
    @mohammeddhillshaardthd2122 4 года назад

    Awesome sir... Just let me give a try to node...✌👍

  • @safari2411
    @safari2411 4 года назад

    Thanks for the excellent explanation!

  • @HackerFlavio
    @HackerFlavio 2 года назад

    amazing video did had to do a bit of work arounds but over all works perfectly

    • @HackerFlavio
      @HackerFlavio 2 года назад

      @Google Security you have to be more specific

  • @kfiryahav2987
    @kfiryahav2987 3 года назад

    YOU ARE THE BEST!!!

  • @hsngsoftware4380
    @hsngsoftware4380 4 года назад

    Greatly explained

  • @jeffrinmanovaprabahar
    @jeffrinmanovaprabahar 5 лет назад

    Good content and good content delivery as usual.

  • @etruscanetwork
    @etruscanetwork 5 лет назад +1

    That's awesome!!!

  • @MW-vg9dn
    @MW-vg9dn 5 лет назад

    Excellent tutorial!

  • @bikramchettri9405
    @bikramchettri9405 5 лет назад

    Thanks for the wonderful content.

  • @ahmeterkan48
    @ahmeterkan48 3 года назад

    thank you man you are awsome

  • @RobertWildling
    @RobertWildling 4 года назад +1

    Gotta love that intro!!! :-D

  • @khadijasworld3899
    @khadijasworld3899 3 года назад

    Thanks MAN !! ❤❤

  • @Krokodil986
    @Krokodil986 4 года назад +1

    Haven't tried it yet but seams like it'll work. 😆🤪🤪

  • @romimaximus
    @romimaximus 4 года назад

    That was awesome...thankx for sharing

  • @aditimahabole1761
    @aditimahabole1761 Год назад

    you are the bestttttttttttttttttt!!!! thankyouuu

  • @afnanamer9213
    @afnanamer9213 3 года назад

    Brilliant!!
    You saved my life
    I was looking for a tutorial that shows how to upload files or pictures in a real time chat app? Do you have any basics ideas of how we can do it or any resources?
    Thanks a lot.

  • @mohammadanarul624
    @mohammadanarul624 4 года назад

    thank you so much.

  • @karlj.5730
    @karlj.5730 4 года назад

    Please create a tutorial a chat system with a database using MySQL and node.js. With just particular user you wanted to chat.
    AWESOME TUTORIAL BY THE WAY!!!!!!!!!!!!!!

  • @4541047
    @4541047 5 лет назад

    Great contents. Please continue to be unique with your contents.
    All the others web channels are just copying from Traversy Media and he's friends. But I really glad to see your different and great stuff!!
    Thanks!

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +2

      Thank you so much. I view Brad as a huge influence but I created my channel specifically to make content that is simple and concise which was what I found lacking when I was learning web development. I am glad that this teaching style resonates with you.

  • @syafiq55555
    @syafiq55555 4 года назад

    I'd love to see a more advance project with socket.io thank u for explaining ! Appreciate it

    • @WebDevSimplified
      @WebDevSimplified  4 года назад +1

      I have a part 2 of this video you can checkout which goes a bit more in depth.

    • @syafiq55555
      @syafiq55555 4 года назад

      @@WebDevSimplified thank you

  • @hoangphamhuy9096
    @hoangphamhuy9096 4 года назад

    Hi, i just found this awesome channel. Hope to get more awesome videos from you. May i ask can i use this kind of chat in shopping website?

  • @MG-bm5oj
    @MG-bm5oj 4 года назад +1

    Amazing and how simple it was. How are you thinking in making it more complex? Images?

  • @Sanyat100
    @Sanyat100 3 года назад

    Simple explanation

  • @ThatGuyCream
    @ThatGuyCream Год назад

    This man has 999 000 subs! GET HIM TO 1 MILLION RIGHT NOW!!

  • @lingxingkong5351
    @lingxingkong5351 4 года назад +1

    Thank you for your video, it helps me a lot. But I am so curious that how can I add the real-time voice chat function …thank you very much

  • @rvbrindle
    @rvbrindle 4 года назад +2

    Great video! after scrolling the comments to see you are using live-server i now seem to be getting lots of CORS errors in the terminal when trying to run in browser

  • @Sammorris207
    @Sammorris207 2 года назад

    Thank you

  • @VariousSoundEffects
    @VariousSoundEffects 5 лет назад

    Bravo you are de best.

  • @srinivasvxefccyiju9003
    @srinivasvxefccyiju9003 3 года назад

    Thanks a lot broo

  • @babebri10
    @babebri10 3 года назад

    Thanks for the video! How did you open the browsers for the client and server?

  • @guygontar6106
    @guygontar6106 4 года назад +6

    That's really nice and well explained! You got it straight to the point.
    My only question is - do you run this over Express server? you browse localhost:5000 yet the IO variable gets the 3000 port as a parameter. This is something you didn't explain.

    • @selimyurekli6481
      @selimyurekli6481 3 года назад

      5500 port is for live server. He ran client in live server.

    • @poornipriya6198
      @poornipriya6198 2 года назад

      I am newbie to node..can anyone just explain how tat Live 5500 port created and code for tat not shown here rite..by the way rest of the code r just awesome 👏

  • @twotridents
    @twotridents 3 года назад

    Very Cool

  • @Vittal288
    @Vittal288 3 года назад

    Thanks for this app, please create video on rxjs all operators