Skip to content

Build something real

Turn your idea into a real product

Leaf gives you everything you need to go from idea → working app → real users, with no lengthy configuration or assembly along the way.

bash
leaf create my-app --mvc
cd my-app
leaf serve

Instead of a blank folder, you get a product foundation from day one.

Start with a real app, not a blank page

Out of the box, you can build:

  • 🔐 User accounts (login, signup, sessions)
  • 🧑‍💼 Dashboards and admin panels
  • 🗄 Data-driven apps (with database + ORM)
  • 💳 Payments, subscriptions, billing
  • 🌐 APIs for mobile or frontend apps

There's no wiring tools together or figuring out what goes where.

Your app is ready for AI

Leaf MVC uses .leaf/CONTEXT.md as shared project memory for agents. An agent opened in the project reads that context alongside predictable routes, controllers, models, views, configuration, and modules, then syncs useful changes back. There is no AI setup step or context command required.

Tell AI what you want. It builds it

Open your agent in the project and tell it:

“Build a SaaS dashboard with teams and billing”

“Add Stripe subscriptions”

“Create an admin panel”

Leaf MVC gives the agent everything it needs to understand your app, so you can skip the long prompts and the guessing.

Using an external assistant without project access? Run leaf context and paste its compact output into the conversation.

Project Structure

For clarity and convention, Leaf organizes your app into a simple structure that follows the MVC pattern:

  • easy to navigate
  • easy for teams
  • easy for AI
bash
├───app
   ├── controllers
   ├── database
   ├── models
   ├── routes
   └── views
└───public

Ready for real users

Leaf apps are production ready and run anywhere PHP can, Heroku, Fly.io, DigitalOcean, or any shared hosting service.

Are you stuck? Working with MVC can be a bit challenging if you are just starting out because of the overly strict separation of concerns. If you are stuck at any point, feel free to ask for help in the Leaf Discord server, or consider building an MVP using the Basic Leaf setup. While it is not as structured as MVC, it is a great way to get started with Leaf.

Now that you have a product shipped, here's what you need to scale it:

  • Routing

    Learn more about routing in Leaf, dynamic routes, middleware and more.

  • Using Controllers

    Controllers are the 'C' in MVC, and separate your logic from your views.

  • Using Models

    Models are the 'M' in MVC, and let you interact with your database programmatically.

  • Frontend

    Learn about SSR, SPA, and how to use Leaf with your favorite frontend framework.