Chapter 2. Building a multiroom chat application
This chapter covers
- A first look at various Node components
- A sample real-time application using Node
- Server and client-side interaction
In chapter 1, you learned how asynchronous development using Node differs from conventional synchronous development. In this chapter, we’ll take a practical look at Node by creating a small event-driven chat application. Don’t worry if the details in this chapter seem over your head; our intent is to demystify Node development and give you a preview of what you’ll be able to do when you’ve completed the book.
This chapter assumes you have experience with web application development, have a basic understanding of HTTP, and are familiar with jQuery. As you move through the chapter, you’ll
- Tour the application to see how it will work
- Review technology requirements and perform the initial application setup
- Handle chat-related messaging using Socket.IO
The application you’ll build in this chapter allows users to chat online with each other by entering messages into a simple form, as shown in figure 2.1. A message, once entered, is sent to all other users in the same chat room.