journal
Real world apps with CodeIgniter: part 1
February 20, 2007
So after a little coaxing from Derek, I have finally gotten around to talking about what projects have been on the plate for Glossopteris for the last couple of months. This will be of some interest to the CodeIgniter community as some of these projects have been some pretty mission critical applications for use in the US political game.
Glossopteris had been asked in about August of last year, if we would like to develop a scheduling and logisitics management application for one of the candidates for the next US federal election (I am being purposely vague here!). Without hesitation I said yes, and decided that CodeIgniter(CI) would be the right vehicle to approach this quite daunting task.
The brief asked for the ability to build a schedule for the key figure through a set of instructions known as a decision tree that layed out all the possible actions that could be taken for each type of event. In addition to this data entry, we had to be able to adequately display the information and build reports in the form of downloadable PDF's.
So after some serious thought about how best to tackle this we decided that laying out the 'Decision Tree' into XML would be the best way to form the core of the application. So with an idea on how to build the core I set out building the application with CI, with heavy use of our Table Relationships library that made CRUD actions very easy.
Being very familiar with CI through having built a number of complex applications previously I was very diligent in following the 'MVC' pattern for application development, although with the Table Relationships library at the core the app it is more of 'LVC'.
To really try and wow the client I decided to make the app as 'Web 2.0' as possible, so there is heavy AJAX use throughout. Being a fairly closed application with a finite amount of users, it was possible to define to them that Firefox must be the browser. This was a huge bonus during development as cross-browser testing is easily the worst part of the job. It also kept costs down as having to make things work for IE slows down development quite a bit.... I did build the AJAX features with Prototype/scriptaculous which are well tested in all browsers but still it is great to be able to target one browser.
As with most projects when the clients liked what they saw, there were a lot of requests for added extras and this is where CI has been a huge benefit. As I tried very hard to put all relevant code into libraries, helpers or plugins adding new features was a lot less painful that it could have been.
The most difficult part of the development was almost certainly trying to generate PDF's easily. We had decided to go the open-source route and DomPDF was the best solution given that producing the reports straight from HTML made things easier. However the huge memory demands, requests from the clients to accurately reproduce Word reports and installing fonts to the system made life that little less easy.
So after about 3 months of solo development I had a fully working drag/drop AJAX interface running on the top of CI using XML to store the event information. It went live in late December and is now a critical element of the campaigns scheduling team.
In Part II I will give a short run down on the second application completed for this campaign that was a heavy use fundraising tool built with...... you guessed it CodeIgniter.