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-appcd 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 Developed by @CodeWithSushil.