Next.jsReactSaaS启动器

plinth — Next.js SaaS模板

作者 yoni-crypto

Plinth 是一个基于 Next.js 与 React 的开源 SaaS 启动器,内置认证、计费、多租户、通知、审计日志等模块,采用 MIT 许可。

看看你的网站会是什么样

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

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

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

全部页面与视图 3

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

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

值得关注的模板亮点

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

01

基于 Next.js 与 React 构建,使用 TypeScript 严格模式与 Zod 校验

02

内置认证、RBAC、多租户、计费、通知、审计日志等 SaaS 常用模块

03

支付、邮件、存储等模块提供多适配器,可切换 Stripe/Chapa、Resend/SMTP、UploadThing/S3/本地

04

数据库使用 PostgreSQL 与 Drizzle ORM,提供 db:push、db:seed 等脚本

05

提供 Docker Compose 与 Vercel 部署方式,并包含 Playwright 端到端测试

06

采用 MIT 许可,允许免费使用、修改、商用与分发该版本代码

模板详细介绍

Plinth 是 yoni-crypto 发布在 GitHub 上的开源项目,定位为面向现代 Web 应用与 SaaS 产品的模块化开发平台。它基于 Next.js 与 React 构建,提供认证、授权、计费、多租户、通知、审计日志、API 密钥、Webhook、功能开关、邮件、存储、限流、后台任务、分析、AI 集成、国际化、博客与文档、端到端测试、错误监控、积分系统、等待列表、用户模拟、引导流程、健康检查与 CLI 等模块。项目采用 TypeScript 严格模式,数据库使用 PostgreSQL 与 Drizzle ORM,认证使用 Better Auth,支付支持 Stripe 与 Chapa,邮件支持 React Email、Resend 与 SMTP,存储支持 UploadThing、S3/R2 与本地适配器。

仓库提供快速开始步骤,要求 Node.js 22+、pnpm 9+ 与 PostgreSQL 16+,通过 pnpm db:push 初始化数据库、pnpm db:seed 填充演示数据,并给出演示账号。环境变量分为必填与可选两类,必填项为 DATABASE_URL 与 AUTH_SECRET。部署方式包括 Vercel、Docker 与手动构建。项目结构按模块划分,包含 packages/cli 脚手架工具、content 下的 MDX 博客、docs 文档站点与 tests 下的 Playwright 端到端测试。

许可方面,仓库采用 MIT 许可,允许免费使用、修改、商用与分发该版本代码,分发时需保留版权声明与许可声明。演示图片、字体、图标等第三方素材需单独核对许可;域名、托管、数据库、支付或 AI 等外部服务可能另外收费。README 中列出的功能与配置项为项目自述,未在本次资料中逐项验证其运行状态。

Next.jsReactSaaS启动器

适合你的项目吗?

适用场景

  • 需要快速搭建带认证、计费与多租户能力的 SaaS 产品原型
  • 希望以模块化方式组合认证、通知、审计、API 密钥等后台功能
  • 需要支持 Stripe 与 Chapa 两种支付渠道的订阅与用量计费场景
  • 需要国际化、博客与文档内容管理的 Web 应用
  • 希望通过 Docker 或 Vercel 部署并保留端到端测试的团队

适合人群

  • 熟悉 Next.js、React 与 TypeScript 的全栈开发者
  • 需要 SaaS 基础模块以缩短前期搭建时间的独立开发者或小团队
  • 接受 PostgreSQL 与 Drizzle ORM 技术选型的项目
  • 希望基于 MIT 许可代码进行二次开发并自行配置外部服务的团队

上手与定制指南

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

  1. 1

    需要 Node.js 22+、pnpm 9+ 与 PostgreSQL 16+ 环境

  2. 2

    复制 .env.example 为 .env,至少配置 DATABASE_URL 与 AUTH_SECRET

  3. 3

    执行 pnpm install、pnpm db:push 与 pnpm db:seed 后运行 pnpm dev

  4. 4

    演示账号为 [email protected] 与 [email protected],密码均为 password123

  5. 5

    OAuth、邮件、存储、支付、分析、AI、Inngest 等为可选配置,需按需填写对应环境变量

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 邮件功能默认使用 log 适配器;若需真实发送邮件,需自行配置 Resend 或 SMTP 服务,可能产生第三方费用。
  • 计费模块依赖 Stripe 或 Chapa 外部支付服务,需自行注册账号并配置密钥,相关服务可能收费。
  • 存储默认使用本地适配器;若选用 UploadThing 或 S3/R2,需配置对应云服务账号,可能产生费用。
  • 分析功能依赖 PostHog 外部服务,需自行申请密钥,超出免费额度可能收费。
  • AI 集成依赖 OpenAI API,需自行提供密钥,调用按用量计费。
  • 后台任务依赖 Inngest 外部服务,需配置事件密钥,可能产生第三方费用。
  • 错误监控依赖 Sentry 外部服务,需配置 DSN,超出免费额度可能收费。
  • OAuth 登录需自行在 Google 或 GitHub 注册应用并配置客户端凭据。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

EMAIL_PROVIDER=resend|smtp|log

README 原文

PAYMENT_PROVIDER=stripe|chapa

README 原文

STORAGE_PROVIDER=uploadthing|s3|local

README 原文

NEXT_PUBLIC_POSTHOG_KEY=

README 原文

OPENAI_API_KEY=

README 原文

INNGEST_EVENT_KEY=

README 原文

NEXT_PUBLIC_SENTRY_DSN=

README 原文

GOOGLE_CLIENT_ID=

README 原文
https://github.com/yoni-crypto/plinth/blob/main/LICENSEhttps://github.com/yoni-crypto/plinth/blob/main/README.md

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

项目核对记录与介绍依据

模板资料

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

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

这个项目需要核对什么

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

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

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

查看当时使用的来源资料

SHA-256: 65cac03f8696c15cf77311b210bd5dc69c9f531c8685f337c37618b1f096d487

2026-10-01T00:57:31.012Z

来源文件 / 仓库
<div align="center">

# Plinth

**The open-source developer platform for building modern web applications and SaaS products.**

[![GitHub stars](https://img.shields.io/github/stars/yoni-crypto/plinth?style=social)](https://github.com/yoni-crypto/plinth)
[![GitHub forks](https://img.shields.io/github/forks/yoni-crypto/plinth?style=social)](https://github.com/yoni-crypto/plinth)
[![GitHub issues](https://img.shields.io/github/issues/yoni-crypto/plinth)](https://github.com/yoni-crypto/plinth/issues)
[![GitHub license](https://img.shields.io/github/license/yoni-crypto/plinth)](https://github.com/yoni-crypto/plinth/blob/main/LICENSE)
[![CI](https://github.com/yoni-crypto/plinth/actions/workflows/ci.yml/badge.svg)](https://github.com/yoni-crypto/plinth/actions/workflows/ci.yml)

[Documentation](https://github.com/yoni-crypto/plinth#documentation) · [Report Bug](https://github.com/yoni-crypto/plinth/issues) · [Request Feature](https://github.com/yoni-crypto/plinth/issues)

</div>

---

## Why Plinth?

Building a SaaS product from scratch requires months of work on authentication, billing, multi-tenancy, notifications, and dozens of other features. **Plinth** gives you all of this out of the box — production-ready, modular, and provider-agnostic.

- **Ship in days, not months** — Pre-built auth, billing, RBAC, notifications, audit logs, and more
- **Provider-agnostic** — Swap Stripe for Chapa, Resend for SMTP, S3 for local storage — no vendor lock-in
- **Type-safe everywhere** — Full TypeScript with Zod validation and Drizzle ORM
- **Production-ready** — Security headers, rate limiting, Docker support, CI/CD included
- **Modular architecture** — Use only what you need, extend what you want

## Features

| Feature | Description |
|---|---|
| **Authentication** | Better Auth with OAuth, 2FA, magic links, and session management |
| **Authorization** | RBAC with Owner/Admin/Member/Viewer roles + granular permissions |
| **Billing** | Stripe + Chapa adapters, plans, subscriptions, feature gates, usage limits |
| **Multi-tenancy** | Organization-based isolation with membership management |
| **Notifications** | In-app notification system with read/unread tracking |
| **Audit Logging** | Complete audit trail for all user and admin actions |
| **API Keys** | Prefix-based key management with scoping and expiration |
| **Webhooks** | Outgoing webhooks with HMAC-SHA256 signatures and delivery logging |
| **Feature Flags** | Global, user-specific, and org-specific overrides |
| **Email** | React Email templates + Resend + SMTP adapters |
| **Storage** | UploadThing + S3/R2 + local adapters with file validation |
| **Rate Limiting** | Sliding window algorithm with response headers |
| **Admin Panel** | User management, org management, system stats |
| **Background Jobs** | Inngest for async task processing |
| **Analytics** | PostHog integration for user analytics |
| **AI Integration** | Vercel AI SDK for chat and completions |
| **i18n** | next-intl for internationalization (10 languages) |
| **Blog/Docs** | MDX-powered content management |
| **E2E Tests** | Playwright for end-to-end testing |
| **Error Monitoring** | Sentry integration for error tracking |
| **Credits System** | Usage-based billing with credit management |
| **Waitlist** | Launch waitlist with referral tracking |
| **User Impersonation** | Admin can login as user for support |
| **Onboarding** | Multi-step onboarding flow |
| **Health Checks** | Database latency monitoring and status endpoints |
| **CLI** | Project scaffolding and module generation |

## Tech Stack

| Layer | Technology |
|---|---|
| Framework | [Next.js 15](https://nextjs.org/) + [React 19](https://react.dev/) |
| Language | [TypeScript 5](https://www.typescriptlang.org/) (strict mode) |
| Styling | [Tailwind CSS v4](https://tailwindcss.com/) + [shadcn/ui](https://ui.shadcn.com/) |
| Database | [PostgreSQL](https://www.postgresql.org/) + [Drizzle ORM](https://orm.drizzle.team/) |
| Auth | [Better Auth](https://better-auth.com/) (OAuth, 2FA, magic links) |
| Payments | [Stripe](https://stripe.com/) + [Chapa](https://chapa.co/) |
| Email | [React Email](https://react.email/) + [Resend](https://resend.com/) + SMTP |
| Storage | [UploadThing](https://uploadthing.com/) + [AWS S3](https://aws.amazon.com/s3/) |
| Analytics | [PostHog](https://posthog.com/) |
| AI | [Vercel AI SDK](https://sdk.vercel.ai/) |
| Background Jobs | [Inngest](https://inngest.com/) |
| Error Monitoring | [Sentry](https://sentry.io/) |
| i18n | [next-intl](https://next-intl.dev/) |
| Testing | [Vitest](https://vitest.dev/) + [Playwright](https://playwright.dev/) |
| Deployment | [Docker](https://www.docker.com/) + [Vercel](https://vercel.com/) |

## Quick Start

### Prerequisites

- Node.js 22+
- pnpm 9+
- PostgreSQL 16+

### Installation

```bash
# Clone the repository
git clone https://github.com/yoni-crypto/plinth.git
cd plinth

# Install dependencies
pnpm install

# Set up environment variables
cp .env.example .env
# Edit .env with your configuration

# Initialize database
pnpm db:push

# Seed with demo data
pnpm db:seed

# Start development server
pnpm dev
```

Visit [http://localhost:3000](http://localhost:3000)

### Demo Credentials

| Email | Password | Role |
|---|---|---|
| [email protected] | password123 | Super Admin |
| [email protected] | password123 | Member |

## Configuration

### Required

```env
DATABASE_URL=postgresql://user:password@localhost:5432/plinth
AUTH_SECRET=your-secret-key-at-least-32-chars
```

### Optional

```env
# OAuth
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=

# Auth
AUTH_EXPIRES_IN=7d

# Email (default: log)
EMAIL_PROVIDER=resend|smtp|log
[email protected]

# Storage (default: local)
STORAGE_PROVIDER=uploadthing|s3|local
STORAGE_BUCKET=uploads

# Payments (default: stripe)
PAYMENT_PROVIDER=stripe|chapa

# UploadThing
UPLOADTHING_SECRET=
UPLOADTHING_APP_ID=

# PostHog Analytics
NEXT_PUBLIC_POSTHOG_KEY=
NEXT_PUBLIC_POSTHOG_HOST=https://app.posthog.com

# Sentry
NEXT_PUBLIC_SENTRY_DSN=
SENTRY_AUTH_TOKEN=

# AI
OPENAI_API_KEY=

# Inngest
INNGEST_EVENT_KEY=
INNGEST_SIGNING_KEY=

# App
NEXT_PUBLIC_APP_URL=http://localhost:3000
```

See [`.env.example`](.env.example) for all available options.

## Scripts

| Command | Description |
|---|---|
| `pnpm dev` | Start development server |
| `pnpm build` | Build for production |
| `pnpm start` | Start production server |
| `pnpm lint` | Run ESLint |
| `pnpm typecheck` | Run TypeScript type checking |
| `pnpm test` | Run Vitest tests |
| `pnpm test:e2e` | Run Playwright E2E tests |
| `pnpm db:push` | Push schema to database |
| `pnpm db:generate` | Generate migration files |
| `pnpm db:migrate` | Run migrations |
| `pnpm db:studio` | Open Drizzle Studio |
| `pnpm db:seed` | Seed database with demo data |

## Docker

```bash
# Start with Docker Compose
docker compose up -d

# Run migrations
docker compose exec app pnpm db:push

# Seed database
docker compose exec app pnpm db:seed
```

## Project Structure

```
plinth/
├── src/
│   ├── app/                    # Next.js App Router
│   │   ├── (auth)/             # Login, Register, 2FA, etc.
│   │   ├── (dashboard)/        # Dashboard, Settings, Admin, Onboarding
│   │   ├── (marketing)/        # Blog, Docs
│   │   └── api/                # API routes
│   ├── components/             # UI components
│   │   ├── ui/                 # shadcn primitives (50+ components)
│   │   ├── layout/             # AppShell, Sidebar, Header
│   │   ├── forms/              # FormField, FormSection
│   │   ├── data/               # DataTable, SearchInput
│   │   └── shared/             # EmptyState, ErrorState, Loading
│   ├── config/                 # Environment validation (Zod)
│   ├── lib/                    # Utilities, DB client, schema
│   │   ├── auth/               # Better Auth configuration
│   │   ├── analytics/          # PostHog integration
│   │   ├── jobs/               # Inngest background jobs
│   │   └── ai/                 # Vercel AI SDK
│   ├── hooks/                  # Custom React hooks
│   ├── i18n/                   # Internationalization config
│   ├── messages/               # Translation files (10 languages)
│   └── modules/                # Feature modules
│       ├── auth/               # Authentication & sessions
│       ├── billing/            # Plans, subscriptions, gates, credits
│       ├── rbac/               # Roles & permissions
│       ├── organizations/      # Multi-tenancy
│       ├── notifications/      # In-app notifications
│       ├── audit/              # Audit logging
│       ├── api-keys/           # API key management
│       ├── webhooks/           # Outgoing webhooks
│       ├── payments/           # Stripe & Chapa adapters
│       ├── email/              # React Email + Resend + SMTP
│       ├── storage/            # UploadThing + S3 & local storage
│       ├── feature-flags/      # Feature flag system
│       ├── admin/              # Admin module + impersonation
│       ├── rate-limit/         # Rate limiting
│       ├── waitlist/           # Launch waitlist system
│       └── module-system/      # Plugin architecture
├── packages/
│   └── cli/                    # CLI tool for scaffolding
├── content/                    # MDX blog posts
├── docs/                       # Documentation site
├── scripts/                    # Seed & utility scripts
├── tests/                      # E2E tests (Playwright)
└── sentry.client.config.ts     # Sentry configuration
```

## Deployment

### Vercel (Recommended)

1. Push to GitHub
2. Import repository in [Vercel](https://vercel.com)
3. Configure environment variables
4. Deploy

### Docker

```bash
docker compose -f docker-compose.yml up -d
```

### Manual

```bash
pnpm build
pnpm start
```

## Contributing

Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) first.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.

---

<div align="center">

**Built with ❤️ by [yoni-crypto](https://github.com/yoni-crypto)**

If you find Plinth useful, please give it a ⭐ on GitHub!

</div>
反馈内容错误

看看同类模板

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