Link to video

Features :

  1. Group Messaging
  2. Sent + Delivered + Read receipts
  3. Online/Last Seen
  4. Image sharing
  5. Chats are temporary/permanent
  6. One to one chat.

Implementing sent, delivered, read receipts

Client sends request to gateway. Now gateway needs to know which client is connected to which gateway. So, we can have a sessions micro-service which stores who is connected to who.

           **User (Send Request to Gateway)**

                                          **⬇️**

        **Gateway sends it to the sessions service.**

                                          **⬇️**

Sessions service finds out which gateway user 2 is connected to and connects the users.

For client-client protocol we need a P2P protocol, so we can use web sockets. (TCP) For read, delivered receipts, the users need to send acknowledgments to the server that the message has been delivered.

                           WhatsApp Architecture : Read Receipts.

                       WhatsApp Architecture : Read Receipts.

→ Implementing last seen/online feature

Whenever, a user sends a message, reads a message or does any activity, it is logged as activity in database table. It is updated as and when the activity is updated.

Have a last seen microservice that does user activity tracking. Two types of activity, app requests and user requests.

Implementing group messaging feature [Link]