Next.js 15 · Supabase · Claude · Stripe + Apple

The easy way to ship your AI SaaS.

It already handles the parts nobody enjoys rebuilding: accounts and teams, Stripe and Apple billing, usage limits on the AI, and a matching iOS app. You start from a product that already works — the same code behind GamePlanLab, live on the App Store.

Web + iOS · one monorepo
100% TypeScript
Full source, yours to keep
assistant · /api/chat 7 / 10 credits
YouDraw up a 60-minute practice for a 10U team weak at fielding.
AIHere's a fielding-first block: 10m dynamic warmup, 20m rolled-grounder progression (short-hop → backhand), 15m situational cutoffs, 10m live BP, 5m cooldown. Want it saved to the team's plan?
This is the example AI feature in the kit. It checks the usage meter before each request, and refunds it if the model errors out.
It's not a demo. It's running a live app right now.

I pulled this out of GamePlanLab, a coaching app I built and put on the App Store. Real coaches pay for it through Stripe and Apple, and it writes practice plans with Claude. So the code you're buying isn't my idea of how you might build an AI SaaS. It's how I actually built one.

↗ See it live on the App Store
1Live App Store app
2Billing rails wired
14CI checks on push
What you don't have to build

The AI parts are the ones already done.

Most starter kits give you a login page and a Stripe button and leave the hard stuff to you. The things that usually eat your first few weeks on an AI product are the things that already work here.

01

Usage limits on the AI

Every AI call reserves a credit in the database before it runs, so two requests can't quietly go over the limit. If the model fails, the credit goes back.

02

Stripe and Apple billing

Web subscriptions through Stripe and in-app purchases through Apple, kept in sync so a coach who buys on their phone is the same paid account on the web.

03

A Claude client that won't fall over

It retries, backs off when the API is down, checks the model's output before trusting it, and limits how fast one user can hammer it. Point it at a different model with one setting.

04

A real iOS app

An Expo app with push notifications and Apple purchases. It lives in its own folder, so you can delete it for a web-only build or keep it and ship to the App Store.

05

Teams and seats built in

Organizations, members, roles, seat limits, and invites are already there. Paid features are gated by plan in one place.

06

The unglamorous ops work

Security and dependency scans run on every push, and there's a logger that keeps personal data out of your logs. The stuff you'd otherwise be wiring up at 1am.

What's inside

Have a look before you buy it.

Here's how the repo is laid out, and the piece I'm proudest of: the AI call that checks the usage meter first and gives the credit back if the model errors out.

ai-saas-starter/
ai-saas-starter/
├─ apps/web        Next.js 15 · App Router · API
├─ apps/mobile     Expo · push + StoreKit  ← detachable
├─ config/
│  ├─ brand.ts     every name/color/email from env
│  └─ tiers.json   one source → SQL enum + quota fn
├─ lib/
│  ├─ ai-quota.ts  consume/refund · atomic
│  ├─ anthropic.ts Claude · retry + breaker
│  ├─ apple-iap.ts JWS verify · ASN v2
│  └─ tier-guard.tsmiddleware gating · 30s cache
└─ .github/       CodeQL · secret scan · CI
app/api/chat/route.ts
// meter first — atomic, so concurrent calls can't overspend
const { allowed, remaining } = await consumeAIQuota(orgId, 1)
if (!allowed) return Errors.quotaExceeded()  // 402 + upsell

try {
  const plan = await claude.generate(prompt) // retry + breaker
  return Response.json({ plan, remaining })
} catch (err) {
  await refundAIQuota(orgId, 1)      // never bill a failure
  throw err
}
The app it came from

GamePlanLab

Built on this exact code

A coaching app that uses just about every part of the kit.

Coaches sign up on the web, pay through Stripe or buy it on their iPhone through Apple, and use it to write practice plans and scouting reports with Claude. It's the same code that's in this repo.

  • Web app + native iOS app from one monorepo
  • Stripe subscriptions with 30-day card-required trials
  • Apple StoreKit IAP, reconciled with the web subscription
  • Practice plans written by Claude, with per-team usage limits
  • Separate orgs, coach seats, and invitations
  • Account deletion and push notifications, the way Apple requires
Pricing

Buy it once, use it forever

One payment. Build as many of your own products on it as you want. No subscription, and no per-seat charges for your own team.

Founder price
Solo license
$249one-time
For you or your company. Build as many products as you like.
The full monorepo — apps/web + apps/mobile
Instant GitHub access to newberry-labs/ai-saas-starter
Stripe + Apple IAP billing, fully wired
Atomic AI quota system + hardened Claude client
A setup script that writes your env files for you
Deploy-to-Vercel button + SETUP / DEPLOY / STRIPE docs
Updates land in the repo; pull them whenever I ship one
Get instant access — $249
Secure checkout via Polar · Instant GitHub access · All sales final

Buying for a bigger team or an agency? Ask about team & agency licenses →

FAQ

Questions I get

Is this really production code?

Yes. I pulled it out of GamePlanLab, which is live on the App Store with people paying for it. It's not a tutorial repo. It's the real thing, with the baseball-specific parts taken out.

What's the license?

One purchase covers you or your company, and you can build as many of your own products on it as you want. The one thing you can't do is turn around and sell the kit itself.

Do I have to use the iOS app?

No. It's in its own folder (apps/mobile). Delete it if you only want the web app, or keep it and ship to the App Store.

Which AI provider?

Claude, out of the box. It sits behind a client you can point at a different model with one setting, and the usage-limit and parsing code doesn't care which model you use.

What do I need to run it?

Supabase, Stripe, and an Anthropic key. Redis and email are optional and do nothing until you add them. A setup script writes both env files for you.

How do updates work?

You get access to the repo, and when I push an update it's there for you to pull. I'm not promising a set release schedule, but improvements land in the same repo you already have.

What stack, exactly?

Next.js 15 (App Router) and TypeScript, Supabase (Postgres + Auth), Stripe and Apple StoreKit, Claude, Upstash Redis, Resend, and Expo SDK 54.

Refunds?

Because you get the full source the moment you buy, all sales are final. That said, if you can't get access or something's genuinely broken, email me and I'll make it right.

Get started

Start from a working app, not an empty folder.

Grab the code that already runs a live App Store product, and spend your time on the part that makes yours different.