Node.JS, Socket.IO-based realtime chat structured with Knockout and designed with Bootstrap. Enough buzzwords for you?
https://twitter.com/RecodingBlog/status/319247673515446273
This here's my attempt to write a neat-o node.js-based chat. You can find the live demo at http://kittens-chat.herokuapp.com/ but it might not be up-to-date.
One of the nice things about Socket.io is that it allows one to define custom events at will. Kittens Chat uses the following events:
history
: Sends an object containing every message recorded (These are still lost in the event of a server restart)message
: Sends data* about a singular messageloginAck
: Acknowledges a client's login, assigns them a colorannounce
: When someone logs in, their username is broadcasted out to welcome themlogin
: Sends the desired username to the servermessage
: Sends a message that the user just typed in to the serverremind
: Quick fix for when the server loses all usernames on restart. remind
reminds the server of the user's name/color.roomChange
: The client wants to change to a new room* A message is an object with four properties:
author
: Username of person who sent the messagecolor
: What color the author should display astext
: Text content of the message. HTML will be escaped by Knockout.jstime
: Date object of when the message was recieved by the server
message
s in the code to be in the right order (They currently work, just bring them up to standard)system
event for messages sent by system (only needing to send a string)