Getting Started with MantleKit
Everything you need to set up, configure, and deploy your MantleKit project — from installation to going live on Vercel.
Welcome to MantleKit! This guide walks you through setting up your project from scratch and deploying it live.
Prerequisites
- Node.js 18 or later
- A Supabase account (free tier works) — optional if using
database: false - A payment provider account (Stripe, Lemon Squeezy, or Polar)
- A Vercel account for deployment
Installation
Run the CLI with your licence key:
npx create-mantlekit --key MK-XXXX-XXXXThe CLI will guide you through:
- Project Name — the directory name for your project
- Theme Selection — choose from 5 production-ready themes
- Payment Provider — Stripe, Lemon Squeezy, or Polar
- Email Provider — Resend, Mailgun, or Brevo
- Feature Selection — based on your tier
Project Structure
MantleKit follows a standard Next.js App Router structure with a few additions:
app/
├── (marketing)/ # Landing pages, pricing
├── (blog)/ # Blog system
├── (app)/ # Authenticated app routes
├── (shop)/ # Ecommerce pages
├── (support)/ # FAQ and Knowledge Base
└── api/ # API routes
You can switch themes at any time by changing the theme value in mantle.config.ts.
Configuration
All configuration lives in mantle.config.ts at the project root:
const mantleConfig = {
theme: "minimal",
database: true,
features: {
blog: true,
ecommerce: false,
chatWidget: true,
supportPages: true,
},
};When database is set to false, auth and social features are automatically disabled. This is the configuration used for the Landing tier.
Environment Variables
Copy .env.example to .env.local and fill in your credentials:
cp .env.example .env.localAt minimum, you need:
- Supabase URL and Anon Key
- Your payment provider's API keys
- Your email provider's API key
Do not commit your .env.local file. Add environment variables through your hosting dashboard instead.
Authentication Setup
If you're using auth, finish the provider setup in Supabase before you test sign-in flows.
Google OAuth
Google sign-in needs one extra setup step outside Supabase:
- Create a Google OAuth app in Google Cloud Console
- Add your Supabase callback URL:
https://<your-project>.supabase.co/auth/v1/callback - Paste the Google Client ID and Client Secret into Supabase → Authentication → Providers → Google
GitHub OAuth
GitHub sign-in follows the same Supabase provider flow:
- Create a GitHub OAuth app in GitHub → Settings → Developer settings → OAuth Apps
- Set the callback URL to:
https://<your-project>.supabase.co/auth/v1/callback - Paste the GitHub Client ID and Client Secret into Supabase → Authentication → Sign In / Providers → GitHub
For the full step-by-step setup for Google OAuth and GitHub OAuth, see the Integrations guide.
Database Setup
Run the unified setup script in your Supabase SQL Editor to create all required tables:
- Go to your Supabase Dashboard → SQL Editor
- Open
supabase/setup.sqlfrom your project - Paste and run the entire script
This creates subscriptions, products, orders, webhook events, licence key, and blog social (comments, votes, likes) tables with RLS policies and seed data.
Run the Dev Server
npm run devVisit http://localhost:3000 to see your app running.
Deploying to Vercel
Connect Your Repository
- Go to vercel.com/new
- Import your Git repository
- Vercel will auto-detect Next.js settings — no custom build config needed
Add Environment Variables
In Vercel's project settings, add your environment variables:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-keyYou can copy these from your Supabase project's Settings → API page.
Custom Domain
After your first deploy:
- Go to your project's Settings → Domains
- Add your custom domain
- Update your DNS records as instructed by Vercel
Continuous Deployment
Every push to your main branch triggers a new deployment. Preview deployments are created automatically for pull requests.
Next Steps
- Customise your theme's CSS variables in
themes/<name>/theme.css - Add blog posts to the
content/directory - Configure your pricing plans in
mantle.config.ts - Set up webhook endpoints for your payment provider
- Check out the Integrations guide for provider setup details
Comments
Sign in to leave a comment.
No comments yet. Be the first!