By this point, the main structure of your application is complete. It’s time to think about new features that could improve the overall interaction on your application but aren’t necessary for the fundamental functionalities. In earlier lessons, I discussed how particularly useful Node.js is for handling streams of data. If you want to send a big batch of data across the internet, Node.js makes the process simpler by supporting data chunking. Chunks of data are connected as they arrive at the server and processed when there’s enough data to do something meaningful with them. This approach is useful in various types of data streams, and it’s made possible through the event-emitting and event-handling features of Node.js.
In this unit, you explore how to use Node.js to facilitate a real-time chat application through event-driven communication over web sockets. I discuss how chat applications can be built with the simplest of HTML tools and how web sockets and socket.io are more-efficient, sophisticated options than historic client-server communication. You apply the chat functionality to your existing application to allow existing users to communicate in a group setting. Then you take things a step further by creating a data model for your chat messages and loading messages from the database when you open the application’s chat page. Last, you implement an icon in the navigation bar that acts as an indicator when the chat page is active, even when the user is on a different page.
This unit covers the following topics:
In lesson 33 (the capstone lesson), you use the concepts learned in this unit to build a chat feature for the Confetti Cuisine application.