[Vuejs]-Create chat rooms in VueJS

0👍

(Rep too low to post comment, would have done so instead otherwise).

I’d suggest to hide the existence of chat rooms from the frontend, and only tell it about one chat room. The backend would have a list of many rooms and each would have at most 5 people in it.
When the frontend connects with socket.io then you can tell it about the people who are in the chatroom with them.

This means the frontend code only knows about your 5-people chatroom and not about any others. That makes the frontend-side simpler because you only have to show a single chatroom.

The trick then is to manage this correctly in the backend.

0👍

I agree with the previous answer

Just display the chat component and fetch the right data depending on the current user (for example which room he’s in, and what people are with in etc…)

Hope you’ll figure it out 😉

Leave a comment