Next.jsReactSaaS启动器

MorrowKit — Next.js SaaS模板

作者 JairoRaudaDev

MorrowKit 是一个基于 Next.js 的开源 SaaS 启动器,集成 Supabase 认证与数据、Stripe 订阅计费、Resend 事务邮件、PostHog 分析与 Sentry 监控,并提供 create-morrowkit 项目生成器。

看看你的网站会是什么样

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

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

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

全部页面与视图 3

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

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

值得关注的模板亮点

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

01

提供 create-morrowkit 项目生成器,支持交互式与脚本化脚手架,兼容 pnpm、npm、yarn 和 Bun

02

生成时可选移除 Stripe、事务邮件或 PostHog 模块,并清理相关源码、依赖、环境变量与迁移

03

内置 Supabase Auth 邮箱密码认证、SSR 会话、安全重定向与受保护路由

04

集成 Stripe Checkout、Customer Portal、订阅同步以及带签名验证和事件去重的 webhook 处理

05

包含 Vitest、pgTAP、Playwright、ESLint、Prettier 和 TypeScript 质量检查

06

使用 Tailwind CSS、Radix UI 和 Lucide 图标提供可复用的营销、认证、仪表盘与表单组件

模板详细介绍

MorrowKit 面向需要快速搭建小型 SaaS 产品的开发者,把认证、计费、邮件、分析、监控和部署等重复性基础设施预先编码为默认实现。它由两部分组成:一个 Next.js App Router 应用模板,以及一个名为 create-morrowkit 的交互式/脚本化项目生成器。生成的项目包含邮箱密码注册登录、SSR 会话、受保护路由、RLS 保护的 profiles 表、Stripe Checkout 与 Customer Portal、订阅状态到权益的映射、Resend 事务邮件、PostHog 生命周期事件和可选的 Sentry 错误上报。

在架构上,模板把外部系统放在服务端边界之后:浏览器使用匿名密钥加 RLS,登录用户使用 SSR 会话,只有受信任的计费和 webhook 代码使用 service-role 密钥。Stripe 作为计费事实来源,Supabase 保存应用可读的订阅快照用于权益判断。生成器支持在创建时移除 Stripe、邮件或分析模块,并同步清理相关源码、依赖、环境变量、迁移和文档。

使用限制方面,MorrowKit 是启动器而非托管平台或框架,需要自行配置 Supabase、Stripe、Resend、PostHog、Sentry 等外部服务,这些服务可能产生额外费用。本地开发要求 Node.js 22.22 或更新版本、所选包管理器以及 Docker Desktop(用于本地 Supabase)。代码采用 MIT 许可,但演示图片、字体、图标等第三方素材需单独核对许可。

Next.jsReactSaaS启动器

适合你的项目吗?

适用场景

  • 需要快速验证小型 SaaS 产品想法,希望跳过认证、计费和邮件等重复搭建工作
  • 采用产品组合策略,同时维护多个小型产品,需要统一且可复制的技术基础
  • 希望以 Stripe 订阅和 Supabase RLS 为基础构建带免费、Pro、Business 分级的付费应用
  • 需要在 Next.js App Router 项目中集成 PostHog 生命周期分析与可选 Sentry 错误监控
  • 希望使用带数据库策略测试和端到端测试的 SaaS 项目起始结构

适合人群

  • 熟悉 Next.js、React 和 TypeScript,并愿意自行配置 Supabase、Stripe 等外部服务的开发者
  • 需要可修改、可移除模块的 MIT 许可 SaaS 起始代码的个人开发者或小团队
  • 计划将产品快速上线并根据数据决定继续投入或停止的独立产品开发者

上手与定制指南

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

  1. 1

    使用 npx create-morrowkit@latest 交互式生成项目,或通过 --yes 及 --no-stripe、--no-email、--no-analytics 等参数进行非交互式生成

  2. 2

    生成后复制 .env.example 为 .env.local,并按模板文档配置 Supabase、Stripe、Resend、PostHog 和 Sentry 所需的环境变量

  3. 3

    本地开发需要 Node.js 22.22 或更新版本、所选包管理器以及 Docker Desktop,用于运行本地 Supabase

  4. 4

    运行 pnpm setup 可创建 .env.local、启动本地 Supabase 并刷新本地 URL 与密钥,随后用 pnpm dev 启动开发服务器

  5. 5

    生产部署前需参考模板中的部署运行手册,完成安全、迁移、Stripe 实时模式、邮件、监控、域名与回滚等检查

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • 本地开发需 Node.js 22.22 或更新版本、所选包管理器,以及用于本地 Supabase 的 Docker Desktop。
  • 生产部署需按部署运行手册完成安全检查、Supabase 迁移与 Auth URL、Stripe 实时模式、邮件、监控、分析、法律页面、SEO、域名、冒烟测试与回滚等配置。
  • 计费以 Stripe 为事实来源,Supabase 仅保存应用可读的订阅快照用于权益判断,需依赖 Stripe 服务。
  • Stripe、事务邮件与 PostHog 为可选模块,可在生成时移除并清理相关源码、依赖、环境变量、迁移与文档。
  • 分析功能依赖 PostHog,未配置时该功能处于禁用状态。
  • Sentry 错误监控为可选功能,需自行配置。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

Local development requires Node.js 22.22 or newer, the selected package manager, and Docker Desktop for Supabase.

README 原文

For production, follow the [deployment runbook](apps/template/docs/production-deployment.md), which covers security checks, Supabase migrations and Auth URLs, Stripe live mode, email, monitoring, analytics, legal pages, SEO, domains, smoke tests, and rollback.

README 原文

Stripe is the billing source of truth, while Supabase stores the application-readable subscription snapshot used for entitlements.

README 原文

**Optional modules:** remove Stripe, transactional email, or PostHog during generation without leaving unused source, dependencies, environment variables, migrations, or documentation behind.

README 原文

**Analytics:** typed, server-side lifecycle events through PostHog; disabled when unconfigured.

README 原文

**Observability:** optional Sentry reporting for browser, Node.js, and edge runtimes.

README 原文
https://github.com/JairoRaudaDev/MorrowKit/blob/main/LICENSEhttps://github.com/JairoRaudaDev/MorrowKit/blob/main/README.md

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

项目核对记录与介绍依据

模板资料

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

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

这个项目需要核对什么

记录的仓库更新时间
2026-08-19
截图检查日期
2026-10-08

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

审核声明: [email protected] · 2026-10-08

查看当时使用的来源资料

SHA-256: 69490c5fe654b73a1265428c5e66a995014644a9f5a135ba97326428866625ce

2026-10-08T15:39:44.147Z

来源文件 / 仓库
# MorrowKit

<p align="center">
  <a href="https://github.com/JairoRaudaDev/MorrowKit"><img src="https://img.shields.io/badge/GitHub-MorrowKit-181717?logo=github" alt="MorrowKit on GitHub"></a>
  <a href="https://github.com/JairoRaudaDev"><img src="https://img.shields.io/badge/Author-JairoRaudaDev-181717?logo=github" alt="JairoRaudaDev on GitHub"></a>
  <a href="https://github.com/JairoRaudaDev/MorrowKit/issues"><img src="https://img.shields.io/github/issues/JairoRaudaDev/MorrowKit" alt="GitHub issues"></a>
  <a href="https://github.com/JairoRaudaDev/MorrowKit/blob/main/LICENSE"><img src="https://img.shields.io/github/license/JairoRaudaDev/MorrowKit" alt="MIT license"></a>
  <a href="https://buymeacoffee.com/jairoraudadev"><img src="https://img.shields.io/badge/Buy_Me_a_Coffee-support-FFDD00?logo=buymeacoffee&logoColor=000000" alt="Buy me a coffee"></a>
</p>

> Build → launch → measure → grow or kill.

MorrowKit is an opinionated, open-source starter for shipping small SaaS
products without rebuilding authentication, billing, email, analytics, and
deployment plumbing for every idea.

It supports a portfolio approach to product development: validate an idea,
build the smallest useful version, launch it, distribute it, measure what
happens, then invest or stop. MorrowKit handles the recurring foundation so
product work begins sooner—and experiments remain cheap enough to end.

## What it is

MorrowKit combines a production-oriented Next.js application template with the
`create-morrowkit` project generator. A generated application includes
email/password authentication, protected dashboards, RLS-secured user data,
subscription billing, transactional email, analytics, monitoring, and tests.

It is a starter, not a hosted platform or framework. Generate a project, rename
the product, change its plans, remove integrations you do not need, and replace
the example product surface with your own.

## Why it exists

Most small SaaS products need the same unglamorous foundation. Rebuilding it
delays the first customer conversation; skipping it creates security, billing,
and operational debt when a product starts to work.

MorrowKit makes a deliberate trade: choose a focused stack and encode sound
defaults once. Its job is to shorten the path from idea to evidence while
keeping each product understandable enough to maintain, transfer, or shut down.

## Features

- **Project generator:** interactive and scriptable scaffolding with pnpm, npm,
  yarn, and Bun support.
- **Optional modules:** remove Stripe, transactional email, or PostHog during
  generation without leaving unused source, dependencies, environment
  variables, migrations, or documentation behind.
- **Authentication:** signup, login, logout, SSR sessions, safe redirects, and
  protected routes with Supabase Auth.
- **Profiles:** account settings backed by an owner-only, RLS-protected
  `profiles` table.
- **Billing:** Pro and Business plans, Stripe Checkout, Customer Portal, and
  synchronized customer/subscription records.
- **Reliable webhooks:** signature verification, request-size limits, durable
  event deduplication, and stale-event guards.
- **Entitlements:** a domain layer mapping subscription state to free, Pro, and
  Business capabilities.
- **Dashboard:** overview, billing, settings, and premium insights with loading,
  empty, error, and not-found states.
- **Email:** Resend behind a provider boundary, with React Email and an included
  welcome message.
- **Analytics:** typed, server-side lifecycle events through PostHog; disabled
  when unconfigured.
- **Observability:** optional Sentry reporting for browser, Node.js, and edge
  runtimes.
- **Quality gates:** Vitest, pgTAP, Playwright, ESLint, Prettier, and TypeScript.
- **Reusable UI:** Tailwind CSS, Radix UI, Lucide icons, and reusable marketing,
  auth, dashboard, and form components.

## Tech stack

| Layer         | Technology                                               |
| ------------- | -------------------------------------------------------- |
| Application   | Next.js 16 App Router, React 19, TypeScript 5            |
| UI            | Tailwind CSS 4, Radix UI, Lucide React                   |
| Auth and data | Supabase Auth, PostgreSQL, RLS, `@supabase/ssr`          |
| Payments      | Stripe Checkout, Billing Portal, subscriptions, webhooks |
| Email         | Resend, React Email                                      |
| Analytics     | PostHog                                                  |
| Monitoring    | Sentry                                                   |
| Tests         | Vitest, Playwright, pgTAP via Supabase CLI               |
| Tooling       | pnpm, ESLint, Prettier                                   |

## Create a project

### Interactive

Run the generator and answer its prompts:

```bash
npx create-morrowkit@latest
```

You can choose the project directory, package manager, dependency installation,
Git initialization, Stripe billing, transactional email, and analytics.

### Non-interactive

Create the complete default stack with pnpm:

```bash
npx create-morrowkit@latest my-app --yes
```

Create a smaller application without billing, email, or analytics:

```bash
npx create-morrowkit@latest my-app \
  --no-stripe \
  --no-email \
  --no-analytics \
  --yes
```

After generation:

```bash
cd my-app
cp .env.example .env.local
pnpm dev
```

See the [create-morrowkit documentation](packages/create-morrowkit/README.md)
for all prompts, flags, module-removal behavior, generated project structure,
and CI examples.

## Generated application

The default application is organized around explicit product and provider
boundaries:

```text
src/
├── app/                 Routes, layouts, server actions, and Stripe webhook
├── components/          Application components and UI primitives
├── config/              Product name, company, and plan presentation
├── emails/              React Email templates
├── env/                 Public and server environment validation
└── lib/
    ├── analytics/       Product events and PostHog provider
    ├── auth/            Sessions and credential validation
    ├── db/              Profile and subscription queries
    ├── email/           Transactional email provider boundary
    ├── stripe/          Checkout, portal, mapping, and webhook logic
    └── supabase/        Browser, server, middleware, and admin clients

supabase/
├── migrations/          Profiles, billing, webhook processing, and RLS
├── tests/database/      pgTAP schema and policy tests
└── seed.sql

tests/e2e/               Playwright user journeys
```

The generator rewrites this structure when optional modules are excluded.

## Architecture

The App Router application keeps external systems behind small server-only
boundaries:

```text
Browser
  └─ Next.js routes and server actions
       ├─ Supabase SSR ──> Auth, profiles, billing snapshots, RLS
       ├─ Stripe ──────> Checkout and Customer Portal
       ├─ Resend ──────> Transactional email
       ├─ PostHog ─────> Lifecycle analytics
       └─ Sentry ──────> Error monitoring

Stripe ── signed webhook ──> Next.js API route ──> service-role Supabase RPC
```

The trust boundary is deliberate: browser code uses the anonymous key plus RLS;
normal authenticated work uses the user's SSR session; trusted billing and
webhook code alone uses the service-role key. Stripe is the billing source of
truth, while Supabase stores the application-readable subscription snapshot
used for entitlements.

## Application setup

Generated projects include a setup script that creates `.env.local` when
needed, starts local Supabase, and refreshes its local URL and keys while
preserving existing configuration:

```bash
pnpm setup
pnpm dev
```

Local development requires Node.js 22.22 or newer, the selected package manager,
and Docker Desktop for Supabase. Supabase Studio is available at
`http://localhost:54323`; captured local Auth email is available at
`http://localhost:54324`.

The [application template documentation](apps/template/README.md) covers:

- environment variables and validation;
- local and hosted Supabase setup;
- Stripe products, webhooks, and Customer Portal configuration;
- Resend and React Email usage;
- test suites and development workflows;
- deployment and production readiness.

For production, follow the
[deployment runbook](apps/template/docs/production-deployment.md), which covers
security checks, Supabase migrations and Auth URLs, Stripe live mode, email,
monitoring, analytics, legal pages, SEO, domains, smoke tests, and rollback.

## Repository development

This repository is a pnpm workspace containing the source application template
and the CLI that packages it:

```text
apps/template/                 Next.js SaaS application template
packages/create-morrowkit/    create-morrowkit CLI
```

Install dependencies once from the repository root:

```bash
pnpm install
```

Common commands:

| Command                             | Purpose                                     |
| ----------------------------------- | ------------------------------------------- |
| `pnpm dev`                          | Run the application template.               |
| `pnpm setup`                        | Set up the template's local Supabase stack. |
| `pnpm cli -- my-app`                | Run the generator directly from source.     |
| `pnpm build`                        | Build the template and publishable CLI.     |
| `pnpm test` / `pnpm test:watch`     | Run tests once or in watch mode.            |
| `pnpm test:db`                      | Run pgTAP database and RLS tests.           |
| `pnpm test:e2e`                     | Run Playwright browser tests.               |
| `pnpm lint`                         | Run ESLint across the workspace.            |
| `pnpm typecheck`                    | Check TypeScript and CLI JavaScript syntax. |
| `pnpm format` / `pnpm format:check` | Write or verify repository formatting.      |

To exercise generation without installing dependencies or creating a nested Git
repository:

```bash
pnpm cli -- my-app --no-install --no-git --yes
```

## Contributing

Issues and pull requests are welcome.

See [CONTRIBUTING.md](CONTRIBUTING.md) for the full contribution, versioning, and
release process, and [CHANGELOG.md](CHANGELOG.md) for notable changes.

1. Fork the repository and create a focused branch.
2. Install dependencies and run `pnpm setup` for application work.
3. Make the smallest coherent change and add tests where the behavior lives.
4. For database changes, add a migration rather than editing an already-shared
   one; update pgTAP tests and seed data as needed.
5. Run the relevant tests plus formatting, linting, type checking, and builds.
6. Open a pull request describing the problem, approach, verification, and any
   migration or deployment impact.

Keep secrets, generated output, and local environment files out of commits.
Prefer narrow provider interfaces and explicit server-only modules for
integrations. Security-sensitive authentication, RLS, billing, and webhook
changes should include regression coverage.

## License

MorrowKit is available under the [MIT License](LICENSE).
反馈内容错误

看看同类模板

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