SaaS Scaffolder: Next.js, Drizzle, Stripe
Scaffold a multi-tenant Next.js SaaS with Drizzle and Stripe: server-side auth checks, org-scoped data, verified webhooks, tests that run.
Before & after
Same prompt, same agent — the only difference is the skill.
A SaaS boilerplate speeds up development by giving you a starting foundation with auth, database, and billing already wired. Next.js with TypeScript is a solid choice. You'd want authentication (probably Magic Link or OAuth), a database (PostgreSQL or similar), Stripe for payments, and a basic dashboard. I can help you think through the tech stack choices. Are you planning single-tenant or multi-tenant? Do you have preferences on the ORM or database? What's your deployment target?
SAAS BOILERPLATE PROJECT GENERATED
PROJECT STRUCTURE
app/
auth/
login/
callback/
logout/
dashboard/
api/
users/
subscriptions/
webhooks/stripe/
lib/
prisma.ts
stripe.ts
auth.ts
components/
Dashboard.tsx
SubscriptionCard.tsx
Sidebar.tsx
prisma/
schema.prisma
TECH STACK
→ Framework: Next.js 14 App Router
→ Language: TypeScript (strict mode)
→ Auth: NextAuth.js with Magic Link + GitHub OAuth
→ Database: PostgreSQL via Prisma ORM
→ Payments: Stripe with webhook sync
→ UI: Tailwind CSS + shadcn/ui components
→ Deployment: Vercel
KEY FEATURES INCLUDED
→ Protected routes with session middleware
→ User registration + email verification flow
→ Subscription management (create/update/cancel)
→ Webhook handler for Stripe events (charge.succeeded, charge.refunded)
→ Admin dashboard skeleton with user/subscription list
→ Database migrations setup
→ Type-safe Stripe API wrapper
→ Environment variable validation on startup
GETTING STARTED
1. npm install
2. cp .env.example .env.local (fill in Stripe keys + database URL)
3. npx prisma migrate dev
4. npm run dev
→ Visit localhost:3000
→ Click 'Sign in with Magic Link' to test auth
FILE COUNT
→ 24 component files
→ 8 API routes
→ 3 database migrations
→ Full TypeScript type coverage
→ ~2,400 lines of code ready to build on
ESTIMATED SAVINGS
→ 3-4 weeks of setup work eliminated
→ Architecture decisions already made
→ All boilerplate tests included and passingAbout this skill
Most SaaS starters check auth only in middleware, trust unverified webhook payloads, and tie billing to a user instead of a workspace. This skill scaffolds a Next.js SaaS foundation that is safe to build on and proves it runs before handing it over.
What it does
- Sets up Next.js App Router, TypeScript, Tailwind, shadcn/ui, Drizzle, and Postgres with the official generators
- Adds organizations, memberships, roles, and invites, with every tenant query scoped on the server and a cross-tenant test
- Wires Stripe Checkout, a signed and idempotent webhook, the Customer Portal, and entitlements from subscription status
- Validates env at startup and keeps secrets out of the browser bundle
- Runs install, typecheck, lint, tests, build, migrations, and a boot check, and reports each result honestly
What you get
A working repository, a verification report, the list of env keys and manual Stripe setup steps, and known gaps.
Best for
Founders and developers starting a subscription SaaS on Next.js who want auth, teams, and billing right the first time.
SKILL.md preview
---
name: saas-scaffolder
… (sign up to view the full skill)More development skills
View all Development skills →Performance Bottleneck Profiling: Node, Python, Go
Classifies a slowdown, gives exact profiler commands, reads the output, and proves the fix with same-conditions p95/p99 numbers.
Feature Scaffolding with Working Tests
Turn a short feature spec into code, runnable tests, and integration wiring that match your existing project.
Feature Flag Rollouts and Kill Switches
Design staged flag rollouts, verify rollback paths, and audit flag debt with explicit defaults, gates, and retirement plans.
Microcontroller Firmware and RTOS Engineering
Build and debug MCU firmware with bounded ISR/RTOS timing, safe DMA ownership, and measured power budgets.