There are tons of socket.io “how to’s” to create the simplest chat room but I found nothing showing how to use it for a more advanced one.
I have created from scratch a chat system (using php/mysql/ajax) with these characteristics:
- advanced members management (login, avatars, personal info, stored pseudo for exclusive use etc..)
- users can join an existing chatroom or create a new one
- possibility to create private rooms within each public chatroom to talk privately with anyone
- possibility to administrate and moderate each chatroom by banishing a member according to his pseudo and/or IP address, delete a specific message among others
- etc…
The problem is that the system I created is not very scalable as it is using short polling techniques which threaten to crash the server if I have too many users online.
Apparently, using socket.io will fix that problem but it implies to use javascript from a to Z on both the server and client side (I’m not a javascript developper, just a javascript user).
I have no problem in learning new things but the tons of tutorials on the web showing you how to use socket.io for a chat are limited to very minimalist one’s (connect, write, read, that’s all) which is fine for a start but not very useful for a more ambitious project.
It also seams that, with socket.io, the database is out of the picture but how to rethink your system accordingly (store the user and his personal info permanently, retrieve messages history, filtering among all the previous messages, showing the 15 previous messages when a user connects himself, going back and forth from a private room to the main public one while still having access to all the previous messages you expected to on each room, etc…).
Whithout a database, I can’t figure out, even on paper, how to achieve all of this and I didn’t find anything about this anywhere.
I don’t expect to find an existing soket.io version of my php advanced chatroom and that’s not what I’m looking for. I’m looking for comprehensive tutorials (free or not) giving me all the background required to create a system with the above mentionned functionalities using socket.io.
I’ve search the net for two days and I still don’t know how to go beyond the simplest chat system. I know how to write something and push it to all users browsers for them to read it. It’s neat but now what?
Any references or advices?
Thank you (and sorry for my poor english).
PS: I tried to use “socket.io” and “tutorials” tags but even if they exist, for whatever reason, I’m not allowed to use them…
If you need an advanced tutorial on Node based chat. Check this:
Nodechat.js continued – authentication, profiles, ponies, and a meaner socket.io
It is Node.js and Socket.Js built on BackBone.Js.