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

Поділитися
Вставка
  • Опубліковано 5 жов 2024

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

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

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

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

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

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

    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 3 роки тому +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 3 роки тому +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 Рік тому +4

    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

  • @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 .

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

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

  • @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.

  • @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 2 роки тому

      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

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

    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!!

  • @fadahunsioluwaseyisamuel3552
    @fadahunsioluwaseyisamuel3552 Рік тому +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 4 місяці тому

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

  • @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!

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

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

  • @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.

  • @nicholashendrata
    @nicholashendrata 4 роки тому +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 роки тому +3

      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.

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

    Deploying server on Heroku: 1:48:57
    Deploying frontend on Netlify: 1:52:18
    Thanks for this - filled in a few gaps for deploying the server and frontend.

  • @richardpepple6039
    @richardpepple6039 4 роки тому +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 :)

  • @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 :)

  • @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?

  • @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

  • @__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.

  • @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

  • @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!!!

  • @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👍

  • @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 2 роки тому

      Thank youuuuuu

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

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

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

    youre the man, thank you javascript mastery

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

    THIS IS EXACTLY WHAT I WANTED! THANK YOU😘

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

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

  • @yadneshkhode3091
    @yadneshkhode3091 3 роки тому +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

  • @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

  • @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!

  • @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!

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

    Thank you so much for this! I was giving up trying to use socket.io and express with react because I just couldn't understand how they worked together, thank you!!

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

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

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

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

  • @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

  • @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!

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

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

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

    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!

  • @anirudh6642
    @anirudh6642 4 роки тому +7

    I have never felt this free before!

  • @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.

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

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

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

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

  • @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.

  • @christopheanfry2425
    @christopheanfry2425 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!!!!

  • @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 😁

  • @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).

  • @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!

  • @kirill_spirit_releasement
    @kirill_spirit_releasement 3 роки тому +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!)

  • @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.

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

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

  • @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?

  • @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.

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

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

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

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

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

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

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

    I love that you reply to most of the comments!

  • @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!

  • @scottforbes0
    @scottforbes0 20 днів тому

    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.

  • @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!

  • @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 !

  • @king-manu2758
    @king-manu2758 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-manu2758
      @king-manu2758 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-manu2758 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.

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

    I appreciate the high-quality audio.

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

    Amazing! Maybe a complete MERN stack next

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

    Adrian, Your tutorials are awesome! Did anyone else have a problem with the send button? If so, what was the solution?

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

      Thank you! I'm not sure, try checking the GitHub repo. :)

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

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

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

    Thank's you for this tutorial. There is little mistakes on it.
    Some tips for other people:
    * Do not use the 'message' name for socketio transmission message this is a forbidden channel name.
    * function sendMessage of this tutorial is wrong because the initial value of messages is an empty array so the memory address link to it isn't the same of an filled array.
    * function sendMessage: second argument of useEffect do not need to be set with messages variable but with empty array because this one need to be call only one time because messages will be update through socket.
    So the functions should look like these:
    useEffect(() => {
    socket.on('newMessage', (message) => {
    setMessages(messages => [...messages, message]);
    })
    },[]);
    Enjoy tutorial now 😏

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

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

  • @abdelhamidbacha7335
    @abdelhamidbacha7335 3 роки тому +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 4 роки тому +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?

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

    You can install an extension called Simple React Snippets - where you can create stateless function component with just - sfc and also for importing react

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

      he is doing it for the newbies

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

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

  • @toagilli
    @toagilli 3 роки тому +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!

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

    If he could make the full thing into a series -
    5 parts. Like a series. Roughly 27 minutes for each episode. I think it would have been an even bigger hit ....

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

      What do you mean? To create a compilation of these 5 videos? 👌

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

      @@javascriptmastery
      Yes, like episodes. Break the full length discussion into 5 episodes. Roughly 26 minutes each one. Lucrative, enticing and just about long enough to hold the audience's full concentration n focus thru an episode.
      the focus wanders off when vid is too long in 1 go..

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

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

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

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

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

    One problem - when you use a phone as one chat person and computer as the other, when the phone screen shuts off from being idle, it crashes the heroku server. I have to find a fix before I show it at interviews ☺️.
    But you're the best teacher I've found on youtube so thank you for your work 😀

  • @kiabhm5091
    @kiabhm5091 2 роки тому +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 Рік тому

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

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

    Thank You so much Sir

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

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

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

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

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

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

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

    Thank you for this tutorial! I know Javascript but this video will help me out to build a real-time chat! I will add this to my website.

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

    This is a great project, thanks for tutorial.

  • @ammar-alkhooly
    @ammar-alkhooly 4 роки тому +1

    @JavaScript Mastery
    Amazing intro to socket.io, THANKS!!!
    would be cool to see a full stack tutorial using react, node, MySQL

  • @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

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

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

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

    Whenever I click on send button this error is displayed,
    io.to(user.room).emit("message", { user: user.name, text: message });
    ^
    TypeError: Cannot read property 'room' of undefined.

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

      If you find a solution to this, let me know

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

      I had the same issue. My getUser function had { } which it SHOULD NOT. Keep the function on one line without { } Hope this can help.

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

      @@anfanli2390 Yes it did work ,thanks!

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

      @@rajvikhatri2330 in my case by keeping the getUser function in one line without {} as suggested by @Anfan Li ,the send button started working so you can try this.

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

      @@abhinandanvashishta2846 please help me 😞 I'm getting error in trim() in message.js file
      Browser gives error - cannot read property of trim undefined. ...
      This cause my messages and incoming messages both are in left side

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

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

  • @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

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

    You guys should do a Video explaining Redux with Angular or React . I mean its really important and there is not enough specific video defining and applying Redux in real world

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

    Amazing, but how could I make a list of rooms already open?

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

      In Node Js , simple return number of rooms by using Room.find() query , Room is Model name here

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

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

  • @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 4 роки тому +2

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

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

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

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

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

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

    I loved your tutorials and really giving good explanation thanks for that. I will be glad if you do a big calendar with todolist and events to bind on the calendar and to give alerts. Can you please do that from scratch using react Hooks?

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

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

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

    Great tutorial, any way of time-stamping the emit messages and the messages sent by the users?

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

      Absolutely, you just need to implement it in React. No need for additional Socket.IO integration!

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

      You can use moment to do this.
      npm install --save moment
      npm install --save moment-timezone
      In Message.js
      Under this line:
      const Message = ({ message: { user, text }, name }) => {
      Add:
      const moment = require('moment');
      const tz = require('moment-timezone');
      const time = moment().tz('America/New_York').format('h:mm a');
      Then under each messageBox div, add this line:
      {time}

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

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

  • @bytex5411
    @bytex5411 4 роки тому +14

    Hey, is there any way I can add an image attachment feature to this chat?

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

      yes you can. read the image file as DataURL and then send that data to backend.

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

      look into amazon web services, that’s how i integrated images into my chat app