GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Leaf PHP
  • Docs
  • Blog
  • Contribute to Leaf
  • Generative AI policy
  • Team
  • FAQ
  • ๐Ÿงก SUPPORT LEAF
  • Alchemy โ€” QA + CI
  • Seedling โ€” console apps
  • Fetch โ€” HTTP client
  • Hana JS โ€” frontend
  • 25+ modules
  • Leaf CLI

This view

  • Original page
  • New address

GeezerVison is showing leafphp.dev โ€” Start simple. Ship fast. | Leaf PHP

Start simple. Ship fast. โ€‹

Some projects are just a few pages, a webhook, or a small API. Leaf is designed to let you start with the simplest structure that works and grow as the product needs it.

01

Install the CLI, create a project

$ composer global require leafs/cli
$ leaf create my-app
02

Run it

$ cd my-app && leaf serve
03

Your app is live athttp://localhost:5500

~30s

Need more structure? leaf create my-app --mvc gives you controllers, views and models up front. Everything else stays optional.

The smallest useful Leaf app โ€‹

A lite project starts with enough structure to handle real requests without putting a framework ceremony between you and the product.

php
<?php

require __DIR__ . '/vendor/autoload.php';

app()->get('/', fn () => response()->json([
  'message' => 'Hello from Leaf'
]));

app()->run();
1
2
3
4
5
6
7
8
9
01 / RouteMatch the requestConnect an HTTP method and URL to the behavior your application needs.
02 / LogicWrite the useful partWhen your route matches, implement the necessary logic to handle the request.
03 / ResponseReturn clean outputSend JSON, HTML, redirects, downloads, or any response the client expects.

Working with an AI assistant โ€‹

Leaf CLI creates a .leaf/CONTEXT.md file with context about your project. When using a coding assistant in your editor or terminal, ask it to read that file before making changes.

For example, if you tell your agent to implement a new messaging feature, it will automatically read the context from .leaf/CONTEXT.md and make changes that fit the existing project structure, and if your assistant cannot access the project folder, run:

bash
leaf context

Paste the output into your conversation along with your request. See AI in Leaf for more on project context.

Add capabilities when the product asks โ€‹

Leaf modules add focused features without replacing your starting point.

bash
leaf install auth db mail
01 / UsersAuthenticationLogin, registration, sessions, JWT, user records, and protected routes.Explore auth โ†’02 / DataDatabaseFluent queries, models, schema files, Redis, application state.Explore data โ†’03 / CommunicationMailSend transactional messages through a small API with provider flexibility.Explore mail โ†’

Once installed, modules use the same concise Leaf style:

php
auth()->login($credentials);

$user = db()
    ->select('users')
    ->where('email', $email)
    ->first();

mailer()
    ->to($user->email)
    ->send('welcome');
1
2
3
4
5
6
7
8
9
10

Grow at your own pace โ€‹

You do not need to predict the final architecture on day one. Choose the amount of structure the product needs now.

01 / LiteProve the ideaUse a small entry point for scripts, experiments, webhooks, APIs, and focused tools.
02 / ModulesAdd capabilitiesBring in authentication, data, mail, billing, queues, or caching as requirements appear.
03 / MVCOrganize the productMove into controllers, models, views, services, and conventions when the team or app needs them.

All three stages stay inside Leaf, so growth does not require a framework rewrite.

Deploy anywhere PHP runs โ€‹

Leaf has no private runtime or hosting lock-in. Deploy to a VPS, shared hosting, containers, or a managed PHP platform using the same application you built locally.

When structure becomes useful

The same project can grow into Leaf MVC.Keep the ecosystem, add the application map.
Continue to MVC โ†’

What to read next โ€‹

Choose the part of the stack your next feature needs.

01 / Request mapRoutingMethods, groups, dynamic routes, middleware, redirects, named routes.Open routing โ†’02 / InputRequestsRead input, validate payloads, process forms, files, headers, request data.Open requests โ†’03 / PersistenceDatabaseBuild queries, model records, define schemas, and manage application data.Open database โ†’04 / InterfaceFrontendUse Blade, BareUI, Inertia, Vite, Tailwind, React, Vue, or Svelte.Open frontend โ†’
You are visitor 01402503 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.