This project was designed to build lightweight PHP applications based on the MVC architecture. It was inspired by Laravel to streamline development & provide easy use.
For a better saying, it's the lumen version for the lumen micro-framework.
- Download or clone the repository.
- Run
composer install
. - Run
touch .env
to create an env file. - Copy
.env.example
content to.env
. - Inject your mysql database credentials in
.env
file. - Run
php run db:migrate
for database migration. - Run
php run dev
to preview the project on your local webserver.
If you intend to use this micro framework for a personal project, you can ignore the core
directory unless you need to override existing functionality. All your application files should reside in the app
directory, as you can use routes.php
for route definition.
If you wish to contribute to this project, you are welcome to enhance or override the existing functionality in the core
directory.
For view rendering, we've choosed Twig as a default template engine.
This project is organized into three primary components:
- Models: Located at app/models
- Views: Located at app/views
- Controllers: Located at app/controllers
The foundational components of this project include:
- Base Controller Class: core/BaseController.php
- Database Connection Handler Class: core/Database/DBConnection.php
- Query Builder Class: core/Database/QueryBuilder.php
- Base Model Class: core/Database/BaseModel.php
- Command Handler Class: core/CommandHandler.php
- Router Handler Class: core/Facades/Router.php
- Request Handler Class: core/Facades/Request.php
- View Handler Class: core/Facades/View.php
- A set of helper functions: core/helpers.php
- All requests are routed through index.php as specified by the .htaccess file.
- The router handler class includes the target controller and invokes the corresponding method as defined in routes.php.
- The target controller interacts with models, leveraging the BaseModel class which utilizes a Query Builder to facilitate database interactions following an object-oriented paradiagm.
- The target controller renders the appropriate view.
- Additional ORM implementations and Query Builder methods
- More utility/helper methods
- An exception handler for improved error handling
- Sanitization & data validating
- And much more ..
We welcome and actively encourage contributions to this project. Whether you want to report bugs, suggest new features, or improve the existing code, your input is valuable. Join us in making this project better by submitting pull requests, participating in discussions, and sharing your expertise.