Next.jsReactSaaS启动器

ai-saas-starter — Next.js SaaS模板

作者 nikandr-surkov

基于 Next.js 的 AI SaaS 启动模板,集成 Better Auth 认证、Stripe 订阅、积分账本与 AI 图像生成,并提供面向编码代理的上下文文件。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

2 个预览视图
桌面端首页1 / 2
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 2

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-01查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

集成 Better Auth,支持邮箱密码、Google、GitHub 和魔法链接登录,会话存储在 PostgreSQL

02

Stripe 订阅与一次性充值,webhook 验证原始请求签名,订阅状态由单一同步函数写入

03

只追加的积分账本,使用唯一幂等键,数据库拒绝负余额和零金额行,消费通过条件 UPDATE 防止并发超支

04

AI 图像生成流程包含限流、扣积分、失败自动退款,并支持通过环境变量切换模型

05

提供 AGENTS.md、路径作用域规则、技能与钩子等文件,方便 Claude Code、Cursor 等编码代理在受约束下扩展项目

06

包含 Vitest 单元/集成测试与 Playwright 端到端测试,覆盖账本行为、webhook 签名和双花竞争等场景

模板详细介绍

这是一个面向 Next.js 的 AI SaaS 启动模板,代码以 MIT 许可公开在 GitHub 上,演示站点可注册并实际运行。模板把认证、Stripe 订阅、积分账本和 AI 图像生成等常见付费路径预先实现,让开发者在此基础上构建自己的产品。

认证部分支持邮箱密码(含验证)、Google、GitHub 和魔法链接,会话存储在 PostgreSQL 中;设置页提供修改密码、关联账号以及级联安全的账号删除(会先取消 Stripe 订阅)。计费部分使用 Stripe Checkout 与 Customer Portal 作为服务端操作,通过签名验证的 webhook 触发,订阅状态只由一个同步函数写入,套餐、价格和积分数量集中在单一配置文件中。

积分系统采用只追加的 credit_transactions 表,配合唯一幂等键:发票支付时发放积分、结账时充值、消费通过条件 UPDATE 防止并发超支、退款以补偿行记录,数据库层面拒绝负余额和零金额行。AI 生成流程为提示词 → 限流(每分钟 10 次)→ 扣除 1 积分 → 调用 AI SDK 生成图像 → 存储(开发环境为本地目录)→ 历史网格展示;生成失败会自动退还积分。

模板还包含一套面向 AI 编码代理的上下文文件,如 AGENTS.md、路径作用域规则、技能与钩子,用于约束代理在修改计费、数据库等敏感代码时的行为。测试方面提供 Vitest 单元/集成测试和 Playwright 端到端测试,覆盖积分账本、webhook 签名验证、双花竞争等场景。

使用限制:模板依赖外部服务(Stripe、Resend、AI 提供商、PostgreSQL 等),这些服务可能产生费用;演示图片、字体、图标等第三方素材需单独核对许可;项目资料提及可选付费版本,本次收录的仅为公开免费代码。

Next.jsSaaS启动器

适合你的项目吗?

适用场景

  • 快速搭建带订阅计费和积分消耗的 AI 图像生成类 SaaS 产品原型
  • 在已有 Next.js 项目中参考其积分账本与 Stripe webhook 的幂等处理方式
  • 为编码代理准备一个带有明确安全边界和路径规则的 AI 原生代码库
  • 学习如何用只追加账本和数据库约束防止积分超支与重复发放

适合人群

  • 熟悉 Next.js、TypeScript 和 PostgreSQL,希望跳过认证与支付基础搭建的开发者
  • 需要积分或额度系统并关注并发安全与幂等性的 SaaS 项目
  • 使用 Claude Code、Cursor 等编码代理辅助开发,并希望代理遵循项目规则的团队
  • 想参考 Stripe 订阅、webhook 验证和退款路径实现方式的学习者

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    需要 Node.js 环境与 pnpm,克隆仓库后执行 pnpm install

  2. 2

    使用 docker compose 启动 PostgreSQL 17,复制 .env.example 为 .env 并生成 BETTER_AUTH_SECRET

  3. 3

    执行 pnpm db:migrate 迁移数据库,然后 pnpm dev 启动开发服务器

  4. 4

    未配置 Stripe、Resend 或 OAuth 密钥时功能会降级:计费页显示设置卡片、邮件静默、OAuth 按钮隐藏;设置 AI_MOCK=true 可离线免费生成图像

  5. 5

    本地测试 Stripe 需创建测试模式价格、运行 pnpm stripe:listen 并将 whsec 密钥写入 .env

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 使用 Stripe 计费需自行在 Stripe 后台创建测试模式价格(Pro 9 美元/月、Ultra 29 美元/月、一次性充值 5 美元),并将 price ID 写入环境变量;Stripe 为外部付费服务。
  • 生产环境真实图像生成需配置 AI Gateway 的 API 密钥;该密钥额度为消费上限而非余额,免费额度不足时需为网关账户充值或自带提供商密钥。
  • 发送邮件需配置 Resend API 密钥并使用已验证的域名,Resend 为外部服务,可能产生费用。
  • 生产部署需在 Vercel 创建 Blob 存储并设为公开访问,属于外部托管服务,可能产生费用。
  • 生产部署需使用 Neon 等外部 PostgreSQL 服务,需自行创建项目并提供连接字符串,可能产生费用。
  • 法律页面(隐私政策、服务条款等)仅为占位内容,上线前需自行替换为合规文本。
  • 团队、国际化、管理后台、异步任务流水线、视频/音频生成、R2 存储、MCP 服务器等能力仅在付费 Pro 版本提供,免费仓库不包含。
  • AI_MOCK 模拟模式在生产构建中被拒绝,生产环境必须接入真实 AI 提供商并承担相应调用费用。
  • 项目资料提及可选付费版本或功能;本次仅收录公开免费代码,不包含付费升级。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

Create three test-mode prices (Pro $9/mo, Ultra $29/mo, Top-up $5 one-time)

README 原文

AI_GATEWAY_API_KEY`, `AI_IMAGE_MODEL` | AI Gateway; `AI_MOCK` stays UNSET

README 原文

RESEND_API_KEY`, `EMAIL_FROM` | verified Resend domain

README 原文

Blob store** — in the Vercel project: Storage → Create → Blob, with **Access: Public**

README 原文

Neon** — create a project and copy BOTH connection strings

README 原文

The legal pages are placeholders and the product on top is yours to build.

README 原文

The paid kits are broader (teams, i18n, admin); the Pro version covers that ground.

README 原文

`AI_MOCK=true` is refused in production builds

README 原文
https://github.com/nikandr-surkov/ai-saas-starter/blob/main/LICENSEhttps://github.com/nikandr-surkov/ai-saas-starter/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-01。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 92 / 100
技术栈
Next.js · React
网站类型
SaaS · 启动器
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-07-26
截图检查日期
2026-10-01

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。

查看当时使用的来源资料

SHA-256: 73d84b7085d6cace2b741127440e112abc5bd3997a4f185c959045e246766dc8

2026-10-01T01:24:29.685Z

来源文件 / 仓库
# ai-saas-starter

The free, open-source AI SaaS boilerplate and starter kit for Next.js 16.

Auth, Stripe subscriptions, an append-only credits ledger, and AI image
generation — built as an AI-native repo that Claude Code, Cursor, and
Codex can extend without breaking the money paths.

[![CI](https://github.com/nikandr-surkov/ai-saas-starter/actions/workflows/ci.yml/badge.svg)](https://github.com/nikandr-surkov/ai-saas-starter/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-1f7a4d.svg)](LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/nikandr-surkov/ai-saas-starter)](https://github.com/nikandr-surkov/ai-saas-starter/stargazers)

[Live demo](https://ai-saas-starter-six.vercel.app) ·
[Deploy guide](#deploy-to-production-vercel--neon) ·
[Pro version](https://nikandr.com)

![Landing page of ai-saas-starter — free open-source Next.js SaaS boilerplate with auth, Stripe, and a credits ledger](docs/screenshots/landing.jpg)

## What is this?

- **This website is the demo** — [sign up](https://ai-saas-starter-six.vercel.app),
  everything works.
- **The code is a free GitHub repo** — MIT, clone it.
- **You build YOUR product on top** — auth and payments are done.

A free, open-source SaaS boilerplate / starter kit for **Next.js 16 ·
React 19 · TypeScript strict · Better Auth · Drizzle + PostgreSQL ·
Stripe · AI SDK 6 · Tailwind v4 + shadcn/ui · Resend · Vitest +
Playwright**.

## See it

|                                                                                                                                   |                                                                                                            |
| --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| ![Credits ledger dashboard of the Next.js SaaS starter — every transaction is an append-only row](docs/screenshots/dashboard.jpg) | ![AI image generation page with credit balance — 1 credit per image](docs/screenshots/generate.jpg)        |
| [Credits ledger on the dashboard — balance is SUM(amount), enforced](#whats-inside)                                               | [AI image generation — 1 credit per image](#whats-inside)                                                  |
| ![Generation in progress — busy state with the spinning sparkle indicator](docs/screenshots/generating.jpg)                       | ![Billing page with plan cards rendered from one config file](docs/screenshots/billing.jpg)                |
| [Busy state](#whats-inside)                                                                                                       | [Plans from one config file](#whats-inside)                                                                |
| ![Stripe Checkout in test mode for the Pro subscription](docs/screenshots/checkout.jpg)                                           | ![Account settings — profile, password, connected accounts, delete account](docs/screenshots/settings.jpg) |
| [Real Stripe checkout (test mode)](#stripe-locally)                                                                               | [Auth + account settings](#whats-inside)                                                                   |

## Why another SaaS boilerplate?

AI assistants are good at building product features and bad at the 20% that
loses money when improvised: webhook retries, concurrent spends, refund
paths, idempotency. This repo ships that 20% finished and tested — an
append-only credit ledger whose balance is enforced equal to
`SUM(amount)`, Stripe webhooks that verify raw-body signatures and survive
replays, a double-spend race test against real Postgres — plus the context
files (AGENTS.md, rules, skills, hooks) that keep an agent from quietly
unpicking any of it while you vibe-code the product on top.

## Quickstart (60 seconds)

```bash
git clone https://github.com/nikandr-surkov/ai-saas-starter.git my-app
cd my-app
pnpm install
docker compose up -d        # Postgres 17
cp .env.example .env        # fill in BETTER_AUTH_SECRET (openssl rand -base64 32)
pnpm db:migrate
pnpm dev
```

That boots with graceful degradation: no Stripe keys → billing page shows a
setup card; no Resend key → emails no-op with a console warning; no OAuth
keys → those buttons hide; `AI_MOCK=true` → image generation is free and
offline. Every variable is documented in [.env.example](.env.example).

## Quickstart for AI agents

Paste this into your coding agent:

```text
Clone https://github.com/nikandr-surkov/ai-saas-starter.git and get it
running: install deps, start Postgres via docker compose, create .env
from the example (generate the secret), migrate, run dev. Then read
AGENTS.md and brief me on the rules you're operating under.
```

Works with Claude Code, Cursor, Codex, Copilot, and Gemini CLI. The repo
briefs the agent itself — AGENTS.md, path-scoped rules, skills, hooks.

## What's inside

- **Auth** — email/password with verification, Google, GitHub, magic links.
  Sessions live in your Postgres. Settings page with password change,
  account linking, and cascade-safe account deletion (cancels the Stripe
  subscription first).

  ![Account settings page — auth, password change, connected accounts, danger zone](docs/screenshots/settings.jpg)

- **Billing** — Stripe Checkout + Customer Portal as server actions, a
  signature-verified webhook, and one sync function as the only writer of
  subscription state. Plans, prices, and credit amounts live in
  [src/config/plans.ts](src/config/plans.ts) and nowhere else.

  ![Billing plan cards and pricing — both rendered from src/config/plans.ts](docs/screenshots/billing.jpg)
  ![Pricing page of the SaaS starter — plans read from one config file](docs/screenshots/pricing.jpg)

- **Credits ledger** — append-only `credit_transactions` with UNIQUE
  idempotency keys. Grants on `invoice.paid` (`grant_{invoiceId}`), top-ups
  on checkout (`topup_{sessionId}`), spends as one conditional UPDATE (the
  race guard), refunds as compensating rows. The database itself refuses
  negative balances and zero-amount rows.
- **AI generation** — prompt → rate limit (10/min) → spend 1 credit →
  AI SDK 6 `generateImage` → store (Vercel Blob, or `./.generated` in dev)
  → history grid. Provider failure refunds automatically. Swap models via
  `AI_IMAGE_MODEL=provider/model`; add providers by implementing one
  interface ([src/lib/ai/provider.ts](src/lib/ai/provider.ts)).
- **Design system** — "The Ledger, LOUD MODE": tokens and hard rules in
  [DESIGN.md](DESIGN.md), light and dark, generated illustrations, an
  interaction grammar with press physics. `/styleguide` (dev only) shows
  every primitive in both themes.

## The AI-native part

This repo assumes an agent will extend it, and briefs the agent accordingly:

| File                              | What it does for the agent                                                                                                                                                   |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AGENTS.md](AGENTS.md)            | The operating manual: commands, conventions, safety boundaries (NEVER / ASK FIRST), gotchas, definition of done. Works with Claude Code, Cursor, Codex, Copilot, Gemini CLI. |
| [CLAUDE.md](CLAUDE.md)            | Imports AGENTS.md, adds plan-mode policy for money code and skill pointers.                                                                                                  |
| [DESIGN.md](DESIGN.md)            | Tokens plus hard rules, so generated UI stays on-brand.                                                                                                                      |
| `.claude/rules/`                  | Path-scoped invariants that load only when billing, database, or design files are touched.                                                                                   |
| `.claude/skills/`                 | `/add-feature`, `/add-ai-provider`, `/db-migration` — the common jobs, scripted the repo's way.                                                                              |
| `.claude/hooks/`                  | Prettier after every edit; a Stop hook that blocks "done" until `tsc --noEmit` passes.                                                                                       |
| `.claude/agents/code-reviewer.md` | A read-only reviewer for auth/billing/ledger diffs. It found real money bugs during this repo's own build.                                                                   |
| `specs/TEMPLATE.md`               | Spec-first workflow — copy it, fill it, hand it to the agent. A filled example is included.                                                                                  |

With Claude Code: open the repo and the context loads itself; type
`/add-feature` to scaffold the repo way. With Cursor: `.cursor/rules/`
mirrors the same invariants. Everything defers to AGENTS.md, so there is
one source of truth to edit. Agent-assisted contributions are welcome —
run the repo's own gates and the code-reviewer agent before opening a PR
(see [CONTRIBUTING.md](CONTRIBUTING.md)).

## Architecture in one paragraph

Server Components by default; Server Actions for mutations; API routes only
for the Stripe webhook and the Better Auth handler. Zod validates every
boundary — forms, webhook payloads, and env
([src/lib/env.ts](src/lib/env.ts), the only place `process.env` is read).
Money is integer cents, credits are integers, and two modules own the
dangerous writes: [src/lib/credits/](src/lib/credits/) is the only code
that touches credit tables, and `syncStripeDataToDb` in
[src/lib/billing/sync.ts](src/lib/billing/sync.ts) is the only writer of
subscription state — webhooks are triggers, never sources of truth.

## Testing

```bash
pnpm test        # Vitest — needs Postgres: docker compose up -d
pnpm test:e2e    # Playwright — boots its own dev server on :3100
```

94 unit/integration tests: the full ledger behavioral suite against real
Postgres (double-spend race, exact-boundary spends, idempotent replays,
refunds, key-collision detection, invariant checks, DB CHECK probes),
webhook signature verification with real HMAC fixtures, sync derivation,
plans-config locks, env validation, email rendering. 12 e2e tests: signup
to dashboard, mock generation, the FAIL-refund path, the 0-credit block,
open-redirect guards, image-route authorization, billing plan cards from
the plans config.

The spend→refund loop is user-visible, not just tested: a failed
generation refunds its credit automatically and says so on the tile.

![AI generation history with a failed tile — failure refunds automatically, pinned by tests](docs/screenshots/generate.jpg)

e2e runs against `next dev` deliberately — `AI_MOCK=true` is refused in
production builds, so a build+start e2e would hit a real provider. The
comment in [playwright.config.ts](playwright.config.ts) explains.

## Stripe, locally

1. Create three test-mode prices (Pro $9/mo, Ultra $29/mo, Top-up $5
   one-time) in the [Stripe dashboard](https://dashboard.stripe.com/test/products)
   or via the API, and put the `price_...` IDs in `.env`.
2. `pnpm stripe:listen` (Stripe CLI) — copy the printed `whsec_...` into
   `.env`, restart `pnpm dev`.
3. Subscribe with card `4242 4242 4242 4242` → the webhook grants the
   plan's credits, keyed by invoice ID. Resend the event from the Stripe
   dashboard — the ledger's unique key makes the replay a no-op.
4. Renewals and cancellations can't wait a month: use
   [test clocks](https://docs.stripe.com/billing/testing/test-clocks) to
   advance time. Portal cancellations set `cancel_at` (not the legacy
   boolean) — the sync handles both; don't "simplify" it.

![Stripe Checkout test-mode payment page for the Pro plan subscription](docs/screenshots/checkout.jpg)

## Deploy to production (Vercel + Neon)

The order matters — follow it top to bottom.

1. **Neon** — create a project and copy BOTH connection strings: the
   **pooled** one (contains `-pooler`, for the running app) and the
   **direct** one (for migrations).
2. **Vercel** — import the GitHub repo. Don't deploy yet.
3. **Blob store** — in the Vercel project: Storage → Create → Blob, with
   **Access: Public**, and **tick "Add a read-write token env var"** — the
   default flow skips it and leaves `BLOB_READ_WRITE_TOKEN` unset, which
   silently sends generated images to the (nonexistent) local fallback.
4. **Environment variables** — everything from `.env.example`:

   | Variable                               | Value                                     |
   | -------------------------------------- | ----------------------------------------- |
   | `DATABASE_URL`                         | the **pooled** Neon URL (runtime traffic) |
   | `BETTER_AUTH_SECRET`                   | `openssl rand -base64 32`                 |
   | `BETTER_AUTH_URL`                      | the exact deployed URL — see step 9       |
   | `STRIPE_SECRET_KEY` + 3 price IDs      | from your Stripe dashboard                |
   | `STRIPE_WEBHOOK_SECRET`                | placeholder for now — replaced in step 7  |
   | `AI_GATEWAY_API_KEY`, `AI_IMAGE_MODEL` | AI Gateway; `AI_MOCK` stays UNSET         |
   | `RESEND_API_KEY`, `EMAIL_FROM`         | verified Resend domain                    |
   | `BLOB_READ_WRITE_TOKEN`                | added by step 3's checkbox                |

5. **Deploy** and note the real production domain Vercel assigns — it may
   suffix the project name (e.g. `-six`).
6. **Migrate once**, locally, with the **direct** URL (the pooler rejects
   some DDL): `DATABASE_URL="<direct Neon URL>" pnpm db:migrate`
7. **Stripe webhook** — create the endpoint for the REAL deployed domain:
   `https://<real-domain>/api/stripe/webhook`, events `invoice.paid`,
   `checkout.session.completed`, `customer.subscription.updated`,
   `customer.subscription.deleted` — then copy its `whsec_...` into the
   Vercel env, replacing the placeholder.
8. **Redeploy** — env changes never apply to a running deployment.
9. **Pin the domain** — set `BETTER_AUTH_URL` (env) and `siteConfig.url`
   ([src/config/site.ts](src/config/site.ts)) to the exact production URL
   from step 5, push, and redeploy if either changed.

### Common deploy errors

| Error                                              | Cause                                                                                              | Fix                                                                |
| -------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| `Invalid origin: ...` on signup/login              | `BETTER_AUTH_URL` doesn't match the actual domain — Vercel may have suffixed the project name      | Set the exact URL in the env, redeploy                             |
| `Free tier users do not have access to this model` | The AI Gateway key has no paid credits — the key's quota is a spending cap, not a balance          | Add credits to the gateway account, or bring your own provider key |
| Signup 500 / `relation "users" does not exist`     | Migrations never ran against the production database                                               | `DATABASE_URL="<direct Neon URL>" pnpm db:migrate`                 |
| Subscribed but no credits arrived                  | Webhook endpoint points at the wrong domain, stale `whsec_`, or the env changed without a redeploy | Recheck step 7's domain, replace the secret, redeploy              |

Every env change requires a redeploy — Vercel bakes env at build time.

## FAQ

**Is this production-ready?** The billing and ledger core is tested to a
standard most products never reach (races, replays, invariants, adversarial
webhooks). The legal pages are placeholders and the product on top is
yours to build.

**Does it work with Claude Code / Cursor?** Yes — that's the point. The
repo carries its own agent context (AGENTS.md, CLAUDE.md, path-scoped
rules, skills, hooks); Cursor reads the mirrored `.cursor/rules/`. Open
the repo and the agent is briefed.

**How does the credits system work?** Every credit movement is an
append-only row in `credit_transactions` with a unique idempotency key,
so webhook replays can't double-grant. Spends are one conditional UPDATE
that refuses to go below zero, and the cached balance is enforced equal
to `SUM(amount)` by tests and a DB CHECK.

**Can I swap gpt-image for another model?** One env string:
`AI_IMAGE_MODEL=provider/model` — no code changes.

**Why Better Auth instead of NextAuth/Clerk?** Sessions and users live in
YOUR Postgres next to the ledger, so account deletion, credit grants, and
webhooks are one transaction-safe world. No per-user vendor pricing on a
free starter.

**Is this a free alternative to ShipFast or Makerkit?** It overlaps where
every SaaS starter overlaps — auth, Stripe, landing page — but the focus
is different: a tested credits ledger, an AI generation loop, and agent
context files, free and MIT. The paid kits are broader (teams, i18n,
admin); the Pro version covers that ground.

**Why is generation mocked by default?** So a fresh clone works offline and
free. Set `AI_GATEWAY_API_KEY` and `AI_MOCK=false` for real images; in mock
mode, a prompt containing `FAIL` demos the refund path.

**Can I swap Postgres providers?** Anything with a `postgres://` URL —
Neon, Supabase, RDS, the bundled Docker.

**Where do I start extending?** Copy `specs/TEMPLATE.md`, write ten lines,
and hand it to your agent with `/add-feature`.

## Free vs Pro

| Capability                                | Free — this repo | [Pro — nikandr.com](https://nikandr.com) |
| ----------------------------------------- | ---------------- | ---------------------------------------- |
| Auth, subscriptions, credits ledger       | full             | + rollover, meters, packs                |
| AI generation                             | 1 image provider | image + video + audio, 7 providers       |
| Async job pipeline, webhooks, auto-refund | —                | Inngest, durable                         |
| Gallery + R2 storage, teams, admin        | —                | included                                 |
| MCP server + extended agent skills        | core set         | full suite                               |

The free repo is complete — nothing above is crippled. Pro is what comes
after product-market fit.

## Author

Built by **Nikandr Surkov** — [nikandr.com](https://nikandr.com). If this
repo saved you time,
[star it](https://github.com/nikandr-surkov/ai-saas-starter/stargazers) —
stars are how other builders find it.

## License

MIT — see [LICENSE](LICENSE).
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。