CodeIgniter Folder and Files

Hi dev,

In CodeIgniter 4, the folder and file structure is organized to promote a clear separation of concerns and facilitate easy development. Here’s a brief overview of the main folders and files:

➡️ app/: This is the main directory where you’ll spend most of your time developing your application. It contains subdirectories for Controllers, Models, Views, Configurations, Helpers, etc.

➡️ system/: This folder contains the core files of the CodeIgniter framework. You typically won’t need to modify anything in this directory.

➡️ public/: This folder serves as the web root and contains publicly accessible files, such as CSS, JavaScript, images, and the index.php file.

➡️ writable/: This directory stores temporary files, logs, and other files that need to be written to by the application. It should have write permissions for the web server.

➡️ vendor/: This directory contains dependencies installed via Composer. It’s typically managed automatically by Composer and contains third-party libraries used by your application.

➡️ tests/: This directory contains test files and folders for testing your application. It’s not included in the default distribution but is often included in projects for automated testing.

➡️ composer.json and composer.lock: These files are used by Composer to manage dependencies and autoload classes.

➡️ env: This file contains environment-specific configuration settings. It’s used to define environment variables such as database connections, debugging settings, etc. You should not include sensitive information in this file, as it may be exposed.

➡️ index.php: This is the main entry point for your application. It bootstraps the CodeIgniter framework and routes requests to the appropriate controller.

➡️ README.md: This file contains information about the CodeIgniter project, including installation instructions, usage guidelines, and other useful information.

These are the main folders and files you’ll encounter when working with CodeIgniter 4.

This video help you a lot to get everything that you need to know before starting working with this PHP framework.