Summary
In this chapter, we implemented a frontend for our chat app backend. We started by integrating the Socket.IO client with React by making a context and a custom hook for it. Then, we used AuthProvider
to get the token to authenticate a user when connecting to the socket. After that, we displayed the status of our socket. Then, we implemented a chat app interface to send and receive messages. Finally, we implemented chat commands by using acknowledgments to get the rooms that we are in.
In the next chapter, Chapter 15, Adding Persistence to Socket.IO Using MongoDB, we are going to learn how to store and replay previously sent messages using MongoDB with Socket.IO.