Getting the lay of the land
In this chapter, we are going to build a chat application that is hauntingly reminiscent of the one that we saw in Chapter 5, Real-Time Data and WebSockets. The big difference, of course, is that our client will be an Ionic app this time, which will be able to interact fully with browser clients that are also connected to the same server. In doing so, we demonstrate how easy it is to build apps that almost seamlessly interact with apps on other platforms that use the same server.
What we will need
To get our app working, we will need:
- A server that can both receive and relay messages via WebSockets.
- An app that can connect to a server using WebSockets and send, receive, and process messages over the same protocol. All the sent data should be rendered in a way that is meaningful to the user.
In the spirit of this book, we will of course use Node.js for our server. To add WebSocket support to it, we will use the socket.io
library, which you already saw in Chapter 6...