Skip to content

The easiest way to build a real web app, by hand or with AI

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.

Start building Read the docsor run leaf create my-app

What working in a Leaf project looks like

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.

Free, open source, and backed by the community

Sponsors keep Leaf moving: new modules, better docs, and people who answer your questions.

Become a sponsor →

One command. A working app.

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

Everything a product needs, nothing it doesn't

Every module has the same shape, so the whole app stays small enough to hold in your head, and in a context window.

Sign-in

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
ECSigned in as emma@example.comsession cookie set · expires in 7 days

Database

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();
idcustomertotalstatus
104Emma Carter$18.98paid
107Kenji Sato$9.49paid
112Sofia Rossi$26.97paid

Payments

One-off charges and subscriptions, with the checkout wired up for you.

$order = Order::find($id);billing()->charge($order);

Studio Nala · deposit

$20.00

Pay deposit

Background jobs

Send receipts, resize images or sync data without making anyone wait.

SendReceipt · order 104done
ResizePhotos · 12 imagesdone
SyncInventory · nightlydone

Jobs move from queued, to running, to done while your app keeps responding.

Start small. Add the rest when you need it.

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]);});

A map for your agent

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

Fast and light

Leaf[x ms]
[Framework A][x ms]
[Framework B][x ms]

[Benchmark source: Why Leaf 5]

Any frontend

Same backend, same agent map.

ReactVueSvelteBlade

micro

Micro-frameworks

Routing and a request object. Auth, db and billing become a package hunt and a weekend.

product-sized

Leaf

Bigger than a router, smaller than your average framework. Starts with app() and grows with the product.

full-stack

Full-stack frameworks

Everything included, whether you use it or not. A lot to hold in mind before feature one.

People are shipping real things with it

“Building with Leaf has been the most simple and straightforward approach to getting an app production ready”
Desmond Sofua@cr34t1ve
“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.”
Andrew MacLean@andrewdmaclean
“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.”
jamie-syon@jamie-syon
“Clean, well organized and the MVC versión is just great!!!”
Carlos Cárdenas@carlos_cardenas1
Join the Discord →Releases drop there first. Come show what you're shipping.

One team. A whole toolchain.

See every module →

Build whatever you want, by hand or with your agent.

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.

So, what are you building?

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.”
Michael Darko, creator of Leaf