#launch#product

Introducing Tenviq

A Next.js boilerplate where billing actually controls your product — auth, Stripe, plan gating, and a polished admin in one repo you own.

Gabriel Nadon

Most "SaaS starters" give you auth and a pricing page, then leave the hard part — enforcing plans across your product — as an exercise for the reader. Tenviq takes the opposite approach. Plan gating is a first-class concern, wired from Stripe all the way into your server actions.

What's in the box

  • Auth: email/password, magic links, Google/GitHub OAuth, and 2FA (TOTP). All built on better-auth.
  • Billing: Stripe subscriptions with webhook-synced plan state, per-organization usage counters, and the Stripe customer portal.
  • Plan gating: typed capabilities and limits declared once, checked on the server with assertCapability and consumeMonthlyUsage.
  • Multi-tenant organizations: invitations, member roles, per-org billing and entitlements.
  • Admin panel: user management, impersonation, ban/unban, and role changes.
  • AI assistant: streaming chat with tool use, conversation history, and plan-gated access via the ai.assistant capability.

Why another starter?

Because the existing ones stop at "logged-in user can see a dashboard." That's the easy part. The hard part is answering: when a user's subscription lapses, which features stop working, and where in the code do I enforce that?

Tenviq answers that question with a single capability system used across the entire app. Capabilities and limits are declared once in config/billing.config.ts. Server actions call assertCapability(entitlements, "ai.assistant") or consumeMonthlyUsage({ limitKey: "tasksPerMonth", ... }). Everything reads from the same typed source of truth, so adding a capability makes TypeScript point at every callsite that needs updating.

Get started

Clone the repo, run pnpm install, then pnpm setup to walk through an interactive wizard for your env. Run pnpm db:migrate && pnpm db:seed && pnpm dev and you're in. You own the code — fork it, customize it, ship it.