Skip to content

Application Scaffolding Leaf MVC Only ​

Feature scaffolds

Generate the boring parts, then make the product yours.

Leaf MVC scaffolding creates complete feature starting points: routes, controllers, models, schema files, views, middleware, and frontend pieces that match your app setup.

scaffold
$ leaf scaffold:auth
$ leaf scaffold:landing-page
$ leaf scaffold:subscriptions
$ leaf scaffold:waitlist
$ leaf scaffold:blog
$ leaf scaffold:ai

What scaffolds give you

A real starting point

Not snippets. A working feature shape you can run, edit, and extend.

Your frontend setup

Views and components are generated around the frontend tooling your app uses.

AI-ready commands

Assistants can run the same commands and then tailor the result to your product.

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, and 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

Generated

models
controllers
routes
middleware
views

What you get

  • User model with a database schema file
  • Login, register, dashboard, and account update controllers
  • Authentication routes and route protection middleware
  • Views and dashboard screens tailored to your frontend setup

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

You get:

  • A structured homepage layout
  • Sections like hero, features, and footers
  • Tailwind styling with your preferred frontend setup
  • Easy customization with Leaf Zero components

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, and config.

Waitlists ​

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

bash
leaf scaffold:waitlist

These will give you:

  • Waitlist component for collecting emails in your frontend setup
  • Middleware to restrict accidental access to your app
  • Models and schema files for email collection
  • Waitlist invites and related 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

You get:

  • Markdown rendering (parsedown is installed for you)
  • Blog index and post pages in your frontend setup
  • Controllers and routes for listing and reading posts
  • A posts folder (app/blog) you publish to by dropping in markdown files with title, date, and description frontmatter

Contact form New ​

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

bash
leaf scaffold:contact

You get:

  • A contact page in your frontend setup
  • A controller that validates submissions and sends the message with Leaf Mail (installed and configured for you if missing)
  • Routes wired up and ready to restyle
  • CONTACT_EMAIL added to your .env as the delivery inbox, 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

You get privacy policy and terms of service pages in your frontend setup, wired to your APP_NAME and CONTACT_EMAIL env values. The 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

You get:

  • A chat interface in your frontend setup with streaming responses
  • Server routes that proxy to the Anthropic API
  • ANTHROPIC_API_KEY added to your .env / .env.example. 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