How to update a User’s Status in realtime?

I have a system which has two types of users. One is a seller and the others are the customers. I want all the users to get the details about all the seller who are currently online in real-time.
Basically, like a chat system where the users know if the users are online or not.
Whenever the seller logs into the my project, the customer should know that he is online. The same procedure should occur when the user exits the project (The customer should know that the seller went offline) .
Remeber that offline scenario could be that the seller logged out or closed the project tab or closed the browser. In any case if the seller leaves the project, others must be aware of it.

How can I achieve this ?

Community Page
Last updated: