Leaf is a lightweight web framework. Start a project in one command, add sign-in, payments and more as you need them, and keep code that stays clean whether you write it or your coding agent does.
Ask your coding agent for a feature. Leaf is the framework underneath, so the files land where they belong and still read cleanly next month. Works with Claude Code, Cursor, Copilot and the rest.
Drag the handle. Coders read the code, everyone else sees the app it makes.
Sponsors keep Leaf moving: new modules, better docs, and people who answer your questions.
Sign-in, a database and CORS are set up before you open your editor. No config files to learn first.
$ leaf create my-product ✓ Project scaffolded ✓ Auth, DB, CORS configured ✓ Shared agent context ready$ leaf serve → http://localhost:5500
Every module has the same shape, so the whole app stays small enough to hold in your head, and in a context window.
Login, sign-up, roles and permissions. Pick sessions or tokens and the code barely changes.
auth()->login([ 'email' => $email, 'password' => $password,]);// signed in with a session cookie
Fluent queries that read like sentences. MySQL, Postgres, SQLite and more.
$orders = db() ->select('orders') ->where('status', 'paid') ->orderBy('created_at', 'desc') ->limit(3) ->all();
One-off charges and subscriptions, with the checkout wired up for you.
$order = Order::find($id);billing()->charge($order);
Studio Nala · deposit
$20.00
Send receipts, resize images or sync data without making anyone wait.
Jobs move from queued, to running, to done while your app keeps responding.
25+ first-party modules plug in the day your product asks for them. Pick a few:
// leaf install auth dbapp()->get('/', function () { $user = auth()->user(); $orders = db()->select('orders')->all(); response()->json(['ok' => true]);});
Every project keeps a short map your agent reads first, so its code lands where you'd have put it.
# my-productmodules auth, db, billing, queue## conventionsroutes → app/routes/*.phpcontrollers → one per resource## recent+ OrdersController::store charges on create
[Benchmark source: Why Leaf 5]
Same backend, same agent map.
micro
Routing and a request object. Auth, db and billing become a package hunt and a weekend.
product-sized
Bigger than a router, smaller than your average framework. Starts with app() and grows with the product.
full-stack
Everything included, whether you use it or not. A lot to hold in mind before feature one.
“This is my first experience with PHP, I tried Leaf 5 out in the alpha with Claude code, and was genuinely impressed. I got my entire school project complete in a matter of minutes, especially the billing part.”
Selasi Bansa@sdotb · Leaf 5 alpha“Building with Leaf has been the most simple and straightforward approach to getting an app production ready”
“Leaf has been a great choice for us as it allows us to build our APIs really fast, giving us time to focus on what we want: the design and experience of our projects.”
Rare Goods Only@raregoodsonly“It gives the essentials to start building right away, with the flexibility to add exactly the features you need, precisely when you need them.”
“I just don't "get" the major frameworks and to me I want something simple which I can add to if needed and now I come across Leaf. Wow.”
“Clean, well organized and the MVC versión is just great!!!”
Leaf stays small, so it never pushes you toward the same app twice. Here are some of the products people run on it, plus templates you can start from today.
Run one command to start a project, then build it by hand, with your agent, or both.
“I just want things to work, and still make sense to me and my tools when I come back later.”