Build a Chat Application using React, Redux, Redux-Saga, and Web Sockets - Tutorial

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

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

  • @seanhochman
    @seanhochman 5 лет назад +8

    This is a great tutorial on how to debug an application

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

    Great tutorial Beau, greatly appreciated!

  • @well.8395
    @well.8395 6 лет назад +13

    Since you're using pure ES6 syntax, I would highly suggest you to prefer [...state, newMessage] instead of state.concat().

    • @Pineapplelesspineapplepizza
      @Pineapplelesspineapplepizza 6 лет назад

      that and state.concat() does not add anything bc of the rules of immutability we can not mutate so with concat we create a new version of ect.....

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

      @@Pineapplelesspineapplepizza the same thing happens with spread operator.

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

    That's a good beginner app. You taught it very well! :))

  • @neilborbon
    @neilborbon 6 лет назад +6

    Can someone explain lines 17 and 18 at 30:26
    What is the ref for? What is that node? Why was node used there?Thanks :)

    • @Rope06
      @Rope06 6 лет назад

      Neil Jon

    • @maxkinli
      @maxkinli 6 лет назад +1

      Oh boy

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

      www.robinwieruch.de/react-ref-attribute-dom-node/

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

    Helped me a lot. Thanks for this video. Keep it up.

  • @renetchi
    @renetchi 7 лет назад +2

    Nice hands-on tutorial, but I guess you need to know about React, Redux, Web Sockets beforehand.
    In my case, I don't know Web Socket so it's hard to understand that part of tutorial.

  • @adithyamaheshbariki5330
    @adithyamaheshbariki5330 7 лет назад +7

    Can you make a tutorial for deploying this chat application?

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

    So... I finished the video, it helped me out a lot, but I gotta say that the only reason I understood what you were doing, is because of previous knowledge. This is not a tutorial at all, it's more of an "I read someone's code and I type blindfolded" for a lot of users.

  • @RamiroAndres
    @RamiroAndres 6 лет назад

    Really useful, thanks!

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

    Now, any direction on making this work with actual users instead of Chance?

  • @mikekennedy8644
    @mikekennedy8644 7 лет назад

    thanks for putting up this video

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

    go in sockets/index.js, then in socket.onmessage(),then in switch() delete the whole case types.ADD_USER-
    the chat still works.

  • @nahueljo
    @nahueljo 6 лет назад +8

    There's a little girl whispering at 37:08 *creepy*! haha

    • @keithcarrillo8238
      @keithcarrillo8238 6 лет назад +1

      Nahuel José seriously creepy as hell, for all we know this could be on another video of "top 10 SCARIEST things caught of RUclips".lol

    • @wapprez
      @wapprez 6 лет назад +4

      You can hear it again on 43:01, dude be coding, teaching and babysitting at the same time

    • @alanding7004
      @alanding7004 6 лет назад

      you are right. LOL

    • @kingwindie
      @kingwindie 6 лет назад

      at first i thought it was a cat

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

    thanks Beau, great tutorial and explanation. If I may can you create one for react native which connects to backend (preferably using Mongo DB)?

  • @EE-yv7xg
    @EE-yv7xg 7 лет назад +3

    15:13 code is wrong.
    nextUserId is a const. One cannot perform the nextUserId++ operation.

    • @joewazhere
      @joewazhere 6 лет назад

      In actions/index.js instead of doing 'const nextUserId = 0' change it to 'let nextUserId = 0'

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

      @@joewazhere I think it is better to always use 'let' instead of 'const'

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

      @@armanrozika not necessarily. There are potential performance benefits, and it can help to make your code more readable. If someone can immediately recognize if a variable isn't going to change, that can help prevent bugs in the future.

  • @PedroHenrique-et2eo
    @PedroHenrique-et2eo 4 года назад +2

    This isn't a tutorial, is something like "Watch me code like crazy, without testing anything and doing things in a crazy order" lol

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

      Every time he imports something before creating it, take a drink.

  • @bantinggamer4962
    @bantinggamer4962 6 лет назад

    can anyone explain to me why there is no onChange="do something while typing "
    how is the text updating in the view while you are typing? 49:16

    • @bantinggamer4962
      @bantinggamer4962 6 лет назад

      or am i thinking of a react-native only thing?

    • @blasttrash
      @blasttrash 6 лет назад +1

      where does the text update in the view? do you mean the box where he types the message? If thats the case, I think he did add onChange or something to it. without which he wont be able to pass the typed message back to other components.

    • @bantinggamer4962
      @bantinggamer4962 6 лет назад

      @@blasttrash yea i mean the the text input doesnt have a value="this.state.message" which updates the box with the values that you type.

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

    this video is helpful (thanks for making it), but there were far too many items that were 'glossed over' for it to be a game-changer. also, I agree with the other commenters who say the lesson lacks cohesion...it would have been far more beneficial to provide some basic diagrams early on in the video that could illustrate the basic structure of this Redux app...in other words, where's the '20,000 foot view' to anchor our understanding? instead, we feel like you are working on a puzzle as fast as you can after someone scattered the pieces of it all over the room. I had some other minor points to quibble, but I don't feel right about it because you seem so gol-darn nice.

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

    special guest at 37:10

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

    for the next videos please enable IDE eslint!

  • @ShivamSharma-ob8ix
    @ShivamSharma-ob8ix 3 года назад

    37:09 What was that? I mean ... the sound

  • @adrianthomas4163
    @adrianthomas4163 7 лет назад

    Nice. What're your sublime settings? What packages do you have installed other than sidebar-enhancements? Do you have a settings sync gist with your sublime setup?

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

    Are you going to deploy it

  • @dimitargetsov9690
    @dimitargetsov9690 6 лет назад

    Merry Christmas,Sir.
    When we type in a text box (belonging to an input tag), the browser shows up what we have
    typed immediately( in the same box), without rerendering ( in React terms).
    Just a link ( or a hint) for more
    information on that process.
    Best regards
    Dimitar

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

    In the last section of the tutorial that deals with web sockets, how come the client never sends an ADD_USER call to the server before it starts sending messages? Also, shouldn't the server send a users list to each new client at connection time? The app appears to be working for you in the end, which is really surprising considering what I've mentioned.

  • @ookookook
    @ookookook 7 лет назад

    Great video. Question: why Saga and not Observable?

  • @madsudan9227
    @madsudan9227 6 лет назад

    thanks its a great tutorial..

  • @controlaltdestroyer
    @controlaltdestroyer 7 лет назад +2

    When I try to run Yarn start I get Command not found, am I using a wrong version of Node or am I missing something?

    • @Bozeman42
      @Bozeman42 7 лет назад +1

      have you installed yarn before?

    • @Bozeman42
      @Bozeman42 7 лет назад +1

      yarnpkg.com/en/

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

    i am on windows 10 pro. when i close one of the sockets, the server crashes.Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:205:27)
    Emitted 'error' event on WebSocket instance at:
    at WebSocket.finalize (C:\Users\dimeg\Downloads\fcc-project-tutorials-master\fcc-project-tutorials-master\chat
    ode_modules\ws\lib\websocket.js:190:41).
    any help?

  • @Ivan-bf4ik
    @Ivan-bf4ik 4 года назад

    Thanks, but what about to run this app from different devices? I tried to do this by connecting via my phone, which had been connected to the same network as laptop. But I didn`t get messages from different divices. Can anybody tell me the reason ?

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

    Beau!! Beau!! Beau!!

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

    Hey, can someone help me with my issue? Server-side's node app.js command is not working for me. It basically does nothing, just freezes without any errors. It means that my websocket server is not running :/

  • @JoseNavas
    @JoseNavas 6 лет назад +1

    How can we add authentication ?

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

    I have clone this repo but am getting users is undef where is it loaded?

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

    getting error: WebSocket connection to 'wss://localhost:8989/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

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

    why do i get cannot read property map of undefined..i copied everything but still

  • @mdsumon-nb6uh
    @mdsumon-nb6uh 5 лет назад

    i have some problem
    Sidebar.PropTypes = {
    users: PropTypes.arrayOf(
    PropTypes.shape({
    id: PropTypes.number.isRequired,
    name: PropTypes.string.isRequired,
    }).isRequired
    ),
    };

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

    someone more having this problem? "Warning: Failed prop type: The prop `dispatch` is marked as required in `AddMessage`, but its value is `undefined`.
    in AddMessage (at Chat.js:28)
    in ChatTab (at routes.js:32)
    in component (at routes.js:13)
    in Route (at routes.js:10)
    in PrivateRoute (at routes.js:31)
    in Switch (at routes.js:27)
    in Router (created by BrowserRouter)
    in BrowserRouter (at routes.js:26)
    in Routes (at src/index.js:20)
    in Provider (at src/index.js:19)
    in App (at src/index.js:24)"

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

    Both messages in components/MessagesList and users in components/Sidebar are undefined.
    I don't understand redux well enough to know where they is passed from.
    can Someone please help.

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

      Somehow it's working now but I still don't get the messages that are added.

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

    Helpful learning experience trying to follow this. It appears to compile OK for me, but I'm getting WebSocket connection to 'ws://localhost:8989/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED in the development tools console. I think at one point everything came together and sort of worked. I think he got Chance to put random users by refreshing the page on localhost:3000. That only worked once for me, then never able to do it again. Unfortunately, flavio is impossible to reach and this project no longer even exists on his website. Would it be useful to post questions on this at the FCC community forum?

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

      Sorry, that problem with Chance is a Chrome thing. I was able to get it to work easily when I went over to Firefox. The same with the server. Sometimes Chrome drives me crazy.

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

      @@SilvaOnTube Have You found some solution with Chrome?I am ready to pay!!

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

      @@dimitargetsov5040 Sorry, nope.

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

    43:33 LMAO.

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

    Way too fast slow down, you also need to explain what you're doing...

  • @Hacking-NASSA-with-HTML
    @Hacking-NASSA-with-HTML 7 лет назад

    If this is Sublime Text, how you can set a folder/files list in left of screen in Sublime's settings?

    • @freecodecamp
      @freecodecamp  7 лет назад +3

      It's an extension called SideBarEnhancements for Sublime Text.

    • @Staluxa
      @Staluxa 7 лет назад +1

      project -> add folder to project (then ctrl+k and ctrl+b in quick succession to open/close it).

    • @KamalMorjalx
      @KamalMorjalx 7 лет назад +1

      Or... just drag a folder from your Explorer (windows), Finder (mac) or whatever file manager you use (Linux) into Sublime Text sidebar. You can then save that as a named project under the Project menu so that you get the project specific sidebar for each project you're working on.

    • @dimitargetsov9690
      @dimitargetsov9690 6 лет назад

      perfect!!!! thanks.

  • @alimansour7717
    @alimansour7717 6 лет назад +7

    You need to slow down.. this isnt a tutorial its a "watch me code this chat app"

    • @omarch.9202
      @omarch.9202 5 лет назад

      This is not a beginner course, learn the basics of React and Redux and go back to this video.

  • @jhuluan-jyun2594
    @jhuluan-jyun2594 5 лет назад

    awesome tutorial:D

  • @victorNDSL
    @victorNDSL 6 лет назад +6

    I don't think not using semicolons is a good habit to be taught.

  • @catalinmiu9265
    @catalinmiu9265 7 лет назад +1

    Hey bro, what text editor you use and what theme?
    Thanks
    Nice job.

  • @ismaeltechnow
    @ismaeltechnow 7 лет назад

    great job

  • @big_dedus
    @big_dedus 6 лет назад +1

    how to add firebase to this chat?

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

    Why socket.io? Why no middleware? Skipped...

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

    Typing all the prebuilt app on the screen is not what developers do. Especially importing the non existing components beforehand is super confusing for learners, who are also beginners.

  • @revanslacey
    @revanslacey 7 лет назад +1

    Lost me on the first line of code. What programme has "arrow chat" as a prompt? Looks like something out of the '80s! Can I do this on a modern MacBook Pro?

    • @freecodecamp
      @freecodecamp  7 лет назад +1

      Sorry, should have been more clear. That is just a normal console with some updated styling.

  • @nielsdominguez991
    @nielsdominguez991 6 лет назад

    Nice

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

    now I understand why this has poor views..

  • @mnmnaveed1319
    @mnmnaveed1319 7 лет назад

    Nice bro

  • @umnajdi
    @umnajdi 6 лет назад

    didnt work :|

    • @freecodecamp
      @freecodecamp  6 лет назад

      What specifically didn't work?

    • @umnajdi
      @umnajdi 6 лет назад

      So I solved all of the errors after doing node app.js for the server terminal, which I had opened as admin, but the random generated names dont show up, and messages from different localhost3000s dont show up, just whatever has been written in that window is shown

  • @feelingeverfine
    @feelingeverfine 7 лет назад +2

    The teacher's keyboard usage is very frustrating.

    • @Hacking-NASSA-with-HTML
      @Hacking-NASSA-with-HTML 7 лет назад +12

      You can cash back all your money you paid for this lesson !

    • @freecodecamp
      @freecodecamp  7 лет назад +9

      What specifically is frustrating? We're always looking for ways to improve!

    • @HackerUC
      @HackerUC 7 лет назад +4

      Watch the video at 1.5x :) I almost never watch tutorial videos at 1x

    • @dalsbury1979
      @dalsbury1979 6 лет назад +1

      It was a great tutorial. Nice to see a complete demo in 1.5 hours. Spellings mistakes set off my OCD a little, but great tutorial. It's really nice to watch you code and give light explanations. Most tutorials move too slow for someone who is experienced with similar tech, but new to a topic.

    • @MM-24
      @MM-24 6 лет назад +2

      you should really use webstorm or visualstudiocode - something with autocomplete. The typing errors and watching you type out variables and constants was a little frustrating

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

    the most buggy tutorial I have ever seen

  • @tenchichrono
    @tenchichrono 7 лет назад

    Way cool.