Skip to content

Application Scaffolding Leaf MVC Only โ€‹

Leaf MVC scaffolding creates complete feature starting points: routes, controllers, models, schema files, views, and middleware that match your app setup. You run a command, then edit real files you own.

Commands
$ leaf scaffold:auth
$ leaf scaffold:blog
$ leaf scaffold:landing-page
$ leaf scaffold:waitlist
$ leaf scaffold:contact
$ leaf scaffold:mail
$ leaf scaffold:legal
$ leaf scaffold:ai
$ leaf scaffold:shadcn
$ leaf scaffold:subscriptions with leafs/billing
scaffold:auth generates
app/routes/_auth.php
app/controllers/Auth/ login, register, dashboard
app/controllers/Profile/ account, updates
app/views/pages/auth/ login, register
app/views/pages/dashboard
app/views/layouts + components
views match your setup: blade, react, vue, svelte, or api-only

How scaffolding works โ€‹

Scaffolds are meant to remove repetitive setup, not hide your code. You run a command, Leaf creates the feature files, and you keep full ownership of what was generated.

01 / ServerBackend filesControllers, routes, models, middleware, schema files, callbacks, service logic.
02 / InterfaceFrontend piecesViews, pages, components, forms, dashboard screens, and layout starting points.
03 / StructureApp conventionsGenerated files land where Leaf MVC expects them, so the project stays predictable.
04 / ContextAI contextAgents inspect the generated feature and sync its new structure into Leaf's shared project context.

If you are using Claude, Codex, or another assistant, you can ask it to scaffold a feature and then customize the generated files around your product requirements.

Every feature scaffold ships in Blade, React, Vue, and Svelte variants. Leaf detects which one to use from your app's Inertia setup, so scaffolding in a React app generates React pages without any extra flags. To pick a variant yourself, pass --scaffold react, --scaffold vue, --scaffold svelte, or --scaffold default for Blade.

Authentication โ€‹

Authentication with Leaf is powered by Leaf Auth, which gives you login, registration, sessions, password hashing, user management, and route protection.

bash
leaf scaffold:auth
01 / AccountsBackendUser model with its schema file, controllers for login, register, dashboard and account updates, and auth routes with protection middleware applied.
02 / ScreensFrontendLogin, register, dashboard and profile views in your frontend setup. The full file list is in the panel at the top of this page.

This is automatically done for you if you choose to install the application starter during installation.

Landing Page โ€‹

Use the landing page scaffold when you want a polished starting point for your product homepage.

bash
leaf scaffold:landing-page
01 / PageHomepageA structured homepage layout with hero, feature and footer sections, styled with Tailwind in your frontend setup.
02 / CustomizeLeaf Zero componentsSections are built from Leaf Zero components, so they are easy to restyle and rearrange.

Billing Subscription โ€‹

Subscriptions are common in modern products, but the setup usually involves pricing UI, callbacks, webhooks, database state, and provider configuration. Leaf MVC can scaffold the shape for you.

bash
leaf scaffold:subscriptions

It requires Leaf Billing to be installed.

01 / Customer UIFrontendPricing component and subscription UI in whatever frontend setup you are using.
02 / Billing logicBackendSubscription controllers, cancellation flow, Stripe callbacks, routes, models, schema, config.

Waitlists โ€‹

Waitlists help you validate demand and collect emails before a product is fully open.

bash
leaf scaffold:waitlist
01 / CollectionFrontendA waitlist component for collecting emails in your frontend setup.
02 / ControlBackendModels and schema files for email collection, middleware that restricts accidental access to your app, and waitlist invites as starting points.

Blog New โ€‹

The blog scaffold gives you a markdown-powered blog: write posts as markdown files and Leaf renders them with your frontend setup.

bash
leaf scaffold:blog
01 / WritingMarkdown postsA posts folder (app/blog) you publish to by dropping in markdown files with title, date and description frontmatter. Parsedown is installed for you.
02 / ReadingFrontendBlog index and post pages in your frontend setup, with controllers and routes for listing and reading posts.

Contact form New โ€‹

A contact form that actually sends mail, wired end to end.

bash
leaf scaffold:contact
01 / FormFrontendA contact page in your frontend setup, with routes wired up and ready to restyle.
02 / DeliveryLeaf MailA controller that validates submissions and sends the message with Leaf Mail, installed and configured for you if missing. CONTACT_EMAIL lands in your .env, with MAIL_SENDER_EMAIL as the fallback.

Every product eventually needs them, and nobody enjoys writing them from a blank file.

bash
leaf scaffold:legal
01 / PagesFrontendPrivacy policy and terms of service pages in your frontend setup, wired to your APP_NAME and CONTACT_EMAIL env values.
02 / EditingYour partThe copy has clearly marked EDIT ME sections, so you (or your lawyer) only fill in the product-specific parts.

AI chat New โ€‹

Scaffold a streaming AI chat powered by Claude: a full chat page with streamed responses, not just an API call.

bash
leaf scaffold:ai
01 / Chat UIFrontendA chat interface in your frontend setup with streaming responses.
02 / ServerAnthropic proxyRoutes that proxy to the Anthropic API. ANTHROPIC_API_KEY is added to your .env; drop your key in and visit /ai.

Mail setup โ€‹

Not a feature scaffold, but a shortcut: installs Leaf Mail and generates your mail config in one step.

bash
leaf scaffold:mail

shadcn/ui New โ€‹

If you're pairing React with your Leaf app, this sets up shadcn/ui so you can install any of its components:

bash
leaf scaffold:shadcn
bash
pnpm dlx shadcn@latest add switch

AI-assisted scaffolding โ€‹

Scaffolding pairs naturally with AI because the command gives your assistant a working feature shape to edit instead of asking it to invent every file from scratch.

txt
Ask your assistant:
"Scaffold auth, then customize the dashboard for a SaaS admin."

Recommended workflow:

  1. Run or ask your assistant to run the scaffold command.
  2. Ask for the product-specific changes.
  3. Review the generated routes, controllers, models, and views.

If the assistant cannot access the project folder, run leaf context after scaffolding and paste the compact output into your conversation.

More coming soon โ€‹

We are working on scaffolding for more features like:

  • Admin panel
  • API dashboard
  • More product starters