Turborepo + pnpm workspaces 的 monorepo 结构,应用与共享包(db、auth、calendar、email、jobs、ui、validators)分离
next-web-boilerplate — Next.js 启动器模板
作者 jrittelmeyer
基于 Next.js 的 monorepo 启动器,内置认证、支付、i18n、后台任务与可观测性等模块,仅需两个环境变量即可启动。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
目前有 1 张原始预览,可打开完整图片查看设计细节。
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
内置认证能力:邮箱密码、OAuth、2FA、通行密钥与组织管理
集成 Stripe 托管结账与 webhook、Resend 邮件、Uploadthing 上传、Meilisearch 搜索
自带日历与重复规则引擎,支持事件、邀请和提醒
包含 Vitest 单元测试与 Playwright 端到端测试,以及 Biome 与 ESLint 代码检查
提供 Docker 多阶段构建与本地 docker-compose 开发环境
模板详细介绍
next-web-boilerplate 是一个面向复杂 Web 应用的 Next.js monorepo 启动器,采用 Turborepo 与 pnpm workspaces 组织代码。仓库将应用与共享包分离:apps/web 是 Next.js 应用,packages 下包含数据库(Drizzle + PostgreSQL)、认证(Better Auth)、日历与重复规则引擎、邮件模板、后台任务、可观测性配置、UI 组件(shadcn/ui)以及客户端与服务端共用的 Zod 校验 schema。
功能层面覆盖认证(邮箱密码、OAuth、2FA、通行密钥、组织)、Stripe 支付(托管结账与 webhook)、邮件(Resend + React Email)、文件上传(Uploadthing)、搜索(Meilisearch)、后台任务(pg-boss)、国际化、日历(事件、邀请、提醒、重复规则)以及 Sentry、BetterStack、PostHog 可观测性集成。API 采用 tRPC 处理读取、Server Actions 处理写入,状态与数据请求使用 Zustand 和 TanStack Query,表单使用 React Hook Form 与 Zod。
使用限制:README 说明所有集成在未配置时会优雅降级,仅需两个环境变量即可启动,但完整功能需要自行准备 PostgreSQL、认证密钥以及各第三方服务的账号与密钥。本地开发依赖 Node.js 24+、pnpm 11+ 和 Docker(用于启动 Postgres 与 Meilisearch)。仓库提供跨平台的 pnpm init-app 辅助脚本,用于生成 .env 并重命名根包名,该步骤可选且不会覆盖已有 .env。代码采用 MIT 许可,但演示图片、字体、图标等第三方素材需单独核对许可,域名、托管、数据库、支付或 AI 等外部服务可能另行收费。
适合你的项目吗?
适用场景
- 需要快速搭建带认证、支付和后台任务的复杂 Next.js 应用骨架
- 希望以 monorepo 方式统一管理 Web 应用与共享包、校验 schema 和 UI 组件
- 需要内置国际化、日历与重复事件能力的项目起步
- 希望参考 tRPC 读取 + Server Actions 写入、Drizzle ORM 与 Zod 共享校验的工程组织方式
适合人群
- 熟悉 Next.js、TypeScript 与 pnpm 的开发者或团队
- 准备从模板起步并自行接入第三方服务密钥的项目
- 需要认证、支付、邮件、上传、搜索等常见模块预置的中大型 Web 应用
- 愿意按文档裁剪不需要模块、接受 monorepo 结构的团队
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
需要 Node.js 24+、pnpm 11+ 和 Docker(用于本地 PostgreSQL 与 Meilisearch)
- 2
复制 .env.example 为 .env 并填写数据库与认证相关密钥
- 3
通过 docker compose 启动本地 Postgres 与 Meilisearch,再执行 pnpm install 与数据库迁移
- 4
可选运行 pnpm init-app --name <应用名> 生成 .env 并重命名根包,该脚本不会覆盖已有 .env
- 5
完整功能需要自行准备各第三方服务账号与密钥;未配置时对应集成会降级
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
- 仅需两个环境变量即可启动;未配置的第三方集成会优雅降级,但完整功能仍需自行配置各服务密钥。
- 本地开发需 Node.js 24+、pnpm 11+ 及 Docker(用于本地 Postgres)。
- 本地开发需通过 docker compose 启动 PostgreSQL 与 Meilisearch 服务。
- init-app 脚本为可选且增量操作,仅生成 .env 且不会覆盖已有文件。
- 使用 Claude Code 辅助开发需安装并调用 ai-dev-kit 的 /project-init 技能。
- 项目通过 PayPal 接受自愿捐赠,属可选支持,不影响代码使用。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
It boots with **two env vars** (every > integration degrades gracefully when unconfigured)
README 原文
**Prerequisites:** Node.js **24+** (see [`.nvmrc`](.nvmrc)), pnpm **11+** (`corepack enable`), and Docker (for local Postgres).
README 原文
docker compose -f docker/docker-compose.yml up -d # start Postgres + Meilisearch
README 原文
`pnpm init-app` is **optional and additive** — it only seeds `.env` (never overwriting an existing one)
README 原文
Developing with **Claude Code**? After `pnpm install`, hand **`/project-init`** your idea or your plan documents
README 原文
https://github.com/jrittelmeyer/next-web-boilerplate/blob/main/LICENSEhttps://github.com/jrittelmeyer/next-web-boilerplate/blob/main/README.mdyou can [say thanks via PayPal](https://paypal.me/JohnRittelmeyerDev) (also behind the repo's Sponsor button)
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-05。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料一般 · 71 / 100
- 技术栈
- Next.js · React
- 网站类型
- 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-10-05
- 截图检查日期
- 2026-10-05
目前没有记录演示链接。请依据仓库说明在本地评估;仅凭截图无法确认交互行为。
目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
审核声明: [email protected] · 2026-10-06
查看当时使用的来源资料
SHA-256: ebb144d2041a4e1e0fd8d562906758048119ef6bf3f100711c314b80401d91b6
2026-10-05T13:44:45.642Z
来源文件 / 仓库# next-web-boilerplate
[](https://github.com/jrittelmeyer/next-web-boilerplate/actions/workflows/ci.yml)
[](LICENSE)
A production-ready **Next.js 16** monorepo starter for complex web applications.
Every architectural decision is deliberate and documented — clone it, and skip the
first month of wiring up a serious app.
> **Status:** feature-complete and maintained. It boots with **two env vars** (every
> integration degrades gracefully when unconfigured), and every feature — auth with
> 2FA/passkeys/orgs, Stripe, email, uploads, search, jobs, i18n, observability, a full
> calendar with recurrence and invitations — has
> been **verified end-to-end against real services**, deploy included. What's inside
> and why: [`docs/FEATURES.md`](docs/FEATURES.md). The dated proof:
> [`docs/VERIFICATION.md`](docs/VERIFICATION.md).
## Screenshots
What you get on `git clone` — a themed public landing (light **and** dark) and the
gated app shell — captured from a real keyless run (just the two required env vars,
**no third-party keys**). Dark mode is class-based (`next-themes`, no flash).
<table>
<tr>
<td width="50%"><img src="docs/assets/landing-light.png" alt="Landing page in light mode"><br><sub>Landing · light</sub></td>
<td width="50%"><img src="docs/assets/landing-dark.png" alt="Landing page in dark mode"><br><sub>Landing · dark</sub></td>
</tr>
<tr>
<td width="50%"><img src="docs/assets/dashboard.png" alt="Signed-in dashboard shell"><br><sub>Signed-in dashboard shell</sub></td>
<td width="50%"><img src="docs/assets/account.png" alt="Account profile and security settings"><br><sub>Account · profile & security</sub></td>
</tr>
</table>
> Browse the shared UI primitives live in the
> [hosted Storybook gallery](https://jrittelmeyer.github.io/next-web-boilerplate/).
## Stack
| Layer | Choice |
| --- | --- |
| Framework / Runtime | Next.js 16 (App Router, React 19) · Node.js 24 LTS |
| Language | TypeScript 6 (`strict`) |
| Monorepo | Turborepo + pnpm workspaces |
| Styling / UI | Tailwind CSS v4 · shadcn/ui (`@repo/ui`) |
| Database | PostgreSQL · Drizzle ORM |
| Auth | Better Auth (email/password + OAuth) |
| API | tRPC (reads) + Server Actions (writes) |
| State / Data | Zustand · TanStack Query v5 |
| Forms / Validation | React Hook Form · Zod (shared via `@repo/validators`) |
| Email | Resend · React Email (`@repo/email`) |
| Payments | Stripe (hosted Checkout + webhooks) |
| Observability | Sentry · BetterStack · PostHog |
| Uploads / Search | Uploadthing · Meilisearch |
| Scheduling | `@repo/calendar` — zero-dependency civil-time + RRULE recurrence engine; calendars, events, invitations, reminders |
| Tooling | Biome + ESLint (Next plugin) · Vitest · Playwright |
| Deployment | Docker (multi-stage, platform-agnostic) |
Full rationale for every choice in [`docs/context/STACK.md`](docs/context/STACK.md).
## Quickstart
**Prerequisites:** Node.js **24+** (see [`.nvmrc`](.nvmrc)), pnpm **11+** (`corepack enable`),
and Docker (for local Postgres).
```bash
cp .env.example .env # fill in secrets (DB + auth)
docker compose -f docker/docker-compose.yml up -d # start Postgres + Meilisearch
pnpm install
pnpm --filter @repo/db db:migrate # apply migrations
pnpm dev # http://localhost:3000
```
> On Windows, `cp` isn't a builtin — use `pnpm init-app` (below) or
> `Copy-Item .env.example .env`.
## Use this template
Start a new app from this boilerplate, then run the cross-platform init helper:
```bash
# GitHub: click "Use this template" → clone your new repo, OR grab a history-less copy:
npx degit jrittelmeyer/next-web-boilerplate my-app
cd my-app
pnpm install
pnpm init-app --name my-app # seeds .env from .env.example, renames the root package
```
`pnpm init-app` is **optional and additive** — it only seeds `.env` (never overwriting
an existing one) and, with `--name`, renames the root `package.json` + README title.
Everything it does you can do by hand; nothing needs to be ripped out. After it runs,
follow the [Quickstart](#quickstart) from `docker compose … up` onward.
Developing with **Claude Code**? After `pnpm install`, hand **`/project-init`** your
idea or your plan documents — the preinstalled
[ai-dev-kit](https://github.com/jrittelmeyer/ai-dev-kit) inception skill runs
discovery (clarifying questions, gap analysis, a competitive
scan, a map of which shipped integrations your product actually needs), writes your
product brief, regenerates the status/backlog docs around *your* app (running
`init-app` for you along the way), and starts the build pipeline.
## Scripts
```bash
pnpm dev # run all apps in dev
pnpm build # build everything (Turbo-cached)
pnpm lint # Biome + ESLint
pnpm type-check # TypeScript across all packages
pnpm test # Vitest
pnpm test:e2e # Playwright
pnpm format # Biome formatter
pnpm storybook # @repo/ui component gallery → http://localhost:6006
pnpm clean # per-package build artifacts (dist/.next) — NOT the Turbo cache
pnpm cache:prune # evict oldest Turbo-cache entries to the size cap (default 20 GB)
```
> Browse the shared UI primitives online — the
> **[hosted Storybook gallery](https://jrittelmeyer.github.io/next-web-boilerplate/)**,
> republished from `@repo/ui` on every change (no clone or server needed).
## Layout
```text
apps/web/ — the Next.js application (src/ layout)
packages/db/ — Drizzle schema, migrations, client (@repo/db)
packages/auth/ — Better Auth config + session helpers (@repo/auth)
packages/calendar/ — calendar civil-time + recurrence engine (@repo/calendar)
packages/email/ — React Email templates + Resend client (@repo/email)
packages/jobs/ — pg-boss background-jobs worker + enqueue helper (@repo/jobs)
packages/observability/ — BetterStack dashboards-as-code, dev/CI-only (@repo/observability)
packages/ui/ — shadcn/ui shared components (@repo/ui)
packages/validators/ — Zod schemas shared client + server (@repo/validators)
tooling/ — shared eslint / typescript / tailwind configs
docs/ — PROJECT_STATUS + on-demand context docs
docker/ — Dockerfile + docker-compose for local dev
```
## Documentation
| Read this | For |
| --- | --- |
| [`docs/FEATURES.md`](docs/FEATURES.md) | **What's included — and why.** The full inventory with per-choice rationale. |
| [`docs/GETTING_STARTED.md`](docs/GETTING_STARTED.md) | **Using this template.** Clone → run → rename → remove what you don't need → production. |
| [`docs/plain-english-guide/`](docs/plain-english-guide/) | **The zero-jargon tour.** A 13-chapter plain-English explainer (no technical background needed) + a pitch deck — what this is, why each piece was chosen, and how it was built with AI agents. |
| [`AGENTS.md`](AGENTS.md) | **Agent-assisted development.** Onboarding for coding agents (and a great human overview): working agreements + the per-task context-doc index. |
| [`docs/MAINTENANCE.md`](docs/MAINTENANCE.md) | **Keeping it current.** Dependency policy, Renovate, upgrade runbook, watch items. |
| [`docs/context/`](docs/context/) | **Deep dives**, loaded on demand: `STACK`, `ARCHITECTURE`, `CONVENTIONS`, `DATABASE`, `AUTH`, `API`, `STATE`, `UI`, `I18N`, `TESTING`, `SERVICES`, `SECURITY`, `DEPLOYMENT`, `DECISIONS`, plus the `auth/`, `services/` and `calendar/` topic directories. |
| [`docs/PROJECT_STATUS.md`](docs/PROJECT_STATUS.md) · [`CHANGELOG.md`](CHANGELOG.md) | What's built + verified, and the release record. |
## Support this project
If this boilerplate saved you time, a ⭐ on the repo helps others find it, and you
can [say thanks via PayPal](https://paypal.me/JohnRittelmeyerDev) (also behind the
repo's Sponsor button). Issues and PRs are just as valuable — see below.
## Contributing
Issues and pull requests are welcome — see [`CONTRIBUTING.md`](CONTRIBUTING.md) for
setup, the quality gate, and conventions, and the [`Code of Conduct`](CODE_OF_CONDUCT.md).
Report security issues privately via the [security policy](.github/SECURITY.md).
## License
[MIT](LICENSE) — use it freely as a starting point for your own projects.
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

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 · 启动器
