Application Scaffolding Leaf MVC Only β
Feature scaffolds
Leaf MVC scaffolding creates complete feature starting points: routes, controllers, models, schema files, views, middleware, and frontend pieces that match your app setup.
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.
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.
leaf scaffold:authGenerated
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.
leaf scaffold:landing-pageYou 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.
leaf scaffold:subscriptionsIt requires Leaf Billing to be installed.
Waitlists β
Waitlists help you validate demand and collect emails before a product is fully open.
leaf scaffold:waitlistThese 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.
leaf scaffold:blogYou 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 withtitle,date, anddescriptionfrontmatter
Contact form New β
A contact form that actually sends mail, wired end to end.
leaf scaffold:contactYou 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_EMAILadded to your.envas the delivery inbox, withMAIL_SENDER_EMAILas the fallback
Legal pages New β
Every product eventually needs them, and nobody enjoys writing them from a blank file.
leaf scaffold:legalYou 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.
leaf scaffold:aiYou get:
- A chat interface in your frontend setup with streaming responses
- Server routes that proxy to the Anthropic API
ANTHROPIC_API_KEYadded 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.
leaf scaffold:mailshadcn/ui New β
If you're pairing React with your Leaf app, this sets up shadcn/ui so you can install any of its components:
leaf scaffold:shadcnpnpm dlx shadcn@latest add switchAI-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.
Ask your assistant:
"Scaffold auth, then customize the dashboard for a SaaS admin."Recommended workflow:
- Run or ask your assistant to run the scaffold command.
- Ask for the product-specific changes.
- 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
