CodeIgniter 4 Application Structure or Folder Structure

CodeIgniter 4 Application Structure or Folder Structure

Default Directories
A fresh install has following  directories: /app, /system, /public, /writable, /tests. Each of these directories has a very specific part to play.

Lets discuss about each and every directory in details


This is the heart of our application where all of your application code saved here. This directory again contains some of the important sub directories.

  • Config: Stores the configuration files like App.php, Events.php, Autoload.php etc.
  • Controllers: Controllers determine the program flow. The Controller classes which are created by a developer will resides in this location.
  • Database: Stores the database migrations and seeds files, Whenever we are migrating from one database to another database,the supported files will saved in this location.
  • Filters: Stores filter classes that can run before and after controller.
  • Helpers: Helpers store collections of standalone functions
  • Language: Multiple language support reads the language strings from here
  • Libraries: Useful classes that don’t fit in another category. The custom libraries are stored in this location.
  • Models: Models work with the database to represent the business entities.
  • ThirdParty: ThirdParty libraries that can be used in application
  • Views: Views make up the HTML that is displayed to the client.

All The core files used to create CodeIgniter 4 framework are available in this location. We can also customize the core files as per our requirement.


Public folder was introduced in CodeIgniter 4. The public folder holds the browser-accessible portion of your web application, preventing direct access to your source code. It contains the main .htaccess file, index.php, and any application assets that you add, like CSS, javascript, or images.

This includes directories for storing cache files, logs, and any uploads a user might send. You should add any other directories that your application will need to write to here

This directory is set up to hold your test files. The _support directory holds various mock classes and other utilities that you can use while writing your tests. This directory does not need to be transferred to your production servers.

Share this post