Clover PHP is a modern, unopinionated, and lightweight Express.js-style framework for PHP 8.4.
It helps you build REST APIs, web apps, and microservices with the simplicity of Express.js and the power of modern PHP.
š Minimal & Fast ā Simple API design, inspired by Express.js.
ā” Async Support ā Built with PHP Fibers & AMPHP for non-blocking I/O.
šļø Routing System ā Intuitive get(), post(), etc., with async router support.
š Auth Ready ā Supports sessions, cookies, and JWT-based authentication.
š§© Extensible Middleware ā Add global and route-level middleware for logging, security, and validation.
š¾ Database Agnostic ā Works with both SQL and NoSQL databases.(Upcoming)
š ļø MVC Support ā Controllers, models, and views with interfaces for clean architecture.
š”ļø Error Handling & Logging ā Developer-friendly error responses and logging tools.
šØ Unopinionated ā Flexible enough for small apps or large enterprise projects.
š¦ Composer & PSR-12 ā Modern PHP practices with full Composer/PSR-12 compliance.
composer create-project cloverphp/clover my-app
cd my-appphp -S localhost:3000 -t public
<?php require_once __DIR__ . "/vendor/autoload.php"; use Clover\Clover; use Clover\Http\Request; use Clover\Http\Response; $app = new Clover(); $router = $app->router(); // Home route $router->get("/", fn(Request $req, Response $res) => $res->send("<h1>Welcome to š Clover PHP!</h1>")); $router->post("/", fn(Request $req, Response $res) => $res->json(['name' => 'Clover PHP!']) ); $app->run(3000, true);
my-app/ āāā app/ ā āāā Controllers/ ā āāā Models/ ā āāā Views/ āāā public/ ā āāā index.php āāā vendor/ āāā composer.json āāā README.md
$app->use(function (Request $req, Response $res, callable $next) { $res->setHeader("X-Powered-By", "Clover PHP"); $next($req, $res); });
Clover PHP is open-sourced software licensed under the