📂 CodeIgniter Directory Structure
CodeIgniter has a clean and organized folder structure. Each folder has a specific role in managing the application’s logic, configuration, and resources. Here’s a breakdown of the default folders in a fresh CodeIgniter installation.
🗂️ Root-Level Folders
📁 app/
Your main application code lives here: controllers, models, views, config files, filters, and language files.
📁 public/
The document root. It contains index.php and assets like CSS, JS, and images. This is the only folder exposed to the web.
📁 system/
Core CodeIgniter framework files. You usually don’t need to modify anything in this folder.
📁 writable/
Stores logs, cache, session files, and uploads. Ensure this folder has write permissions.
📌 Important Files
env– Sample environment settings file. Rename it to.envfor custom config.spark– CLI tool for running framework commands.composer.json– Composer dependencies and autoload settings.
🔐 Folder Access Tip
Make sure only the public/ folder is accessible via the web. All other folders should be placed outside the web root for better security when deploying to a server.


