Thanks for reading systemdesign.one newsletter. If you're not yet subscribed, let me help you with that:
High-Level Design
Upon launching the Slack client and initiating a chat message, the following operations take place:
The Slack client initiates a user authorization process by executing an HTTP POST request to the web API
In response, the server provides a snapshot of the workspace and the WebSocket URL, enabling the establishment of a WebSocket channel
Utilizing HTTP, the client publishes the chat message to the chat service
The chat service persists the chat message in the chat database and forwards it to the subscribed gateway servers via HTTP
Subsequently, the gateway server utilizes WebSocket to broadcast the chat message to the subscribed users