How To Create A Messaging App With Socket.io And React

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024

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

  • @zdarofMERGAITES
    @zdarofMERGAITES 3 года назад +469

    I can't believe that 8 months earlier I couldn't understand how a simple function with parameters works. And now I'm watching your video in React at 1.5 speed. To everyone who might be struggling: time and effort will take you where you want!

  • @JohnDoe-rj2kf
    @JohnDoe-rj2kf 3 года назад +26

    this is amazing, but I feel like without the tutorial I woud never be able to do something like this. Beyond words. No way I would do this by myself

  • @charlescaldwell2830
    @charlescaldwell2830 2 года назад +58

    As always Kyle, amazing content!!!
    FYI... For anyone that happens to be using Bootstrap 5, some of the classNames may not work. For example, at 10:54, "mr-2" (margin right) would instead be "me-2" (margin end).
    This is also the case with "border-right" needs to be "border-end" at timestamp 27:14.

    • @user-mm1uk3pr5k
      @user-mm1uk3pr5k 2 года назад +1

      you are the best! thank you)

    • @verdyguo
      @verdyguo 2 года назад +1

      Lifesaver mate

    • @eduardogpi123
      @eduardogpi123 2 года назад +1

      @@verdyguo recomended bs5 documentation, it's changing any class...

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

      Life saver!!!!❤❤❤

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

      Thanks for saving our lives

  • @sanskaarpatni9137
    @sanskaarpatni9137 4 года назад +214

    Happy teacher's day Kyleeeee

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

      Lol.

    • @rajesh-royal
      @rajesh-royal 4 года назад

      yes

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

      @@pizzapanni what Lol?

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

      @AmazingFacts No Fiance. 😜😜😜😝😝😝😝😝😝😝😝😝😝😝😝😝😝

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

      How will you eat if you are not hungry. Similarly, how will you learn when you are not interested.
      Teaching is not that special. Many try to spit knowledge, but most do it in the wrong manner. A real teacher guides you, not leaves you confused after telling facts. Teacher is a business, a trade of satisfaction for knowledge. We are happy after learning from someone but then we are unhappy to know we have to guide ourselves further and become our own teachers.
      Teacher's day is actually a celebration of our own selves, not others who incompletely guide us. We are our own masters, our destiny is in our own hands.

  • @elliottarnold9542
    @elliottarnold9542 3 года назад +36

    At 17.07 there is a mistake in the code, which will lead to the error "Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development." to fix this use => if(jsonValue !== 'undefined' && jsonValue !== null ) return JSON.parse(jsonValue)

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

      This helped me out, any idea as to why it doesn't work as shown in video?

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

      thank you so much! I almost gave up after going to the google doc page and the react link for debugging, and still not being able to fix it.

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

      Wow! Thanks, this didn't even come into play until the end.

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

      You should just go to Applications, LocalStorage and clear it out.

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

      @@adamhardie506 maybe a recent update

  • @Ultoman10
    @Ultoman10 4 года назад +7

    I really appreciate your videos so far because you cut out all of the unnecessary crap that makes learning a new concept more confusing. More coding tutorials should be like this!

  • @roshatron
    @roshatron 4 года назад +14

    This is exactly what I need for my college project. Thanks, Kyle

  • @mydhe6
    @mydhe6 4 года назад +59

    Are the seven dislikes bots? Honestly, what's there to dislike. Thanks for this great video Kyle.

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

      some people just had a bad day, and want to share it with the world 😃

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

      Wow in 2 weeks the dislikes grew almost 4 times.

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

      heavy usage of bootstrap, needless usage of local storage, and his face

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

      Not to be rude and i really don't think these things are enough to dislike a video,
      but kyle has a bad habit of not following naming conventions,
      he names many variables with little to no difference like for say contacts,contact or something simmilar
      hence it becomes very difficult to follow along some times

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

      @Luke Mwenda same, I cant keep up with how fast he does things, this is supposed to be a tutorial? I got sooo many errors copying his code, insane

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

    Man, you're at God level w/ the react. Excelsior, mate.

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

    Kyle, you have made learning web dev soooo much easier for me and I appreciate all the hard work you put into this long video. There are so many people out there who are brilliant developers/engineers but who are really bad at explaining things. I'm sorry :P
    You are so good at what you do. Thank you for providing this knowledge for free. You are the most consistently helpful dev RUclipsr I have encountered.

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

    I just realized Kyle grew a beard by the end of the video :D. To do all this in a single shot, you are a monster! Respect++

  • @vansh3777
    @vansh3777 3 года назад +35

    Facebook: *stealing data from users of whatsapp
    Kyle: hold my beer

  • @avimehenwal
    @avimehenwal 4 года назад +4

    I so love this channel

  • @masaforce
    @masaforce 4 года назад +5

    Jesus christ this channel is a gem

  • @user-qi7kk7su3l
    @user-qi7kk7su3l 2 года назад +8

    It seems InputGroup.Append is not in React Bootstrap anymore, just a Button in InputGroup after From.Control will do.

    • @kw4548
      @kw4548 2 года назад +1

      MVP

  • @raocharlie4679
    @raocharlie4679 Год назад +5

    On 17:12 , “ && jsonValue != ‘undefined’” should be added to the ‘if’ parentheses because the browser has returned the error of ‘undefined’ which is a string not a undefined data type. I have tried on Chrome, not sure how other browsers react under this issue.

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

    the speed of narration is breathtaking

  • @KaranSharma-ew7io
    @KaranSharma-ew7io 3 года назад +4

    You and Ben Awad are classic gem

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

    you need to use same bootstrap version as kyle if you want all classes and boilerplates work.
    so if you have problem first uninstall latest react-bootstrap/bootstrap
    yarn remove react-bootstrap bootstrap (or npm uninstall react-bootstrap bootstrap)
    then
    yarn add react-bootstrap@1.3.0 bootstrap@4.5.2
    and finally restart react server

  • @Rexetorize
    @Rexetorize 4 года назад +16

    You're the best teacher man! You taught me a lot ❤️

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

    You are a lion my guy. This is every Software Developer's dream

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

    bro, i finally got around to following this tutorial. and i learned so much more than i expected. The fast paced coding made me sweeet at times

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

    I really love your coding style.
    I learned Javascript while watching your channel regularly and now I have become a snob I think.

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

    Damn... I spent literally 10 hours following this... thanks a lot for making this free!
    There are two things that I want to spot out:
    - I think the approach of setting the receivers in an array and group them without a "group id" makes very troublesome all the process. Setting a group code allows to identify inmediatly the group without need to set a ArrayEquality function, and also will save a lot of logic process in the ConversationsProvider component. Also, in the server you just can let the user Join the group code and socket io will do all the send message task.
    - I don't understad why the socket server is working without the CORS implementatio... I did't use CORS params in my local server and it doesn't work, server just refuses conection. Is it perhaps version changes?

    • @VishalSharma-nc7uy
      @VishalSharma-nc7uy 10 месяцев назад

      I'm also unable to make a connection, how did you solve this?

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

    At 50:12:00 hold alt and you can set multiple marks at any point in vs code; this way you save yourself from writing the same all over again.
    There are helpful snippets for importing modules and using hooks as well...Great video. Thanks for your effort much appreciated.

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

    O my god i don't believe that you made a big tut. Well done body! In my tut i make many hours videos tut. The biggest is 8 hours. Is really very difficult to make big tuts! Again well done!!!

  • @chizuru1999
    @chizuru1999 2 года назад +1

    kyle you know you have a grown a lot!!
    Have been watching your videos since the beginning. Love from India. 🎊

  • @shivkampani158
    @shivkampani158 4 года назад +5

    Happy teachers day man! Thank you so much for your videos!

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

    this is solid. almost broke my remote hitting that pause button so many times but def learned a lot with this one. Thanks bro!

  • @maskman4821
    @maskman4821 4 года назад +4

    This is a fantasic tutorial, I wonder why Kyle doesnt use nextjs to create project ? It gives you ssr right out of box, anyway, this is a practical and useful project, you just need to add webrtc to show the live stream !!!

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

    i was here just to take hints for the backend... but now I realised there's a lot for me to learn in client side as well. I developed something similar to what you are doing here but mine looks way to complicated , isn't well optimized and have way more line of codes even tho ultimately my code dose the same thing as yours... Now I'll watch your vids and refactor my app to make it as clean and optimized as i can.

  • @alexmorrissey-smith6632
    @alexmorrissey-smith6632 4 года назад +11

    Hey Kyle!
    Love all your tutorials, you explain everything so well
    You should do a Trello Clone!

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

    Happy teacher's day sir😇😇😊😊😊

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

    Only channel I play the video and the first second I hit the like button.

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

    Just a heads up for anyone planning to use this.
    If your platform requires any kind of security DO NOT store the conversations in localStorage, this would enable anyone participating in any chatroom to see all messages that have been sent by anyone.

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

      ohh nice, where to store it?

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

      @@osirusj275 databse on the server

  • @DEBBAH1907
    @DEBBAH1907 3 года назад +21

    if you close your eyes and listen you can actually hear JerryRigEverything's voice

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

    Ok... Idk how, but i did everything and it wasn't working, so i did what i read in a comment about server.js
    const io = require("socket.io")(5000, {
    cors: {
    origin: "*",
    }
    });
    it wasn't working either atm, spent some time like 10 minutes and then it worked, still, IDK HOW, anyone?

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

      this fixed my problem with the CORS policy, thanks! I spent a while trying to fix it lol

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

      basically we can enter what origins we allow to connect to , star means all.

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

      godbless you!

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

    I've been searching for this type of MERN stack application,
    I find it really easy to understand either being complex
    Thank U Kyle for your hardwork

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

    Happy teacher day sir.In India teacher is god where there is culture where we facilitating teacher and bows down and touch feet because we believe teacher is god for us.so bows down and touch you feet because you are teacher for me.
    Please kindly request you to create it by angular also.

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

    nicee! good to see new React projects

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

    From your videos ,I think you were a pro at javascript

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

    This was exactly what i was looking for! Btw, your code is extremely clean and elegant. Cheers!

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

    Hey, have some love from India. One of the best teachers and tutorial makers!

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

    Great effort, Kyle
    almost 2 h of recording and hours of searching and coding THANK YOU , I liked the (useState, useContext, useEffect) combination,
    however I distracted a bit with bootstrap and styling but I think it is useful for guys want to tie it all up together.

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

    i can't keep up with ur speed, i do understand the syntax but i am not able to join the threads, what is working for what, man i need hell lot of practice and reasearch for doing something like this.....salute to you Kyle, u r GOD

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

    Kyle: I am speed

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

    Happy teacher's day Kylee sir. ❤️Love from India ❤️

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

    I have three questions. 1. How do I remove contacts and conversations? 2. How do I use my own CSS instead of the bootstrap css (located in \client
    ode_modules\bootstrap\dist\css)? 3. How do I make this into a desktop application? Thanks in advance.

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

      @ChoppedBlade Thanks very much, but I meant where do I add a function to add and remove contacts in the app.

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

      @@thomast2577 extend the context to have a remove contact as well as the createContact same for conversations.

  • @rajesh-royal
    @rajesh-royal 4 года назад +2

    wish y luck for 1M 🔥 you work really hard 👍

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

    thank you kyleeee with this chat app now I use this my own version in my local area network!!!!!! to chat with my only family and friends

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

    WOW! This was awesome. I know it was simple but I loved the "New" button verbiage switch. Some times it's the little things 😄 Thanks Kyle!!

  • @m..2694
    @m..2694 4 года назад +3

    Make a Windows 10 clone....😁😁..you will ahead of everyone else.... awesome content though.

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

    You're one of my favorite Sir
    Lots of love from India😍

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

    Hi Kyle !!!! I love you 🤟 keep making awesome stuff

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

    I love this concept. I’m waiting much much more like a project from u. Just keep going

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

    Thank you for being the mentor we all needed !

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

    I strongly support this handsome guy, sounds good. Simple ,short and precious 🤴.i don't have time to watch this video now see you later.

  • @Tendou-Gaming
    @Tendou-Gaming 4 года назад +2

    Another Awesome video Kyle! Can you make a video on making a weekly scheduler app?

  • @30saransh
    @30saransh 4 года назад +1

    you're the best Teacher. Happy teachers day!!!!

  • @user-mz7pt8tl9n
    @user-mz7pt8tl9n 4 года назад +2

    Mannn, This is lit 🔥🔥🔥 That's what i'm looking for !

  • @hamsithacs4091
    @hamsithacs4091 2 года назад +1

    Is that enough that I leaned whatever he mention in the description??

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

    Happy teachers day ❤

  • @schemez
    @schemez 4 года назад +5

    it took 4 hours for me just following what he did. but the playback of this is only just 1:44:07

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

      I've been at this for almost 10 hrs and I'm only at 1:20. Also pausing and making sure I understand as we go and also externally researching concepts if I don't understand though. Holy cow I have learned so much about react.

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

    I instantly subscribed when I saw the project. following along now.

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

    Finally, It runs Kyle Thank you for the video.

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

    u r the best teacher

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

    Great content as always Kyle!
    Just for a frame of reference, how long did it take you to make this app (just the app, without the tutorial magic and video stuff).

    • @elijahromer6544
      @elijahromer6544 2 года назад +1

      I too am curious of this! This must have been weeks of planning and coding/ debugging....

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

      @@elijahromer6544 yeah, that's weeks of work for a regular developer figuring out how that works from scratch. Just io alone can be a real head-scratcher.

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

    i did same with you while watching. but i doesnt work. i copied your source code... still does not work. there is no error but i cannot text with contacts

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

    Happy Teacher's Day
    From India 🇮🇳

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

    This taught me so much I'm astounded.

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

    Who else is having issue with socket io
    I followed exactly what was in the tutorial but the connection is not working

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

    #githubFollowerGang , knew this video's coming.

  • @Cat-vd4ju
    @Cat-vd4ju 3 года назад

    Huge fan of your videos Kyle, keep it up!

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

    Awesome masterclass :D

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

    THIS IS CRAZY! I was literally thinking about building this but had no idea how to do it! I love you Kyle!

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

    I get this error everytime, does someone know what causes this and how to fix it?
    Access to XMLHttpRequest at 'localhost:3001/socket.io/?id=6ec194d5-a212-4b83-9569-175c880a79bf&EIO=4&transport=polling&t=NWtANiG' from origin 'localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    I've been stuck on this for about 2 hours now

  • @crazydev.2634
    @crazydev.2634 4 года назад +1

    Great work, bro❤️

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

    Kylee love u brother, keep doing it more brother

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

    hey< what I suppose to do with cors policy, my code with no errors, but in console lot of errors about this Cors policy

    • @sebastienmorin9020
      @sebastienmorin9020 3 года назад +5

      I ran into that and in my case it had to do with socketio not being required with a lenient cors policy. I added a line to the server definition: const io = require('socket.io')(server, {
      cors: {
      origin: '*',
      }
      });
      Hope this helps anyone :)

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

      @@sebastienmorin9020 thanks man, now its work perfectly)

    • @Dan-fd8rw
      @Dan-fd8rw 3 года назад

      @@sebastienmorin9020 It works. Thanks

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

    Thanks a lot Kyle that was great

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

    Wow. Awesome!!! TQVM!

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

    Great stuff, I followed this using TS, so it took some extra time, but it was worth it!

  • @yassinsconcepts
    @yassinsconcepts 2 года назад +1

    51:50 When and where did you define "conversation"?? I'm getting an error
    Failed to compile.
    src/contexts/ConversationsProvider.js
    Line 22:52: 'conversation' is not defined no-undef
    Line 23:24: 'conversation' is not defined no-undef
    Line 32:17: 'conversation' is not defined no-undef

  • @27vivy
    @27vivy 4 года назад +1

    Keep up all your good work!

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

    You are perfect . Awesome content 👏👏

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

    nice work hope you could do a slack clone next

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

    Awesome video! I always learn something from each one of them. Thank you :)

  • @cassengerber926
    @cassengerber926 24 дня назад

    I wanted to comment to save others the headache if they are using new versions of react. If running react in strict mode the useLocalStorage hook will not work. Strict mode will reset the localStorage state to undefined on reload. Removing strict mode will allow the localStorage state to persist

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

    It's here!! ❤️❤️

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

    you do a very good job of explaining everything along the way thanks!

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

    Seems like a good tutorial, just confused why you would message somebody called Top Right or Left, why not just use the names John or Jane

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

    man you are talented at everything

  • @user-ri9cn2rs5i
    @user-ri9cn2rs5i 3 года назад +1

    Im stuck around 42:00-43:00... when I start the application its giving me an error saying " TypeError: Cannot destructure property 'Contacts' of 'Object(...)(...)' as it is undefined. " in regards to the const { contacts } = useContacts() line.....

  • @Amansingh-vg4nn
    @Amansingh-vg4nn 3 года назад +6

    Hey is anyone getting CORS error?

    • @syedarfaat7499
      @syedarfaat7499 11 месяцев назад

      meeee

    • @FarazAhmadDev
      @FarazAhmadDev 2 месяца назад

      ​@@syedarfaat7499 simply install cors package and apply to app in express as a middle ware

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

    Happy teachers day
    Create more react projects

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

    Next: build a Snapchat clone please :)

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

    Amazing work, thanks!

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

    Happy Teachers day Kylee.Please tell where are you from?

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

    Nice Kyle.

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

    another great project!