LacePHP Structure ================== LacePHP follows the Model View Controller approach. MVC stands for Model View Controller. If you are new to this pattern, here is a brief overview: .. container:: note MVC is a software design pattern for user interfaces, data handling and control logic. It keeps business logic separate from presentation. Models handle database operations to fetch, save and update records. Views are responsible for presentation and contain the HTML and assets used to display data. Controllers contain the business logic. This separation of concerns makes code more readable and easier to maintain. Many developers struggle to keep these layers separate. You might see HTML mixed into controllers or business logic buried in models. Validation can be especially tricky. Some prefer to validate in models, others in controllers. As you gain experience, you will discover what works best for your project. Always place code where it will be clear and maintainable by the next developer. Below is the LacePHP folder structure: .. code-block:: text LacePHP/ ├── public/ │ └── index.php ├── lacebox/ # The framework core ├── weave/ # Your application code │ ├── Controllers/ │ ├── Models/ │ ├── Middlewares/ │ ├── Helpers/ │ ├── Libraries/ │ ├── Validators/ │ ├── Views/ │ └── Plugins/ ├── shoebox/ # Generated migrations, cache, logs and fallback views ├── routes/ # Route definitions (api.php, web.php, etc.) ├── config/ # Configuration files ├── vendor/ # Composer packages ├── composer.json # Dependency and autoload definitions ├── shoedeploy.php # Deployment helper ├── lace.json # System configuration and feature flags └── .env # Environment variables and secrets .. warning:: Avoid modifying any code in the ``lacebox`` folder. It contains the framework core and will be overwritten when you update the framework. If you find bugs or want to add features, please contribute via our contribution process so your improvements benefit everyone. Set your web server’s document root to the `public/` folder. That way only `index.php` is exposed to the internet, and the rest of your application code stays safely out of direct reach. | |