A lightweight, extensible MVC framework designed for PHP developers to create structured and maintainable web applications. This framework adheres to the Model-View-Controller (MVC) architectural pattern, promoting a clean separation of concerns.
- Introduction
- Features
- Installation
- Usage
- File Structure
- Dependencies
- Configuration
- Testing
- Contributors
- License
This MVC framework provides developers with a flexible and robust foundation for building PHP applications. Its modular design encourages scalability and ease of maintenance while integrating seamlessly with third-party libraries through Composer.
- Lightweight Framework: Minimal overhead and optimized for performance.
- Separation of Concerns: Clear separation of application logic, data handling, and presentation layers.
- Composer Integration: Leverage Composer for dependency management.
- Extensible Design: Easily integrate additional modules or libraries.
- Built-In Routing: Simple and intuitive routing system.
- Customizable Views: Dynamic rendering with reusable components.
Ensure your environment meets the following requirements:
- PHP: Version 7.4 or higher
- Composer: Dependency manager for PHP
-
Clone the Repository:
git clone https://github.com/MostafaAllam-start/MVC.git
-
Navigate to the Project Directory:
cd MVC -
Install Dependencies:
composer install
-
Configure Your Environment:
- Duplicate the
.env.examplefile and rename it to.env. - Update the configuration settings (e.g., database credentials).
- Duplicate the
Start the PHP built-in server to test the application locally:
php -S localhost:8000 -t publicNavigate to http://localhost:8000 in your browser.
MVC/
├── app/
│ ├── controllers/ # Handles application logic
│ ├── core/ # Framework core classes (e.g., Router, Database)
│ ├── models/ # Business logic and data interaction
│ ├── views/ # HTML templates and layouts
├── public/ # Publicly accessible files (e.g., index.php, assets)
├── vendor/ # Composer-managed dependencies
├── composer.json # Composer configuration
├── index.php # Entry point
├── .htaccess # Apache server configuration
This project uses Composer for dependency management. Key dependencies include:
phpoption/phpoptiongraham-campbell/result-type
Run composer show for a complete list of dependencies.
The application can be configured via the .env file. Key settings include:
- Database Configuration:
DB_HOSTDB_NAMEDB_USERDB_PASSWORD
- Application Settings:
APP_ENVAPP_DEBUG
Run the test suite with PHPUnit:
vendor/bin/phpunitEnsure all tests pass before deploying changes.
This project is licensed under the MIT License. See the LICENSE file for details.
We welcome contributions and feedback! Please feel free to fork the repository and submit pull requests.