PHP instant messenger ideas

I had some quite good ideas for how my new instant messenger will work.

I began the build as a straight HTML/PHP/CSS website built using the CodeIgniter framework.

To begin with I was working locally off my own testing server and building for PC desktop browsers only.

My aim was to get the basics working such as login, account updating, registration, global messages, posts, chat, add friends, and user search.

My plan is to gradually rebuild with AJAX support as I find again MVC tends to make building AJAX calls easy as your controller functions already work a lot like one.

I built each function area a JavaScript file to this end which contains all UI and AJAX code, with me eventually planning a pageloader JS class which will load all page content, handle touch swiping on mobiles to swap pages, and loading and replacing page content.

To begin with however only the menu and global message post feeds had JS and AJAX as they needed it.

jQuery makes AJAX calls very easy through its load, get, and post methods, I chose to use post for mine as this works well with codeIgniter, and no long messy URLs.

jQuery post – http://api.jquery.com/jQuery.post/

I had some good ideas to handle server load in future such as splitting functions over subdomains on different servers like login.mydomain.com, images.mydomain.com, and broadcast.mydomain.com, etc.

To begin with I created these in the codeIgniter config as constants so they could be used anywhere in the app.

I tested this locally and learned that you have configure the sessions cookie to work over subdomains for this to work in codeIgniter, throughout this build I have been learning a great deal of new ways of doing things, especially when working with desktop and mobile browser support.