A PHP MVC framework with invokable controllers (Actions), Views are classes for data manipulation before rendering Templates, Models are partitioned between DAO and DTO objects. And Modular separation, similar to Django apps.
Go to file
2025-12-23 17:39:06 -06:00
.github/workflows initial commit 2025-12-14 17:10:01 -06:00
bin feat: implement M9 & M10 (CLI, Scaffolding, Security, JWT) and standardize middleware 2025-12-22 15:52:41 -06:00
src M11-OR: Multiple storage disks, log channel management, and HTTP client middleware. 2025-12-22 18:12:38 -06:00
tests M11-OR: Multiple storage disks, log channel management, and HTTP client middleware. 2025-12-22 18:12:38 -06:00
.editorconfig initial commit 2025-12-14 17:10:01 -06:00
.env.example Milestone 8: DB ORM integration 2025-12-21 17:01:10 -06:00
.gitattributes initial commit 2025-12-14 17:10:01 -06:00
.gitignore Milestone 8: DB ORM integration 2025-12-21 17:01:10 -06:00
composer.json M11: Logging, HTTP client, and filesystem 2025-12-22 18:00:45 -06:00
composer.json.bak Fix tests 2025-12-22 16:04:15 -06:00
LICENSE Initial commit 2025-12-09 21:32:51 +00:00
MILESTONES.md Updates to README and MILESTONES. Add SPECS 2025-12-23 17:39:06 -06:00
phpstan.neon.dist initial commit 2025-12-14 17:10:01 -06:00
phred initial commit 2025-12-14 17:10:01 -06:00
phred.bat initial commit 2025-12-14 17:10:01 -06:00
README.md Updates to README and MILESTONES. Add SPECS 2025-12-23 17:39:06 -06:00
SPECS.md Updates to README and MILESTONES. Add SPECS 2025-12-23 17:39:06 -06:00

Phred

A PHP MVC framework intended for projects of all sizes, designed for both solo and team development.

Requirements

  • PHP: 8.2+
  • Web Server: Apache/Nginx (recommended)
  • Package Manager: Composer

Installation

Install Phred via Composer:

composer create-project getphred/phred

Getting Started

Creating a Module

Phred uses a modular (Django-style) architecture. All your application logic lives inside modules.

To scaffold a new module:

php phred create:module Blog

This will create the module structure under modules/Blog, register the service provider, and mount the routes.

After creating a module, update your composer.json to include the new namespace:

{
  "autoload": {
    "psr-4": {
      "Project\\\\Modules\\\\Blog\\\\": "modules/Blog/"
    }
  }
}

Then run:

composer dump-autoload

Running the Application

Start the local development server:

php phred run

The application will be available at http://localhost:8000.

CLI Usage (phred)

The phred binary provides several utility and scaffolding commands.

Generators

  • php phred create:module <name> — Create a new module.
  • php phred create:command <name> — Create a custom CLI command.
  • php phred create:<module>:controller <name> — Create a controller.
  • php phred create:<module>:view <name> — Create a view and template.
  • php phred create:<module>:model <name> — Create a domain model.
  • php phred create:<module>:migration <name> — Create a migration.
  • php phred create:<module>:seed <name> — Create a database seeder.
  • php phred create:<module>:test <name> — Create a test.

Database

  • php phred migrate — Run database migrations.
  • php phred migration:rollback — Rollback migrations.
  • php phred seed — Seed the database.
  • php phred db:backup — Backup the database.
  • php phred db:restore — Restore the database.

Testing & Utilities

  • php phred test — Run tests for the entire project.
  • php phred test:<module> — Run tests for a specific module.
  • php phred list — List all available commands.

Technical Specifications

For detailed information on the framework architecture, service providers, configuration, and MVC components, please refer to:

👉 SPECS.md | MILESTONES.md

License

Phred is open-source software licensed under the MIT license.