you should check out Node.js ; This is a very effective way to continue such a chat project.
cf, for example, is a chat demo .
Node.js is a powerful infrastructure for real-time web applications. The server-side application is written in Javascript so that you can present an event for the exchange of codes between the client and the server (you could share classes, exchange templates ...)
source share