I want to know the idea of chat programs such as WhatsApp, Messenger, Telegram

A basic example

Modify the example to most of what you hope to achieve.

Search the community for 'chat' for more examples. :slightly_smiling_face:

Herre is another example