Free cookie consent management tool by TermsFeed Cookie Settings

Developing an Online Chat!


Tuesday, 21-07-20, Nick Zoumpoulis

Developing an Online Chat!

Our curiosity to develop our own Online Chatting system on a web browser environment turned out to be quite a difficult challenge.

Unlike the development of the Online Video Chat by using PeerJS protocol, this time we decided to create everything from scratch.

We used various popular web technologies including HTML, CSS, JQuery, AJAX, PHP and MySQL.

The logic behind the usage of a database in order to store conversations among users turned out to be quite useful when we started the implementation of the chat room for two main reasons: Save all conversations for future use as a repository – chat history and apply enhanced security through server side scripting techniques (PHP – MySQL).

Moreover, innovative protocols such as PeerJS were not available one and a half years ago when we started developing our Online Chat.

However, one of the main advantages of our technique was the multi-user environment which enabled conversations among many users while overcoming the barriers of strict P2P chatting.

The use of AJAX technology was necessary in order to have a smooth conversation with other users. AJAX gave us the opportunity to update the room when a new comment was available while avoiding continuous content refresh that could create unnecessary http requests. This was accomplished by comparing the latest conversation id displayed on the room with the latest id available on our database. The content of the room was automatically renewed only when a new comment id was available.

The most challenging obstacle was to achieve correct timings in order to enjoy a smooth operation during discussions.

Other details included the automatic auto scroll of the room in order to show the latest conversations from bottom up, the auto focus that should be applied on the text box right after posting a new comment, as well as the necessary (basic) emoticons that made the whole discussion a bit more fun!

As said above, the application has been developed for testing and analysis purposes and we have not used it yet commercially on a project, something which can be easily applied when the time comes.

You can visit our online chat by following this link:

http://www.interneti.gr/chat/

Developing an Online Chat!