Next.js SaaS template for flat monthly or yearly subscriptions with boolean feature flags. Two plans (Pro and Max) with checkout, customer portal, and per-plan feature access checks.
No metered or seat-based billing — the starting point when your product sells plans, not usage.
Stack: Next.js 16, Better Auth, Drizzle ORM, PostgreSQL, Commet SDK
Quick Start
commet create my-app -t fixed
cd my-app
pnpm install
pnpm devWhat's Included
Two plans with monthly and yearly prices
Five boolean features with per-plan access control
Checkout flow with plan selection
Customer billing portal (manage subscription, invoices)
Auth with automatic customer creation on signup
Feature flag checks on the dashboard
Pricing page with plan comparison
Key Files
lib/auth/auth.ts— Better Auth + Commet plugin (portal, subscriptions, features)lib/payments/commet.ts— Checkout session creation and subscription checksapp/pricing/page.tsx— Dynamic pricing page from Commet plans APIapp/(dashboard)/dashboard/page.tsx— Feature access dashboardapp/api/commet/portal/route.ts— Customer portal redirect
Learn More
Run commet create my-app -t fixed to start from this template, or browse the source on GitHub.
