Design Chat Application – Frontend System Design Guide

In this guide, we design a chat app’s frontend: real-time messaging over WebSockets, offline support, and infinite scrolling through message history.
Requirements
Functional
You provided the following main functional requirements:
- Real-time sending and receiving of messages across devices.
- Offline support: Messages sent offline should be stored and then sent when the user comes back online.
Clarifying Questions:
- Is there any authentication required for users?
- Assume users are authenticated.
- Do we need features like message read indicators, typing indicators, or group chats?
- If we have time at the end, right now, out of scope.
- What about media messages, like images, videos, or files?
- If we have time at the end, right now, out of scope.
- Is message history preserved indefinitely, or is there some sort of retention policy?
- We will leave that up to you to follow best practices.
- How should notifications be handled?
- Out of scope right now.
Non-Functional
- Observability: Given that every user might send or receive messages multiple times a... premium content.
