Directory Structure
Below is the default directory structure of a SigmaPHP application. It provides a clean and organized layout designed to keep application logic, configuration, and runtime resources clearly separated.
├── app
│ ├── Controllers
│ ├── Models
│ ├── Routes
│ └── Views
├── bin
│ ├── sigma-cli
│ └── sigma-cli.bat
├── composer.json
├── composer.lock
├── config
│ ├── app.php
│ └── database.php
├── database
│ ├── migrations
│ └── seeders
├── LICENSE
├── phpunit.xml
├── phpunit.xml.dist
├── public
│ ├── assets
│ └── index.php
├── README.md
├── storage
│ ├── cache
│ └── uploads
├── tests
│ └── ExampleTest.php
└── vendor
app/
The main application directory where your business logic lives. This is where developers spend most of their time building features, defining routes, creating controllers, models, and rendering views.
app/Controllers
Contains controller classes responsible for handling incoming requests, processing application logic, and returning responses or rendered views. Controllers act as the bridge between routes and the application logic.
app/Models
Holds database models used by the ORM layer. Models represent database tables and provide an organized way to interact with application data.
app/Routes
Stores route definition files where application endpoints are registered. Routes map URLs to controllers or actions and define how requests are handled.
app/Views
Contains template files used to generate HTML responses. Views separate presentation logic from application logic, keeping the codebase clean and maintainable.
bin/
Includes executable CLI tools provided by SigmaPHP. These utilities help developers run the development server, manage migrations, and perform framework-related tasks directly from the terminal.
config/
Stores all framework and application configuration files. Each file defines a specific group of settings such as application behavior or database configuration, allowing easy customization across environments.
database/
Dedicated directory for database-related resources. It contains migration and seeder classes used to manage schema changes and populate initial data.
database/migrations
Migration files define incremental database structure changes. They allow version-controlled schema updates that can be applied consistently across different environments.
database/seeders
Seeder classes are used to insert sample or required data into the database, making it easier to prepare development or testing environments.
public/
The public entry point of the application. This directory is intended to be exposed to the web server and contains publicly accessible resources and the front controller responsible for bootstrapping the framework.
public/assets
Stores publicly accessible static resources such as stylesheets, JavaScript files, images, and other client-side assets.
storage/
Used for runtime-generated files created by the application. This includes cached data and uploaded user content that should not be part of the application source code.
storage/cache
Contains cached files generated to improve performance, such as compiled templates or temporary application data.
storage/uploads
Default location where uploaded files are stored. This directory keeps user-generated content organized and separated from application logic.
tests/
Holds automated tests for the application. This directory is used to validate functionality and ensure application stability through unit and feature testing.
vendor/
Contains all Composer dependencies installed for the project, including third-party libraries and framework components. This directory is automatically managed by Composer and should not be modified manually.