I would like to implement a very simple chat in a website, with private messages between 2 registered and logged-in users (and possibly even group messages between logged-in users).
Take Whatsup as an example, but of course I won't have that many users.
Resources: Symfony2 + WebsocketBundle
https://github.com/GeniusesOfSymfony/WebSocketBundle
Two questions:
1- What database schema would you suggest?
2- How would I manage the "topics"? (After reading WebsocketBundle tutorial, I understand how to subscribe/unsubscribe/broadcast to a topic. But I don't know how to manage the relationship between users and topics, how to protect the conversations etc etc...
I just need some information (no code) about the logic of the application... what information to save and where.)
For example, how do I manage the name of the channel (will it change everytime, or do I store it in the database and somehow re-use it the next time the user logs in)?
session.subscribe("acme/channel/id/12345", function(uri, payload){
console.log("Received message", payload.msg);
});
P.s. I've already tried searching on SO and Google but couldn't find any useful information.