Skip to content

theokeist/pipeflow

Repository files navigation

PipeFlow

PipeFlow is a pragmatic PHP 8.5+ framework that leans hard into functional composition (pipeline style) while still giving you familiar MVC ergonomics (controllers, models, views, migrations) + a CLI scaffold.

Quickstart

composer install
cp .env.example .env
php pipeflow serve

Open: http://127.0.0.1:8000

Documentation

  • Main docs: docs/README.md
  • CLI guide: docs/CLI.md
  • Routing & pipelines: docs/ROUTING.md
  • Error handling: docs/ERROR_HANDLING.md
  • Flash messages: docs/FLASH.md
  • Authentication: docs/AUTH.md
  • Database layer: docs/DATABASE.md
  • Workers: docs/WORKERS.md
  • HTTP helpers: docs/HTTP.md
  • Changelog: docs/CHANGELOG.md
  • Architecture overview: docs/ARCHITECTURE.md
  • Per-file reference: docs/reference/
  • Codex / AI contributor notes: docs/CODEX.md

Routing

Routes live in routes/web.php:

$router = app(\PipeFlow\Router\Router::class);
$router->get('/', [\App\Controllers\HomeController::class, 'index'], 'home');

Conn + Plugs (Phoenix-inspired)

PipeFlow now supports Phoenix-ish request flow using a Conn object and a plug pipeline.

  • PipeFlow\Http\Conn carries Request, Response, session, assigns, etc.
  • Plugs implement PipeFlow\Plug\Contracts\PlugInterface and are composed via PlugStack.
  • Built-in plugs: SessionPlug, CsrfPlug (enabled by default in the Kernel).

Write a route handler that receives a Conn:

use PipeFlow\Http\Conn;

$router->get('/hello', function (Conn $conn) {
    return $conn->assign('name', 'world')->render('hello');
});

Views

view('welcome', ['title' => 'PipeFlow']) renders resources/views/welcome.php.

Models

Create a model:

php pipeflow make:model Post --migration

Base model lives at PipeFlow\Database\Model.

Migrations

php pipeflow migrate
php pipeflow migrate:rollback --steps=1

Migrations live in database/migrations.

Functional pipeline

Use the global pipe() helper:

$result = pipe('hello',
  fn($s) => strtoupper($s),
  fn($s) => $s . ' WORLD'
);

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published