I am making a social media app, I need logic for user chat, how to make communication between a user who is active and a user who is selected from registered users? How to see only messages between two users? And later, I can choose another registered user and communicate with him independently from other registered users? I use react js, firestore database. For now, I have a users collection that has a UID identical to the UID auth, i.e. the UID of a registered user through firebase auth, and within the users collection I have a messages subcollection where each user sees his messages, when I open another window to achieve websocket realtime communication, in the chats window I see only the messages of one user it is the one who sent or received, but those messages are not in the same place? If I create a collection of messages, then I will have messages that will be for all users, the so-called group chat, and that's what I don't need, that's why I created a subcollection for each user to have their own messages, and now I should share that with the selected user only if there is communication I will also need this logic for posts where each user will be able to see their post and the post of those they follow on the social media app, so if you have any tips that would be great, I've been stuck here for a while.. Thanks!