Build and Deploy a Realtime Chat Application - Socket.io, Node.js, and React.js

Поділитися
Вставка
  • Опубліковано 16 січ 2025

КОМЕНТАРІ • 1,3 тис.

  • @javascriptmastery
    @javascriptmastery  3 роки тому +11

    JavaScript Mastery PRO launching soon! Be the first one to find out about it - javascriptmastery.eo.page 🔥

  • @mitchwoodbine
    @mitchwoodbine 4 роки тому +33

    Finally a tutorial without any additional fluff or nonsense. Usually I have these types of videos on 2x speed to get to the actual information, not here! Thank you for the help!

    • @javascriptmastery
      @javascriptmastery  4 роки тому +1

      Glad it helped!

    • @JenniferStewart100
      @JenniferStewart100 4 роки тому +2

      omg... ur so right! I hate all the side talk in tutorials or when they dont show you what they are building until 20 mins in...lol

    • @shneorBachar
      @shneorBachar 4 роки тому +2

      @@javascriptmastery io.on('connection', (socket)=>{
      console.log('We have a new connection!!!!');
      socket.on('disconnect', ()=>{
      console.log('User has left!!!!')
      })
      })
      why is not workink???

    • @YeshuasFlockMusicians
      @YeshuasFlockMusicians 3 роки тому

      @@shneorBachar You may be missing the line above-> const io = require('socket.io'); in order to require/import this you need to install it (but before you do that, go to the folder src/server and use the command '''npm init''' once that has finished you can then install socket.io via the command '''npm install --save socket.io''' I hope this help
      ייתכן שחסר לך את השורה מעל-> const io = require ('socket.io'); על מנת לדרוש / לייבא זאת עליך להתקין זאת (אך לפני שתעשה זאת, עבור לתיקייה src / server והשתמש בפקודה '' npm init '' 'לאחר שסיים תוכל להתקין את socket.io באמצעות הפקודה 'npm install --save socket.io''' '' אני מקווה שזה יעזור.

  • @respect_gamers5695
    @respect_gamers5695 2 роки тому +6

    Most Underrated Channel. Please keep helping poor kids like me who rely heavily on free quality materials for learning. I will donate you once I start earning for sure, not because you need it, but because you deserve it

  • @martibatista3678
    @martibatista3678 4 роки тому +12

    I think you will never be
    conscious about how much you helped me. Thank you very much!!

  • @francismasangcay4139
    @francismasangcay4139 3 роки тому +7

    Adding timestamps for my own use. Awesome video btw!
    Project Set up: 5:00
    Server code 13:00
    Deployment 1:46:58

    • @djmobley647
      @djmobley647 3 роки тому

      ahaha, best timecodes i 've ever seen:))

  • @richardpepple6039
    @richardpepple6039 5 років тому +11

    This is one of the best 2 hour tutorials I've ever come across, I manage to get everything to work. Thank you very much for this looking forward to more :)

  • @stefanstefanovic6112
    @stefanstefanovic6112 4 роки тому

    Brate odlicni su ti tutorijali, svaka cast stvarno, tutorijal za full-fledged aplikaciju koji je jos i besplatan, je veoma redak slucaj. Sve pohvale i samo napred!

  • @immanu10
    @immanu10 4 роки тому +3

    Great video once again brother! Thanks.
    Guys,small bug fix: Just use socket.once instead of socket.on(having event "message") inside second useEffect!!
    useEffect(() => {
    socket.once("message", (message) => {
    setMessages([...messages, message]);
    });
    socket.on("roomData", ({ users }) => {
    setUsers(users);
    });
    }, [messages]);
    This will not make the app getting slow after few messages!

  • @henryho952
    @henryho952 3 роки тому +2

    I've learn a lot from your teaching here in UA-cam since when I was started in my first work and now I continue striving on my journey as a software engineer. thankyou sir :)

  • @ruelagnes4277
    @ruelagnes4277 4 роки тому +42

    youre the man, thank you javascript mastery

  • @srajanjain2541
    @srajanjain2541 4 роки тому +27

    There are many tutorials out there but Nothing can't beat this one!!!
    Mind blowing 🙏😎

  • @__azt
    @__azt 4 роки тому +11

    I just got into your channel from a random youtube suggestion and now here I am, watched 2 full length videos, subscribed and pressed the notification icon. Oh Man ! Your videos are so detailed. Everything one wanted to know about the topic is there.

  • @abyjose9520
    @abyjose9520 4 роки тому +3

    Quality content, with no BS. Man, you deserve more subscribers.

  • @diegouniv-s7c
    @diegouniv-s7c 4 роки тому +8

    man, your teaching is impeccable, I am Brazilian and I managed to understand 100% of your explanations, congratulations and thank you!
    Can you take a video tutorial on how to use the Google Maps API to show places close to the user? for example ... all nearby restaurants ...
    I don't see a lot of tutorials on that, it would be great.

  • @pravinsuresh1008
    @pravinsuresh1008 4 роки тому +4

    Absolutely great. This exactly what I needed. A full app from its birth to deployment to production, every step is included and clear. Thank you for the video

    • @javascriptmastery
      @javascriptmastery  4 роки тому

      Great to hear!

    • @ganeshtripathi1757
      @ganeshtripathi1757 4 роки тому

      @@javascriptmastery What is the maximum salary for javascript developer if i am using frameworks like angular react js react native .please anyone can answer.thanks in advance

    • @shrijaykesarwani6773
      @shrijaykesarwani6773 3 роки тому

      are you backend developer?

  • @AdityaVerma-fv5ne
    @AdityaVerma-fv5ne 4 роки тому +10

    I have completed your Voice recognition app yesterday and now starting this one , your all projects are awesome sir , thanx a lot for providing this much value for free .

  • @krisztiancsillag2426
    @krisztiancsillag2426 4 роки тому +2

    I am "ACTUALLY" very surprised by the quality of your tutorials! Kudos to you sir!

    • @javascriptmastery
      @javascriptmastery  4 роки тому +1

      Thanks!

    • @momodoubjallow2585
      @momodoubjallow2585 4 роки тому +1

      This is absolutely one of the tutorials I watched on UA-cam. Thanks so much. And I have a kind request would explain the step to expand the chat app so that users can create custom chat rooms with admin permission.

  • @pelumiodus5979
    @pelumiodus5979 4 роки тому +4

    This was really awesome, you literally gave all the building blocks to creating a great chat app. Thanks

  • @kirill_spirit_releasement
    @kirill_spirit_releasement 4 роки тому +1

    Большое спасибо! Это лучший туториал чата, что я смог увидеть на просторах интернета. Всё получилось - от начала до конца. Хотя опыта в яваскрипте было ноль! Больше спасибо!
    (Thank you very much! This is the best chat tutorial that I have seen on the Internet. Everything worked out - from start to finish. Although there was zero experience in javascript! Thanks a lot!)

  • @nahidkarimankur4828
    @nahidkarimankur4828 4 роки тому +4

    I dont know how will I thank you. You deserve a million subscriber

  • @rubikmania98
    @rubikmania98 4 роки тому +3

    Great tutorial bro. I've been looking for Javascript project ideas to build during this weird quarantine times, and finally stumbled upon this video.Thank you so much👍

  • @anirudh6642
    @anirudh6642 5 років тому +7

    I have never felt this free before!

  • @justinheehaw
    @justinheehaw 4 роки тому +34

    THIS IS EXACTLY WHAT I WANTED! THANK YOU😘

  • @SouravendraKrishnaDeb
    @SouravendraKrishnaDeb 5 років тому +7

    If anyone's confused, whenever he inserts a null at the end of functions to do nothing, he is using the ternary operator which is as follows - condition==true ? execute 1 : execute 2
    Very useful!!

  • @toagilli
    @toagilli 4 роки тому +1

    Great Video! It's an amazing introduction to socket IO + NodeJs + ReactJS. I'm so glad with you! Thanks a lot man, great job!

  • @joaovictor2341-k3g
    @joaovictor2341-k3g 4 роки тому +23

    This is a very good project. I finished it, but I used typescript on both the node and react, and I'm thinking about it further, implementing a mobile version using react native. Thanks, this content helped me a lot.

    • @benxneo
      @benxneo 3 роки тому

      could you share your repo? I'm thinking of doing it in TS as well

    • @ahlamelghadi6380
      @ahlamelghadi6380 2 роки тому

      hey can we talk more about this project

  • @christopheanfry
    @christopheanfry 3 роки тому

    Hi there. Normally I don’t put any comments but I really have to say thank you so much for your explanations in your videos you don’t only show how to do it but you also give a sense of what you’re doing and it helps me a lot. Very goods tutorials keep going!!!!

  • @bwanamaina
    @bwanamaina 5 років тому +4

    this tutorial was awesome to watch! very clear explanation, thank you so much for this!!

  • @virajbaswana
    @virajbaswana 2 роки тому

    thanks a lot JSM. you are the best javascript teacher on the entire platform and ive have tried tens of others.. amazing work

  • @josiahroa177
    @josiahroa177 4 роки тому +3

    This was an amazing tutorial and was exactly what I was looking for. I was trying to do this on my own but had no experience with socket.io. Thank you so much!

  • @ShubhamYadav-wq7fv
    @ShubhamYadav-wq7fv 2 роки тому +1

    u are a very great teacher i thought it will be so hard but you teached everything from basic i like the simplicity content and everything about your channel thanks!

  • @ncpurge789
    @ncpurge789 5 років тому +13

    This is a really good tutorial.
    Though for someone like me who has 0 knowledge in any of these frameworks and libraries, I’m just blindly copying away everything right now not knowing what anything means lol.

    • @Alex233xx
      @Alex233xx 4 роки тому +1

      U need to understand what u are doing otherwise its pointless to just memorize.

    • @exactzero
      @exactzero 4 роки тому +2

      That's the reason why it's not a React.js tutorial, not a Node.js tutorial, nor a Socket.io tutorial. Because it's a tutorial on how to use those 3 technologies together.

    • @Xelpm0c24-7
      @Xelpm0c24-7 4 роки тому

      @@Alex233xx and where can one do that ? any book or course suggestion?

    • @wudehaileyesus3017
      @wudehaileyesus3017 4 роки тому

      @@Xelpm0c24-7 You can watch Net Ninja (a youtube channel) tutorial on each individual topic

    • @shikher4559
      @shikher4559 4 роки тому +1

      Lmao exactly i am in same situation as you.

  • @amraromoro
    @amraromoro 4 роки тому +2

    Thanks, man this video was really at the right time and you explained well..
    It was my first time to visit your channel and it won't be the last keep it up (Y).

  • @MrMiguelapb35
    @MrMiguelapb35 4 роки тому +5

    Great job man ! Your explanations are very clear, I understand that making and editing videos is hard, but you make an amazing job with your tutorials, thanks a lot, please keep it up

  • @mobolaji01
    @mobolaji01 4 роки тому +10

    Your tutorials are amazing man. I will be glad if you can do e-commerce app with react

    • @javascriptmastery
      @javascriptmastery  4 роки тому +6

      Great suggestion!

    • @kapilchauhan7954
      @kapilchauhan7954 4 роки тому

      Have you gone through this video?
      I'm getting an error regarding handshake (I guess SSL certificate error), when I use websocket with vuejs app.
      Are you not getting any error?

  • @aiasmarques4527
    @aiasmarques4527 5 років тому +21

    I really appreciated your tutorial. It's very didatic and covered my necessities at the moment. (I am just learning). Now I am trying undestanding the admin meanning and how access it.
    Thanks for your time.

    • @javascriptmastery
      @javascriptmastery  5 років тому +2

      Glad you liked it!

    • @v0nnyboy
      @v0nnyboy 4 роки тому

      For everybody searching for the refactored hooks video : ua-cam.com/video/-9M9CGSd69I/v-deo.html . The refactoring of this specific project starts here ...

    • @tarunkishore7357
      @tarunkishore7357 4 роки тому +1

      @@javascriptmastery Can you pls try to show how to upload images or files in that app

  • @knightofcarrion7358
    @knightofcarrion7358 4 роки тому +2

    This just popped into my suggestions, imma work on it later when I have time! looking forward to this!

  • @Partypup-123
    @Partypup-123 5 років тому +6

    It's amazing! Thank you so much. I'm a hobbyist, but i can hang with alot of devs since i've been doing it for 5 years. Just getting into react now that I've got the gist of js. Helpful and professional. I wish you much success!

  • @yadneshkhode3091
    @yadneshkhode3091 4 роки тому +1

    THANK YOU !!!!!!!!!!!! SOOO MUCH I was trying to build this myself and I faced lot of issues with the structure of my project this helped a lot

  • @Petsol2011
    @Petsol2011 5 років тому +3

    This is an awesome video. I love the way you take out time to explain every detail of it. Thanks

  • @haksffyt9244
    @haksffyt9244 4 роки тому +1

    This channel is great. I liked the way you explain all the things.

  • @NiroKumar7
    @NiroKumar7 4 роки тому +4

    I really Love your Tutorial.. awesome! 😍 I was been working on a covid19 tracker project recently using js. Then I watched ur video of building the App using React. Ever since I've become your channel fan.. ❤ I'm new to react btw.. but ur explanations are simple and easy.. Love it!

  • @ozanapaydin15
    @ozanapaydin15 4 роки тому +1

    Really great tutorial thank you for all ! Need to admit I had no idea about node.js and chatting in real time before the video, thank you again.

  • @niekmollers640
    @niekmollers640 5 років тому +3

    Thanks Adrian. You made a nice and very understandable video with this product-mix. Liked it a lot. 👍

  • @nelsonvarela7529
    @nelsonvarela7529 3 роки тому

    You know what, I think I love you lol. Thank you mate for making this world a bit better

  • @raymondmichael4987
    @raymondmichael4987 5 років тому +9

    This looks great brother, hopefully we can include database and user registration into the mix;
    keep up the good work,
    Greetings from Tanzania

  • @tomascalvo8
    @tomascalvo8 3 роки тому +1

    I appreciate the high-quality audio.

  • @other_perfection
    @other_perfection 4 роки тому +5

    man it's so easy to understand and useful, like concentrated good information, thank you a lot! subscribe!

  • @evergreen7781
    @evergreen7781 2 роки тому

    Excellent explanation, Clean Code, Elegant Design & last but not least full deployment from scratch, Thank You so much Adrian ❤️❤️❤️

  • @generationtechnology6689
    @generationtechnology6689 5 років тому +4

    Thank you, man! God bless you! Awesome content, subscribed!

  • @saitejaballa6759
    @saitejaballa6759 4 роки тому +1

    Very well explained,
    U cant just stop anyone from hitting the subscribing button,
    Thank you very much

  • @deathsinger8381
    @deathsinger8381 5 років тому +26

    pls upload more, I want to learn more from your vids.

  • @Mocka-yf4ez
    @Mocka-yf4ez 3 роки тому +1

    Your knowledge is amazing, and the way that you teach, thank you so much!

  • @oleksandrstepaniuk9491
    @oleksandrstepaniuk9491 4 роки тому +3

    Спасибо, получил классный опыт при просмотре этого видео. (Thank you, I got a great experience watching this video.)

  • @abdelhamidbacha7335
    @abdelhamidbacha7335 4 роки тому +1

    thank you very much maan, god bless you
    i had no idea how to deploy node or react , you made it so easy, and the video about hooks is amazing thank you very much, i wish i could like your videos millions times hhhh

  • @amirdawood4059
    @amirdawood4059 5 років тому +12

    1:38:00 add name={name} as a prop in Messages component so the whole app not crashed

    • @freekeys
      @freekeys 4 роки тому

      Hi bro, when user leaves automatically and trying to msg then whole app is crashing, do u know solution?

  • @raphaelmorgan2307
    @raphaelmorgan2307 4 роки тому

    I started this tutorial a while ago using repl.it and it wasn't working and i got sad and gave up but now that I've actually installed node it's working so well (i don't even have visual studio i'm using notepad lol) this is amazing

  • @ore_wa_king
    @ore_wa_king 4 роки тому +5

    You are awsome big brother.
    You teach incredible and try to help as much as you can.
    Thank you from bottom of my heart.

  • @8ack2Lobby
    @8ack2Lobby 5 років тому +1

    I love that you reply to most of the comments!

  • @mohcineamzyl7051
    @mohcineamzyl7051 3 роки тому +9

    For those who are seing this in 2021 , u gonna have error in your console like : "NO Access-Control-Allow-Origin"
    just Add this to your index.js on server side :
    const cors = require('cors');
    app.use(cors());
    and on the client side chat.js :
    replace :
    socket = io(ENDPOINT)
    with :
    socket = io(ENDPOINT, {transports: ['websocket', 'polling', 'flashsocket']});

    • @danielekara425
      @danielekara425 3 роки тому

      Much appreciated bro🤍

    • @joelhkbn
      @joelhkbn 3 роки тому

      DUDEEEE!!!! YOU SAVE MY LIFEE!!!

    • @syrinejendoubi4389
      @syrinejendoubi4389 3 роки тому

      Thank youuuuuu

    • @apoleyta9760
      @apoleyta9760 2 роки тому

      Thank you brother. Can u send a link what is that error about and why did this solve problem ?

  • @rahadulhaq6387
    @rahadulhaq6387 4 роки тому +2

    U r very smart teacher nd u know the student's need...thanx a lot
    May allah bless u sir🙂🙂

  • @taifalbakshi6767
    @taifalbakshi6767 4 роки тому +11

    Bro if you keep dropping gems like this soon you'll reach a million subscribers. ❤️

  • @pravinsukumaran6080
    @pravinsukumaran6080 3 роки тому +1

    Your a god in your own right bro ,,,,,,,,,keep up the good work ........add more ads ill gladly watch

  • @fadahunsioluwaseyisamuel3552
    @fadahunsioluwaseyisamuel3552 2 роки тому +10

    if you're facing the "location" error saying not defined, do the following
    import { useLocation } from 'react-router-dom';
    const location = useLocation()
    //remove the destructured location prop in the chat function

    • @PratikBanger
      @PratikBanger Рік тому

      Ohhh man I was stuck in this problem for a long time, I really appreciate your help bro, Thank your so much❤❤❤❤

    • @MichaelShingo
      @MichaelShingo Рік тому

      Thank you, I guess react has updated since this video was made

    • @harshsharma5066
      @harshsharma5066 Рік тому

      ​@@PratikBanger bhai tumne deploy kar di ha toh mujhe puchna tha ki ma project(video) ko dekh sakta hu kya. Kahi beech ma nahi aatak jaye

    • @riki5097
      @riki5097 Рік тому

      Thank you brother!

    • @beautifulheart5054
      @beautifulheart5054 8 місяців тому

      is the coding explain in video is different from souce code ?
      please explain.
      or someone give me the updated code.
      thank you.

  • @siddharthsingh991
    @siddharthsingh991 4 роки тому +1

    This is what is called a complete video, Thanks

    • @javascriptmastery
      @javascriptmastery  4 роки тому

      Glad you liked it!

    • @siddharthsingh991
      @siddharthsingh991 4 роки тому

      @@javascriptmastery I am getting an error ( has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource ). I tried rectifying but was unable to, can you me help regarding it?

  • @youssefrabeiii
    @youssefrabeiii 5 років тому +5

    It was just about time I was waiting this video since you say you gonna make it

  • @catalingligor6387
    @catalingligor6387 4 роки тому +2

    You speak and explain very well! Thank you! Subscribed

  • @craigsavage4586
    @craigsavage4586 4 роки тому +8

    Amazing! Maybe a complete MERN stack next

  • @JohnS-rv6rd
    @JohnS-rv6rd 4 роки тому +1

    Amazing! Thanks for creating such a helpful video for socket n00bs like me

  • @gordonmaloney2310
    @gordonmaloney2310 3 роки тому +5

    Thanks a lot for another brilliant video, man! Had some issues with deploying, but I think it's now working perfectly. Thanks!
    I have a plan to try and use web sockets to allow users to use their mobile to scan an image into a form they're filling out on their desktop. Feel like it's a little beyond my current skillset, but this video has definitely taken my a lot of the way there so I'm feeling much more confident now 😁

  • @crazyvaleideas
    @crazyvaleideas 2 роки тому

    Awesome video man, You literally made the coding easy to understand 🧡💯 Keep posting such great content.

  • @bernardphlaxisk6454
    @bernardphlaxisk6454 4 роки тому +4

    This is a great project, thanks for tutorial.

  • @ayushniroula1781
    @ayushniroula1781 3 роки тому

    Thank You so much Sir

  • @dhairyawadhwani3121
    @dhairyawadhwani3121 4 роки тому +11

    Can you extend this app with files i.e. images, videos.pdfs etc . or make a seperate video on something like sharing files with socketio.

  • @ShankhanilGhosh
    @ShankhanilGhosh 4 роки тому +1

    This is an amazing tutorial. My first react App, I will now keep working on this making it better, giving out more features.

    • @javascriptmastery
      @javascriptmastery  4 роки тому +1

      Thanks!

    • @mohabedr5030
      @mohabedr5030 4 роки тому +1

      what is amazing bro the app have bad performance

    • @ShankhanilGhosh
      @ShankhanilGhosh 4 роки тому

      @@mohabedr5030 The app needs some optimization. Check the comments below, and you will find the solution.
      Also, the app may perform poorly due to the poor performance of your Heroku server. This is the basic app tutorial, now you have to spend some time to optimize it.

  • @JuanGonzalez-vs6jd
    @JuanGonzalez-vs6jd 4 роки тому +4

    Came across your channel a few weeks ago and I'm amazed at the way you simplify complex subjects. Thx for the work you do. I'm sure many more will appreciate the quality of the videos content. Any "online shopping" app in the works?

    • @javascriptmastery
      @javascriptmastery  4 роки тому

      Thanks for the kind words, definitely coming up in the future!

  • @javascriptworld98
    @javascriptworld98 3 роки тому

    One of the best video !
    Bro , kindly keep going on.

  • @arfaouighaith9359
    @arfaouighaith9359 4 роки тому +4

    you the best teacher i ever seen .. thank you so much

  • @scottforbes0
    @scottforbes0 4 місяці тому

    This is a good start. You might want to focus on making it mobile-friendly and include a user list. I'm also developing a similar product in Replit, and my next step is to find a way to add basic encryption and set up a permanent server.

  • @King-Gilamashur2758
    @King-Gilamashur2758 3 роки тому +3

    Love your tutorials man. One suggestion for a video, could you cover setting up environmental variables for React ? I don't mean just adding .env files but adding the scripts for different environments so when you run your npm run start, build, deploy etc everything is set up with the right variables. I feel with your clear explanations i could grasp it because I've read several tutorials and it's never clear or coherent.

    • @javascriptmastery
      @javascriptmastery  3 роки тому +1

      Great idea!

    • @King-Gilamashur2758
      @King-Gilamashur2758 3 роки тому +1

      @@javascriptmastery Glad you like it! I think it would be helpful for a lot of people in order to keep their projects in order. I have a cool project I'm making (based on your redux/mongodb tutorial) and sometimes it's a bit of a hassle because I have it deployed to heroku and netlify and it updates when I push commits to github and I have to manually change a bunch of stuff all the time for it not to break.

    • @javascriptmastery
      @javascriptmastery  3 роки тому +1

      @@King-Gilamashur2758 Feel free to contact me at contact@jsmastery.net with a link to the Github repo. I'm always looking for some new projects to showcase.

  • @hosseinpanahy5358
    @hosseinpanahy5358 4 місяці тому

    very informative and practical, thanks for teaching us valuable things

  • @KamranKhan-xv4br
    @KamranKhan-xv4br 4 роки тому +3

    This tutorial is really awesome! Can you please extend this tutorial on how to connect this to a MongoDB database? With user registration, profile edit, deleting messages, storing messages, etc. Maybe user roles too? Thanks so much!

  • @animecrease4811
    @animecrease4811 4 роки тому

    thanks man...you saved my life...keep making tutorials like this !!

  • @TahaJSDev
    @TahaJSDev 3 місяці тому +9

    Anyone in 2024?

  • @hashikamaduranga6122
    @hashikamaduranga6122 4 роки тому

    excellent tutorials for beginners to know what is socket io and other basic functionality of react and nodejs

  • @fabioalexandrino2244
    @fabioalexandrino2244 4 роки тому +12

    For those who are confused. Inside client directory, in Chat.js, it's pointing to heroku instead of http:localhost:5000
    replace and you will be fine
    I took 3 hours to realize that. Because started getting CORS problems, but actually was an illusion. I couldn't solve the cors because of this.
    Well, At least now I know everything about cors LOL

    • @hnlimam
      @hnlimam 4 роки тому +2

      @Fabio Alexandrino How did you fix cors problems?

  • @tanishadalwadi4990
    @tanishadalwadi4990 4 роки тому

    Amazing video amazing explanation was able to build an application without a single error! Thank you!

  • @disfatbidge2468
    @disfatbidge2468 3 роки тому +3

    to the people facing the issue that there messages are not sending just go in your index.js file in server and define your io as
    const io = socketio(server, {
    cors: {
    origin: "*",
    },
    });

  • @kurtknispel9531
    @kurtknispel9531 4 роки тому +1

    Why the fuck youtube has a liking system that allows you to like once!
    bro you are a savior!

  • @xyntho
    @xyntho 3 роки тому +3

    Hey I found a bug in the app and I fixed it -
    The bug was that when your server is actually a bit slow then what happens is until the server doesn't reply back the setMessage doesn't set to null or ' ' which has a black value which actually does create a problem that when you press enter or the send button multiple times the same message is sent over and over. For fixing that your input.js file should look something like this which basically changes the setMessage to ' '
    ```
    import React from 'react';
    import './Input.css';
    const Input = ({ setMessage, sendMessage, message }) => (
    setMessage(value)}
    onKeyPress={event => event.key === 'Enter' ? ()=>{sendMessage(event);setMessage('')} : null}
    />
    {sendMessage(e); setMessage('')}}>Send
    )
    export default Input;
    ```
    Hope this helps!!!

  • @ritikthakur6270
    @ritikthakur6270 3 роки тому

    You are an amazing developer and also my favorite UA-camr.
    Please make more videos on reactjs with redux.

  • @kiabhm5091
    @kiabhm5091 3 роки тому +5

    I keep getting "Cannot read properties of undefined (reading 'search')" when I try to join, what could be the problem? the error comes from this line "const {name, room} = queryString.parse(location.search);"

    • @gabz-robert
      @gabz-robert 2 роки тому

      solved the error?

    • @ahlamelghadi6380
      @ahlamelghadi6380 2 роки тому

      Did it work?

    • @joaopedrofavoretti7905
      @joaopedrofavoretti7905 2 роки тому +1

      I solved that by using the function useLocation() from the module "react-router-dom"

    • @libanm.r.7834
      @libanm.r.7834 2 роки тому +4

      I had to define the location before hand (it might because of a newer react version):
      import { useLocation } from "react-router-dom";
      // and then inside the Chat function and before the useEffect
      const location = useLocation();

    • @RajSingh-te1uo
      @RajSingh-te1uo 2 роки тому

      @@libanm.r.7834 Thanks Man! :)

  • @mohabedr5030
    @mohabedr5030 4 роки тому

    bro you killed the performance

  • @thehipsteranonymous3653
    @thehipsteranonymous3653 5 років тому +13

    Is it possible to add an "Someone is typing" indicator or "Message seen" feature?

    • @javascriptmastery
      @javascriptmastery  5 років тому +7

      Absolutely. You'd need to dive a bit deeper into socket.io documentation and features, but it's absolutely doable.

    • @hassuunna
      @hassuunna 5 років тому +4

      i think both not implemented in socket but you can do them by JavaScript monitoring the message input box (for change) and messages container ( for focus, blur ) respectively

    • @javascriptmastery
      @javascriptmastery  5 років тому

      @@hassuunna exactly.

    • @pranisshrest503
      @pranisshrest503 5 років тому +2

      I think we can use broadcast method to let other user know you are typing.

    • @hassuunna
      @hassuunna 5 років тому

      Pràñís Shrést exactly I was just answering how to catch them

  • @Halissonskalee
    @Halissonskalee 3 роки тому

    Thank you very much. Your video helped me a lot! Strong direct hug Brazil!

  • @dhanushkasaman2914
    @dhanushkasaman2914 4 роки тому +3

    This is awesome 🔥❤️

  • @kumarbollaboina9467
    @kumarbollaboina9467 4 роки тому +2

    Thanks bro i got a job... After watching your videos...

  • @esskay9658
    @esskay9658 4 роки тому +3

    1st of all: great tutorial!! Thank you!
    2nd: how do i add timeStamps to the messages? i mean, even your video wallpaper shows them ;)
    Is there maybe a helpful link or some kind of quick response to that?
    Any help on that would be appreciated.

    • @Winterlittle
      @Winterlittle 4 роки тому +1

      maybe you can add a third attribute to the messages, so there's user, text, and then u can add time and set it to Date(); or smth

  • @Nono-shap
    @Nono-shap 4 роки тому +1

    Just discovered your channel, and I gotta say, this is awesome. I have a hard time to find new tutorials to follow, and I love your approach on things. Thanks !

  • @lokeshsainlyk
    @lokeshsainlyk 4 роки тому +11

    How can i implement "user is typing..." functionality ?

    • @javascriptmastery
      @javascriptmastery  4 роки тому +2

      Great idea, try researching a bit, did you find a solution? :)

    • @sengoku8497
      @sengoku8497 4 роки тому +6

      Well, generally speaking (as I am not react programmer), you have to listen to to the "typing event" (if user is typing to a specific field) and when he is doing this, emit through a socket the message about this user typing.

    • @ganeshtripathi1757
      @ganeshtripathi1757 4 роки тому

      @@sengoku8497 What is the maximum salary for javascript developer if i am using frameworks like angular react js react native .please anyone can answer.thanks in advance