Test Real-Time Messaging

The first complete real-time messaging workflow is now implemented.

Restart the backend if necessary and open the application in two browser windows.

Follow these steps:

  1. Open the first browser window.
  2. Enter username John.
  3. Join the chat.
  4. Open the second browser window.
  5. Enter username Sarah.
  6. Join the chat.
  7. Send a message from John.
  8. Verify that Sarah receives it immediately.
  9. Send another message from Sarah.
  10. Verify that John receives it.

Expected result:

Both clients should see the same messages without refreshing the browser.

At this stage, usernames are supplied by the browser and are not authenticated identities. We will discuss trusted identity and authentication in a later chapter.

Key Takeaways
  • Multiple browser clients can exchange messages in real time.

  • Messages are distributed through Socket.IO broadcasting.

  • The application does not yet persist messages after server restarts.