Your next AI SaaS could start here
You have an idea. Maybe it's an AI tool for writing emails, summarizing documents, generating content, something people would actually pay for. So you open a new folder, run create-next-app, and start building.
Three days later, you still don't have a product. You have auth half working, a database schema you're not sure is right, a Stripe integration that keeps failing on webhooks, and zero lines of the actual AI feature that was the whole point.
This is where most AI SaaS ideas quietly die. Not because the idea was bad, but because the setup ate the momentum before the idea ever got tested.
I built a starter kit to close that gap: a free, open-source foundation with auth, database, AI streaming, and billing already wired together, so you're testing your actual product on day one instead of day fourteen.
What it actually is
This isn't a folder of separately installed libraries you still have to connect. It's a working Next.js app where auth talks to your database, your database talks to your billing, and a real AI feature is already running end to end. You get to see the whole thing work before you write a single line of your own code.
Stack: Next.js, TypeScript, Tailwind CSS
What's inside
Auth. Clerk. Sign up, login, and OAuth working out of the box. No custom session handling, no password hashing to get right.
Database. Supabase + Drizzle ORM. A PostgreSQL database via Supabase, with Drizzle ORM already configured for type-safe queries and migrations.
AI. Vercel AI SDK. Real streaming AI responses, using OpenAI or Gemini interchangeably through the @ai-sdk/openai and @ai-sdk/google providers. This isn't a placeholder. It powers a fully working AI email generator built into the kit, complete with history, regenerate, and copy, so you have a working AI feature to reference or extend from day one.
Billing. Stripe. Subscriptions, checkout sessions, and webhooks already connected, including the usage-limit logic (Free vs. Pro tiers) that most starter kits skip entirely.
Email. Resend. Transactional email, ready for welcome messages, notifications, or billing receipts.
Monitoring & Analytics. Sentry + PostHog. Errors get caught before users report them. Usage gets tracked from your very first signup.
Why usage limits matter more than people think
Most AI starter kits stop at calling the OpenAI API and streaming the response. That's the easy 80%. The part that actually takes time in a real AI product is the remaining 20%: metering usage per user, enforcing Free vs. Pro limits, and making sure a single user can't burn through your API budget in an afternoon.
That logic is already built in. Free and Pro tiers are wired into the AI email generator, so you have a working reference for how to gate your own AI feature instead of figuring it out from scratch after your first API bill.
Project structure
ai-saas-starter/
├── src/
│ ├── app/ # Next.js App Router pages
│ ├── components/ # UI components (Radix + custom)
│ ├── services/ # AI service, Stripe, email logic
│ └── db/ # Drizzle schema + queries
├── scripts/
│ ├── migrate.mjs
│ ├── apply-schema.mjs
│ └── test-db.mjs
├── drizzle.config.ts
└── package.jsonGetting started
Head over to the GitHub repo, grab the code, and fill in your .env with credentials from Clerk, Supabase, Stripe, Resend, and your AI provider of choice (OpenAI or Gemini). From there:
npm install
npm run db:push
npm run devYou'll have a running app with working auth, a live database, and a functioning AI feature, before you've written your own feature.
Who this is for
If you've got an AI SaaS idea and keep getting stuck rebuilding the same plumbing before you can test it, this is meant to remove that friction entirely. It's also a solid reference if you're newer to building with the Vercel AI SDK and want to see streaming, usage limits, and billing working together in a real example instead of a toy one.
Get it
Everything above, full source, setup instructions, and the working AI email generator, is in the repo:
github.com/tilakjain619/ai-saas-starter-kit
100% free and open source. If you build something on top of it, I'd genuinely like to see it. Tag me or drop it in the comments.
While you're there, give the repo a star and follow me on GitHub (@tilakjain619) so you don't miss the next one.