Skip to content
FREE AND OPEN SOURCE

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.

$ leaf create my-app
leaf coremodulesyour appauthdbbillingqueue

Sponsored by

Leaf is free and open source. These teams help keep it that way.

Ask your coding agent for a feature

The files land where they belong and still read cleanly next month.

routes/_bookings.php
1<?php
2
3app()->get('/bookings', 'BookingsController@index');
4app()->post('/bookings', 'BookingsController@store');
BookingsController.php
1class BookingsController extends Controller
2{
3 public function store()
4 {
5 $data = request()->validate([
6 'service' => 'string',
7 'time' => 'string',
8 ]);
9
10 $booking = Booking::create($data);
11
12 return response()->json($booking);
13 }
14}

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.

Signed in as emma@example.comsession started

Database

Fluent queries that read like sentences. MySQL, Postgres, SQLite and more.

#customertotalstatus
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.

Studio Nala · deposit$20.00

Background jobs

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

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

Validation

Check what comes in with rules that read like plain English, and send back errors people can act on.

emma@examplemust be a valid email

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.

app/
  controllers/  BookingsController.php
  models/       Booking.php
  routes/       _bookings.php
Modules

Start small. Add the rest when you need it.

25+ first-party modules plug in the day your product asks for them.

All 25+ modules

What the agent touches

reads .leaf/CONTEXT.md
reads app/routes/*.php
writes app/routes/_webhooks.php
writes app/controllers/WebhooksController.php
syncs .leaf/CONTEXT.md
terminal
1leaf context
2
3// prints the app map for your assistant:
4// app type, modules, routes, models

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
  → http://localhost:5500

Same backend, any frontend

React, Vue, Svelte or Blade. Your agent reads the same map either way.

ReactVue
SvelteBlade

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.

Seev PlusSeev Plus
SkedaddleSkedaddle
FridayFriday
CraftlyCraftly
AlchemyAlchemy
Afro Asia MediaAfro Asia Media
Field Notes blog templateTemplateField Notes blog
Selll productsSelll products
Studio Nala bookings templateTemplateStudio Nala bookings
BitcartBitcart
KataKata
AgedStoneAgedStone
Surveyr submissionsSurveyr submissions
SelllSelll
Selll customersSelll customers

People are shipping real things with it

Releases drop in the Discord first. Come show what you're shipping.

810K+installs
1.3kGitHub stars
“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”
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
Shipped something with Leaf? Show us in the Discord

Get notes on Leaf 5, AI-native PHP, and product-building in your inbox. You can also read our blog posts at blog.leafphp.dev. You may also go social at Twitter, join our discussions, or watch our videos on YouTube.

So, what are you building?

Run one command to start a project, then build it by hand, with your agent, or both.