A battle-tested Next.js 15 boilerplate that ships with everything you need to launch a multi-tenant SaaS product:
- Authentication, organizations and SSO powered by Clerk
- Subscription & usage-based billing with Stripe
- SQL migrations & type-safe queries via Drizzle ORM
- Beautiful component library from shadcn/ui + Tailwind CSS
- End-to-end TypeScript, ESLint, Prettier & Rocket-fast pnpm workflow
Built so you can focus on your product, not plumbing.
- Clone & install
git clone https://github.com/your-org/microprojects.git cd microprojects pnpm install # or npm / yarn
- Configure environment – create a
.env.localfile and add your secrets:Required keys:# example NEXT_PUBLIC_APP_URL=http://localhost:3000 CLERK_SECRET_KEY=sk_test_... # ...see full list below
Key Notes NEXT_PUBLIC_APP_URLBase URL used in emails & OAuth callbacks Clerk NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYCLERK_SECRET_KEYStripe NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYSTRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRETsee billing setup guide - Run locally
Link is printed (default http://localhost:3000).
pnpm dev
That's it – you now have auth, org switcher, billing pages and a dashboard running locally.
| Layer | Package(s) | What it gives you |
|---|---|---|
| UI | Next.js 15 / App Router, shadcn/ui, Tailwind CSS | SSR/ISR, React Server Components, accessible components |
| Auth | Clerk | Passwordless, social login, multi-org, JWTs |
| Billing | Stripe, Usage metering helpers | Checkout, customer portal, metered usage limits |
| Data | Drizzle ORM + SQL (vendor-agnostic) | Type-safe queries & migrations |
| Tooling | TypeScript, ESLint, Prettier, pnpm | Fast DX & code quality |
src/
app/ ← Next.js routes (pages & API)
components/ ← Re-usable UI & feature components
lib/ ← Server helpers (billing, db, utils …)
db/ ← Drizzle schema + index
middleware.ts ← Auth & rate-limiting middleware
config/
billing-plans.yml ← Declarative plan definitions
scripts/ ← One-off utility scripts (Stripe setup, code-gen …)
docs/ ← Comprehensive documentation
| Task | Command |
|---|---|
| Start dev server | pnpm dev |
| Lint & type-check | pnpm lint / pnpm typecheck |
| Run Drizzle migrations | pnpm db:migrate |
| Create a DB snapshot | pnpm db:snapshot |
| Generate billing plan types | pnpm generate-plans |
| Set up Stripe products | pnpm setup:stripe |
| Format code | pnpm format |
See
package.json→scriptsfor the full list.
Plans are defined declaratively in config/billing-plans.yml. The Stripe setup script (pnpm setup:stripe) reads that file and creates/updates products & prices with the correct metadata. Webhook handlers under src/app/api/webhooks/stripe/* keep the local subscription table in sync.
• Complete billing documentation - Setup, configuration, and API reference • Quick start guide - Get billing running in 5 minutes • Database schema - Required tables and setup
| Topic | Location |
|---|---|
| Billing System | docs/billing/ |
| API Reference | docs/billing/2_billing_guard.md |
| Development Guidelines | CLAUDE.md |
The template is designed for Vercel, but any Node 18+ platform will work. Make sure to set the same environment variables in production and point Stripe webhooks at the /api/webhooks/stripe route.
For detailed deployment instructions, see the billing setup guide.
Bug reports, suggestions and PRs are very welcome! Please follow the existing code patterns and ensure your changes pass linting and type checking.
Add your license of choice here.