CodeIgniter - Application Architecture

- As shown in the figure, whenever a request comes to CodeIgniter, it will first go to index.php page.
- In the second step, Routing will decide whether to pass this request to step-3 for caching or to pass this request to step-4 for security check.
- If the requested page is already in Caching, then Routing will pass the request to step-3 and the response will go back to the user.
- If the requested page does not exist in Caching, then Routing will pass the requested page to step-4 for Security checks.
- Before passing the request to Application Controller, the Securityof the submitted data is checked. After the Security check, the Application Controller loads necessary Models, Libraries, Helpers, Plugins and Scripts and pass it on to View.
- The View will render the page with available data and pass it on for Caching. As the requested page was not cached before so this time it will be cached in Caching, to process this page quickly for future requests.
Directory Structure

- Application
- System
- User_guide
Application
- Cache − This folder contains all the cached pages of your application. These cached pages will increase the overall speed of accessing the pages.
- Config − This folder contains various files to configure the application. With the help of config.php file, user can configure the application. Using database.php file, user can configure the database of the application.
- Controllers − This folder holds the controllers of your application. It is the basic part of your application.
- Core − This folder will contain base class of your application.
- Helpers − In this folder, you can put helper class of your application.
- Hooks − The files in this folder provide a means to tap into and modify the inner workings of the framework without hacking the core files.
- Language − This folder contains language related files.
- Libraries − This folder contains files of the libraries developed for your application.
- Logs − This folder contains files related to the log of the system.
- Models − The database login will be placed in this folder.
- Third_party − In this folder, you can place any plugins, which will be used for your application.
- Views − Application’s HTML files will be placed in this folder.
System
- Core − This folder contains CodeIgniter’s core class. Do not modify anything here. All of your work will take place in the application folder. Even if your intent is to extend the CodeIgniter core, you have to do it with hooks, and hooks live in the application folder.
- Database − The database folder contains core database drivers and other database utilities.
- Fonts − The fonts folder contains font related information and utilities.
- Helpers − The helpers folder contains standard CodeIgniter helpers (such as date, cookie, and URL helpers).
- Language − The language folder contains language files. You can ignore it for now.
- Libraries − The libraries folder contains standard CodeIgniter libraries (to help you with e-mail, calendars, file uploads, and more). You can create your own libraries or extend (and even replace) standard ones, but those will be saved in the application/libraries directory to keep them separate from the standard CodeIgniter libraries saved in this particular folder.
