Skip to content

Davi-Azeredo/php_web_framework

Repository files navigation

Framework

A production-ready MVC web application framework targeting PHP 8.2.

Requirements

  • PHP 8.2+
  • Composer
  • Docker & Docker Compose (for local development)

Setup Development Environment

The project ships with a complete Docker Compose environment.

  1. Clone the repository setting up this framework.
  2. Initialize .env file:
    cp .env.example .env
  3. Boot up the environment:
    make up
  4. Access the application on http://localhost:8080.
  5. Install dependencies inside container:
    docker-compose exec app composer install

Architecture

This framework strictly follows the MVC pattern, enforcing separation of concerns:

  • Models: Data representation and mapped entities.
  • Repositories: Data access and persistance (PDO).
  • Services: Business logic and orchestrations.
  • Controllers: Validates HTTP input, delegates to Services, and returns HTTP responses.
  • Views: PHP rendering logic, explicitly isolated.

The application utilizes a custom Dependency Injection (DI) Container for object lifecycle management.

Available Commands

Use the Makefile to run operational tasks:

  • make up: Start containers.
  • make down: Stop containers.
  • make bash: Access the PHP shell.
  • make test: Run PHPUnit with coverage.
  • make lint: Run PHP_CodeSniffer for PSR-12 compliance.
  • make analyze: Run PHPStan static analysis (Level 8).
  • make migrate: Execute pending migrations.

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors