Hi Ayitharaju,
There are many ways to achieve this.
As reference you could watch this Video
https://www.mendix.com/live/make-a-chat-app-in-60-minutes/
Good Luck :-)