集成 Next.js App Router、严格 TypeScript、Supabase Auth(Google 和邮箱密码)、Postgres、RLS 和 Stripe 订阅计费
xerv — Next.js SaaS模板
作者 pablocampelo
Xerv 是一个 MIT 许可的 SaaS 基础模板,基于 Next.js、Supabase、Stripe、Resend 和 Vercel,提供认证、私有数据、订阅计费与部署的已连接实现,并包含可替换的示例产品域。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 2
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
计费由服务端权威处理:Stripe Checkout、Customer Portal、签名 webhook、幂等事件处理和 paid-through 权益状态
提供可替换的示例产品域,演示 Auth → 所有权 → RLS → Pro → CRUD 的端到端流程
包含注册、验证、登录、恢复、Dashboard、Account、Billing、Help 和法律模板等产品流程
CI 覆盖冻结安装、lint、类型检查、单元测试、生产构建、Supabase 迁移、数据库安全测试、生成类型和 Playwright E2E
模板详细介绍
Xerv 面向技术创始人和小团队,提供订阅制 SaaS 的基础设施,而不是功能繁多的通用脚手架。README 说明其技术栈为 Next.js、Supabase、Stripe、Resend(SMTP)和 Vercel,已连接认证、私有数据、订阅和部署路径,并附带一个可替换的示例产品域(Example Resource),用于演示 Auth → 所有权 → RLS → Pro → CRUD 的完整流程。
模板刻意保持范围狭窄:仅支持单个用户账户、Free + Pro 两档、月付或年付计费,不包含团队/席位、用量计费、CMS、分析框架或通用 API。安全边界明确:Supabase Auth、Postgres 所有权和 RLS 协同工作;计费由服务端权威处理,Stripe Checkout 和 Customer Portal 依赖签名 webhook、幂等事件处理和 paid-through 权益状态,浏览器返回不会直接授予 Pro。
本地运行需要 Node.js 24、pnpm 11.19.0 和 Docker。README 提供了克隆、安装、启动 Supabase、配置环境变量、重置数据库和启动开发服务器的步骤,并说明本地注册和密码恢复使用 Mailpit。要测试真实 Checkout 和 Pro,需添加 Stripe 测试模式凭据、月付/年付 Price ID 并运行本地 Stripe webhook 监听器。
README 未说明该模板在生产环境中的性能、扩展性或长期维护承诺,也未提供除 Vercel 之外的其他部署目标说明。
适合你的项目吗?
适用场景
- 技术创始人或小团队需要快速搭建订阅制 SaaS 的认证、私有数据和计费基础
- 希望基于 MIT 许可的代码库进行克隆或 fork,并替换示例产品域来构建自己的产品
- 需要本地开发环境验证 Supabase Auth、RLS、Stripe Checkout 和 webhook 流程
- 计划部署到 Vercel,并使用 Supabase、Stripe、Google OAuth 和 Resend SMTP 作为托管服务
适合人群
- 面向个人用户账户的订阅制 SaaS 项目
- 需要 Free + Pro 两档和月付/年付计费的场景
- 使用 Next.js、Supabase、Stripe 和 Vercel 技术栈的开发者
- 希望以 MIT 许可自由使用、修改和分发的项目
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
本地运行需要 Node.js 24、pnpm 11.19.0 和 Docker
- 2
克隆仓库后运行 pnpm install --frozen-lockfile、pnpm supabase:start 和 pnpm supabase:status
- 3
复制 .env.example 到 .env.local,使用本地 Supabase URL 和 publishable key,保持 NEXT_PUBLIC_SITE_URL=http://localhost:3000,并提供支持邮箱
- 4
本地计费写入需使用本地 service-role key 作为 SUPABASE_SECRET_KEY,且不得通过 NEXT_PUBLIC_* 变量暴露
- 5
测试真实 Checkout 和 Pro 需添加 Stripe 测试模式凭据、月付/年付 Price ID 并运行本地 Stripe webhook 监听器
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
- 本地运行需要 Node.js 24、pnpm 11.19.0 和 Docker。
- 需复制 .env.example 到 .env.local,使用本地 Supabase URL 和 publishable key,保持 NEXT_PUBLIC_SITE_URL=http://localhost:3000,并提供支持邮箱;本地计费写入需使用本地 service-role key 作为 SUPABASE_SECRET_KEY,且不得通过 NEXT_PUBLIC_* 变量暴露。
- 要测试真实 Checkout 和 Pro,需添加 Stripe 测试模式凭据、月付/年付 Price ID,并运行本地 Stripe webhook 监听器。
- 需自行创建 Supabase 项目、Google OAuth 凭据、SMTP 发件人和 Stripe 产品/价格。
- 数据库重置会破坏本地 Supabase 数据库,切勿指向托管数据;托管凭据、重定向、SMTP 和 webhook 目标仍需环境级验证。
- 模板仅支持单一用户数据模型、一个 Pro 权益、两种计费周期和 Vercel 部署目标,不包含团队/席位、额外 OAuth 提供商、用量计费、队列、CMS、分析、通用 API、自动计费修复 cron 或管理面板。
- 克隆使用自己的 Supabase、Stripe、Google OAuth、Resend SMTP 和 Vercel 配置;Supabase Site URL、允许的重定向及托管确认/恢复邮件模板必须指向确切的应用规范源;提交本地模板不会在托管 Supabase 项目中安装它们。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
**Prerequisites:** Node.js 24, pnpm 11.19.0 and Docker.
README 原文
Copy `.env.example` to `.env.local`. Use the local Supabase URL and publishable key printed by `pnpm supabase:status`, keep `NEXT_PUBLIC_SITE_URL=http://localhost:3000`, and provide a support email. For local billing writes, use the **local service-role key** as `SUPABASE_SECRET_KEY`. Never expose it through a `NEXT_PUBLIC_*` variable.
README 原文
To exercise real Checkout and Pro, add Stripe **test-mode** credentials and the supported monthly/annual Price IDs, then run a local Stripe webhook listener. See [Setup](docs/SETUP.md) for the complete provider and deployment path.
README 原文
2. **Own the providers.** Create your Supabase project, Google OAuth credentials, SMTP sender and Stripe products/Prices.
README 原文
The database reset is **destructive to your local Supabase database**. Never point it at hosted data. CI validates the repository; hosted credentials, redirects, SMTP and webhook destinations still need environment-level verification.
README 原文
The starter intentionally supports **one user-owned data model, one Pro entitlement, two billing intervals and Vercel as the deployment target**. It does not include teams/seats, extra OAuth providers, usage billing, queues, CMS, analytics, a generic API, automatic billing-repair cron or an admin panel.
README 原文
https://github.com/pablocampelo/xerv/blob/main/LICENSEhttps://github.com/pablocampelo/xerv/blob/main/README.mdYour clone uses **its own** Supabase, Stripe, Google OAuth, Resend SMTP and Vercel configuration. Supabase **Site URL**, allowed redirects, and hosted confirmation/recovery email templates must point to the exact canonical app origin. Committing the local templates does **not** install them in a hosted Supabase project. See the [release checklist](docs/RELEASE-CHECKLIST.md) before sharing a live link.
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-13。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 85 / 100
- 技术栈
- Next.js · React
- 网站类型
- SaaS · 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-10-13
- 截图检查日期
- 2026-10-13
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
审核声明: codex-user-requested-batch-review-20261015 · 2026-10-15
查看当时使用的来源资料
SHA-256: 406d43c626e8c264ef55c52d1093023fe5a33c08b8d529d7d17c53ddee1a91a6
2026-10-13T15:36:06.643Z
来源文件 / 仓库# Xerv **Build the product. Not the infrastructure.** An MIT-licensed SaaS foundation built with **Next.js, Supabase, Stripe, Resend (SMTP) and Vercel**. Auth, private data, subscriptions and deployment are connected; replace the example product domain with yours. **Free to use · Clone it · Fork it · Build your product.** [Live demo](https://xerv.vercel.app) · [Setup](docs/SETUP.md) · [Architecture](docs/ARCHITECTURE.md) · [Billing](docs/BILLING.md) · [Release checklist](docs/RELEASE-CHECKLIST.md) [](https://github.com/pablocampelo/xerv/actions/workflows/ci.yml) [](https://xerv.vercel.app) Xerv gives technical founders and small teams a focused subscription foundation instead of another oversized boilerplate. Authentication, private user data, paid access, billing recovery and the deployment path are connected and tested. Built for **individual user accounts**, **Free + Pro**, and **monthly or annual billing**. The repository deliberately stays narrow: no teams, seats, usage billing, CMS, analytics framework or speculative provider abstraction. ## Why Xerv - **Security boundaries are explicit.** Supabase Auth, Postgres ownership and RLS are exercised together instead of relying on client-side checks. - **Billing is server-authoritative.** Stripe Checkout and Customer Portal are backed by signed webhooks, idempotent event handling and paid-through entitlement state. A browser return never grants Pro. - **The sample domain is replaceable.** The Example Resource proves Auth → ownership → RLS → Pro → CRUD end to end without becoming architecture you have to keep. - **The supported path is tested.** CI covers frozen install, lint, typecheck, unit tests, production build, Supabase migrations, database security tests, generated types and Playwright E2E. ## What's included | Foundation | What ships | | --- | --- | | **Next.js** | App Router, strict TypeScript, responsive marketing/auth/app surfaces and Vercel deployment | | **Supabase** | Google + email/password Auth, Postgres, migrations, generated types, ownership constraints and RLS | | **Stripe** | Free + Pro, monthly/annual Checkout, Customer Portal, signed webhooks and paid-through access | | **Product flows** | Signup, verification, login, recovery, Dashboard, Account, Billing, Help and legal templates | | **Reliability** | Idempotent billing processing, concurrency protection, diagnostics and dry-run reconciliation | | **Confidence** | GitHub Actions, unit tests, database tests and browser E2E | ## Run it locally **Prerequisites:** Node.js 24, pnpm 11.19.0 and Docker. ```sh git clone https://github.com/pablocampelo/xerv.git my-saas cd my-saas pnpm install --frozen-lockfile pnpm supabase:start pnpm supabase:status ``` Copy `.env.example` to `.env.local`. Use the local Supabase URL and publishable key printed by `pnpm supabase:status`, keep `NEXT_PUBLIC_SITE_URL=http://localhost:3000`, and provide a support email. For local billing writes, use the **local service-role key** as `SUPABASE_SECRET_KEY`. Never expose it through a `NEXT_PUBLIC_*` variable. ```sh pnpm supabase:db:reset pnpm dev ``` Open **http://localhost:3000**. Local signup and password recovery use Mailpit at **http://127.0.0.1:54324**, so you can exercise email flows without a real inbox. To exercise real Checkout and Pro, add Stripe **test-mode** credentials and the supported monthly/annual Price IDs, then run a local Stripe webhook listener. See [Setup](docs/SETUP.md) for the complete provider and deployment path. ## Make it yours 1. **Brand it.** Edit `config/product.ts` (including `repositoryUrl`), replace the sample marketing/legal copy and point the canonical site URL at your deployment. 2. **Own the providers.** Create your Supabase project, Google OAuth credentials, SMTP sender and Stripe products/Prices. 3. **Replace Example.** Build your real domain in place of `lib/example/` and the Example routes. Add migrations and regenerate database types while preserving Auth, Billing and RLS trust boundaries. 4. **Deploy.** Apply hosted migrations deliberately, deploy to Vercel, configure the signed Stripe webhook and verify Auth, recovery and paid access on the hosted environment. ## Verify changes ```sh pnpm lint pnpm typecheck pnpm test pnpm build pnpm supabase:db:reset pnpm supabase:test:db pnpm supabase:types pnpm exec playwright install chromium pnpm test:e2e ``` The database reset is **destructive to your local Supabase database**. Never point it at hosted data. CI validates the repository; hosted credentials, redirects, SMTP and webhook destinations still need environment-level verification. ## Scope The starter intentionally supports **one user-owned data model, one Pro entitlement, two billing intervals and Vercel as the deployment target**. It does not include teams/seats, extra OAuth providers, usage billing, queues, CMS, analytics, a generic API, automatic billing-repair cron or an admin panel. This constraint is intentional: the infrastructure stays understandable while the replaceable product domain stays yours. ## Documentation - [Setup](docs/SETUP.md) — local development, hosted Supabase/Auth/SMTP, Stripe and Vercel - [Architecture](docs/ARCHITECTURE.md) — boundaries, code map and replacing Example - [Billing](docs/BILLING.md) — Stripe operations, recovery and safe reconciliation ## Before publishing a live demo Your clone uses **its own** Supabase, Stripe, Google OAuth, Resend SMTP and Vercel configuration. Supabase **Site URL**, allowed redirects, and hosted confirmation/recovery email templates must point to the exact canonical app origin. Committing the local templates does **not** install them in a hosted Supabase project. See the [release checklist](docs/RELEASE-CHECKLIST.md) before sharing a live link. [Star Xerv on GitHub](https://github.com/pablocampelo/xerv) if it helps you, or fork it to build on top of the code. ## License [MIT](LICENSE)
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

ai-website-cloner-template
Clone any website with one command using AI coding agents
Next.js · 启动器

Next.js SaaS Starter
Next.js SaaS Starter 是 Next.js 官方维护的 SaaS 起点模板,定位介于学习资源和可直接部署的脚手架之间。
Next.js · SaaS

Next.js Commerce
Next.js Commerce 是 Vercel 团队维护的电商启动模板,基于 Next.js App Router 构建,采用服务端渲染、React Server Components、Server Actions …
Next.js · 电商

Next-js-Boilerplate
Next-js-Boilerplate 是一个面向 Next.js 16、Tailwind CSS 4 和 TypeScript 的启动器,核心定位是开发者体验优先。
Next.js · 启动器

tailwind-nextjs-starter-blog
tailwind-nextjs-starter-blog 是一个面向个人技术博客的 Next.js 与 Tailwind CSS 启动模板,其 v2 版本基于 App Router 与 React Server Comp…
Next.js · 博客

next-forge
Production-grade Turborepo template for Next.js apps.
Next.js · 启动器
