Turborepo monorepo 结构,包含 web、docs、storybook 三个应用与 ui、utils、tsconfig 三个共享包
turborepo-shadcn-nextjs — Next.js 启动器模板
作者 gmickel
基于 Turborepo 的 monorepo 启动模板,集成 Next.js 应用、Nextra 文档站、Storybook 与共享的 shadcn/ui 组件包,使用 Bun 与 Biome。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 2
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
共享的 @repo/ui 包基于 shadcn/ui,可通过 bun ui:add:component 命令添加组件
使用 Bun 作为运行时与包管理器,Biome 负责 lint 与格式化
内置 Vitest 单元测试、Playwright 端到端测试与 Storybook 组件开发环境
预置 GitHub Actions CI、Dependabot 自动更新与贡献者列表自动刷新工作流
web 与 docs 应用支持直接部署到 Vercel,Storybook 自动发布到 GitHub Pages
模板详细介绍
这是一个 Turborepo monorepo 启动模板,仓库结构由 apps 与 packages 两部分组成。apps 下包含 @repo/web(Next.js 主应用)、@repo/docs(基于 Nextra 的文档站)和 @repo/storybook(组件开发与展示环境);packages 下包含 @repo/ui(由 shadcn/ui 驱动的共享 React 组件与设计系统)、@repo/utils(共享 React 工具)和 @repo/tsconfig(共享 TypeScript 配置)。所有应用与包均使用 TypeScript。
模板预置了 Vitest 单元测试、Playwright 端到端测试、Biome 代码检查与格式化、Changesets 版本管理以及 Storybook 组件文档。Storybook 同时覆盖 @repo/web 与 @repo/ui 的组件,并配置了 links、essentials、onboarding、interactions、themes、styling-webpack 等插件。
仓库附带 GitHub Actions CI,在推送到 main 或提交 PR 时执行安装、构建、单元测试、端到端测试与 lint;另有 Dependabot 依赖更新、Dependabot PR 自动合并和贡献者列表自动刷新等工作流。部署方面,web 与 docs 应用可直接部署到 Vercel,Storybook 通过自定义工作流发布到 GitHub Pages。README 中 Changesets 的版本发布部分标注为 WIP,尚未完成。
适合你的项目吗?
适用场景
- 需要同时维护主应用、文档站与共享组件库的 TypeScript 项目
- 希望以 monorepo 方式统一管理多个 Next.js 应用与内部包
- 需要在项目初期就接入单元测试、端到端测试与组件文档的团队
- 希望使用 shadcn/ui 作为共享设计系统基础并集中管理组件
- 计划将前端应用部署到 Vercel、将组件文档发布到 GitHub Pages 的项目
适合人群
- 熟悉 Turborepo、Next.js 与 Bun 的前端团队
- 需要 monorepo 结构承载应用与共享 UI 库的开发者
- 希望预置 CI、测试与代码规范工具链的启动项目
- 使用 shadcn/ui 并需要跨应用复用组件的项目
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
需要先安装 Bun,然后执行 bun install 安装依赖,bun dev 启动开发服务
- 2
通过 bun ui:add:component <component-name> 向 @repo/ui 包添加 shadcn/ui 组件
- 3
使用 bun turbo gen workspace 可新增应用或包,复制现有工作区后需重新执行 bun install
- 4
启用 Dependabot 自动合并需在仓库 Settings > Actions > General 中开启读写权限并允许 GitHub Actions 创建和批准 PR
- 5
web 与 docs 应用部署到 Vercel 无需额外配置,Storybook 通过 .github/workflows/storybook-deploy.yml 发布到 GitHub Pages
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 启用 Dependabot PR 自动合并工作流时,需在仓库设置中开启 Actions 读写权限并允许创建和批准 PR;可选地创建具有 repo 权限的 Personal Access Token 并配置为 GITHUB_TOKEN 密钥。
- web 与 docs 应用部署依赖 Vercel 平台;Storybook 通过 GitHub Actions 工作流发布到 GitHub Pages,需使用 GitHub 仓库与 Actions 服务。
- Changesets 版本管理与发布功能在 README 中标注为 WIP,尚未完成,不能视为可直接使用的发布流程。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
Optionally, create a Personal Access Token (PAT) with `repo` scope and add it as a repository secret named `GITHUB_TOKEN` for enhanced security.
README 原文
The `docs` and `web` apps can be deployed to Vercel without any additional configuration.
README 原文
https://github.com/gmickel/turborepo-shadcn-nextjs/blob/main/LICENSEhttps://github.com/gmickel/turborepo-shadcn-nextjs/blob/main/README.mdbun changeset` - Generate a changeset 🧑🔧 - WIP
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-03。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 91 / 100
- 技术栈
- Next.js · React
- 网站类型
- 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-09-27
- 截图检查日期
- 2026-10-03
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
审核声明: [email protected] · 2026-10-04
查看当时使用的来源资料
SHA-256: fbd13477a0702a9dbfdb082beb66f0b215306d9d330d46423cc40a907b20daa7
2026-10-03T17:18:39.594Z
来源文件 / 仓库# 🚀 Turborepo Starter with Next.js, Nextra, and shadcn/ui

[](https://github.com/gmickel/turborepo-shadcn-nextjs/actions/workflows/ci.yml)
[](https://snyk.io/test/github/gmickel/turborepo-shadcn-nextjs)
[](https://github.com/gmickel/turborepo-shadcn-nextjs/blob/main/LICENSE)

A powerful monorepo starter template featuring Next.js, Nextra, and a shared pre-configured shadcn/ui package, powered by Bun, Vitest, Playwright, Storybook, and Biome.
* [🌟 Features](#-features)
* [🚀 Quick Start](#-quick-start)
* [📦 What's Inside?](#-whats-inside)
* [🛠️ Useful Commands](#️-useful-commands)
* [🧰 Development Tools](#-development-tools)
* [🚀 Deployment](#-deployment)
* [🔗 Useful Links](#-useful-links)
* [👥 Contributors](#-contributors)
## 🌟 Features
* 📦 Monorepo structure with Turborepo for efficient build system and caching
* ⚡ Next.js for fast, server-side rendered React applications
* 📚 Nextra for easy-to-create documentation sites
* 🎨 shadcn/ui for beautiful, customizable UI components
* 🐰 Bun as a fast, all-in-one JavaScript runtime
* 🧪 Vitest for speedy unit testing
* 🎭 Playwright for reliable end-to-end testing
* 📖 Storybook for isolated component development and documentation
* 🌿 Biome for fast, opinionated linting and formatting
* 🔄 Automated dependency management with Dependabot
* 👥 Automated contributor recognition
* 🚀 CI/CD setup with GitHub Actions
## 🚀 Quick Start
```sh
# Clone the repository
git clone https://github.com/gmickel/turborepo-shadcn-nextjs.git
# Navigate to the project directory
cd turborepo-shadcn-nextjs
# Install dependencies
bun install
# Start development server
bun dev
```
### Add UI Components
```sh
bun ui:add:component <component-name>
```
> This works just like the add command in the `shadcn/ui` CLI. 🎨
## What's inside? 📦
```mermaid
graph TD
A[Turborepo] --> B[Apps]
A --> C[Packages]
B --> D[@repo/docs]
B --> E[@repo/web]
B --> F[@repo/storybook]
C --> G[@repo/ui]
C --> H[@repo/utils]
C --> I[@repo/tsconfig]
```
| App/Package | Description |
|-------------|-------------|
| `@repo/docs` | Documentation site powered by [Nextra 3 alpha](https://the-guild.dev/blog/nextra-3) 📖 |
| `@repo/web` | Main Next.js web application 🌐 |
| `@repo/ui` | Core React components and design system shared by both `web` and `docs` applications (powered by shadcn/ui) 🎨 |
| `@repo/utils` | Shared React utilities 🛠️ |
| `@repo/tsconfig` | Shared `tsconfig.json` configurations 🛡️ |
Each package and app is 100% [TypeScript](https://www.typescriptlang.org/). 💪
### Utilities 🧰
This Turborepo has some additional tools already set up for you:
* [TypeScript](https://www.typescriptlang.org/) for static type checking ✅
* [Biome](https://biomejs.dev/) for code linting, formatting, and fixing 🌿
* [Vitest](https://vitest.dev/) for unit tests 🧪
* [Playwright](https://playwright.dev/) for end-to-end tests 🧪
* [Changesets](https://github.com/changesets/changesets) for managing versioning, changelogs, and publishing 📝
* [Storybook](https://storybook.js.org/) for component development and documentation 📚
### Storybook 📚
This Turborepo includes Storybook for component development and documentation. Storybook is set up for both the `@repo/web` and `@repo/ui` packages, allowing the development and showcasing of components from both your main application and your shared UI library.
To run Storybook:
```sh
bun storybook
```
This will start Storybook and open it in your default browser.
#### Story Location
Storybook is configured to find stories in the following locations:
* `apps/storybook/src/**/*.mdx`
* `apps/storybook/src/**/*.stories.@(js|jsx|mjs|ts|tsx)`
* `apps/web/src/**/*.stories.@(js|jsx|mjs|ts|tsx)`
* `packages/ui/src/**/*.stories.@(js|jsx|mjs|ts|tsx)`
This configuration allows you to write stories for components in both your web application and your shared UI library.
#### Storybook Addons
This setup includes several useful Storybook addons:
* `@storybook/addon-links`: For linking between stories
* `@storybook/addon-essentials`: A curated set of addons for a great developer experience
* `@storybook/addon-onboarding`: For onboarding new users
* `@storybook/addon-interactions`: For testing component interactions
* `@storybook/addon-themes`: For theme switching in Storybook
* `@storybook/addon-styling-webpack`: For handling CSS and PostCSS in Storybook
### Useful commands 🤖
* `bun build` - Build all apps and packages
* `bun dev` - Develop all apps and packages
* `bun dev:ui` - Develop all apps and packages and display the output in Turbo's new experimental UI
* `bun test` - Run all tests with vitest
* `bun test:cov` - Run all unit tests with vitest and generate a coverage report
* `bun test:cov:ui` - Run all unit tests with vitest and display the vitest UI
* `bun test:e2e` - Run all end-to-end tests with playwright
* `bun lint` - Lint and format all packages
* `bun lint:fix` - Lint, format, and fix all packages
* `bun changeset` - Generate a changeset 🧑🔧 - WIP
* `bun clean` - Clean up all `node_modules` and `dist` folders (runs each package's clean script)
* `bun ui:add:component` - Add a shadcn/ui component to the `@repo/ui` package
* `bun storybook` - Run Storybook for component development and documentation
### Add a new app or package 📦
Turborepo offers a simple command to add new apps or packages to the monorepo. To add a new app, run the following command:
```sh
bun turbo gen workspace [--name <app-name>]
```
You will be prompted to choose the name and workspace type (app or package) to use.
You can copy an existing app or package with:
```sh
bun turbo gen workspace [--name <app-name>] --copy
```
You will be prompted to choose the name and workspace type (app or package) of the new app and which app or package to copy.
> [! NOTE]
> Remember to run `bun install` after copying an app. ⚠️
### CI 🤖
[](https://github.com/gmickel/turborepo-shadcn-nextjs/actions/workflows/ci.yml)
This Turborepo uses [GitHub Actions](https://github.com/features/actions) for CI. 🤖
It comes preconfigured with the following workflow that runs on every push or pull request to the `main` branch:
1. **Setup**: Checks out the code and sets up Bun.
2. **Install**: Installs all dependencies using Bun.
3. **Build**: Builds all apps and packages in the monorepo.
4. **Unit Tests**: Runs all unit tests using [Vitest](https://vitest.dev/).
5. **E2E Tests**: Installs Playwright browsers and runs end-to-end tests using [Playwright](https://playwright.dev/).
6. **Lint**: Performs linting and formatting checks using [Biome](https://biomejs.dev/).
### Automated Dependency Management & Contributor Recognition 🤖
This template includes some useful automation tools:
#### 1. Dependabot Configuration 🔄
Keeps dependencies up-to-date automatically with daily checks and update rules.
[View Dependabot Config](.github/dependabot.yml)
#### 2. Auto-merge for Dependabot PRs 🔀
Can automatically merges patch updates from Dependabot to reduce manual work.
[View Auto-merge Workflow](.github/workflows/auto-merge-dependabot.yml)
For the auto-merge workflow:
* Go to your repository's Settings > Actions > General.
* Under "Workflow permissions", select "Read and write permissions".
* Check "Allow GitHub Actions to create and approve pull requests".
* Save the changes.
* Optionally, create a Personal Access Token (PAT) with `repo` scope and add it as a repository secret named `GITHUB_TOKEN` for enhanced security.
#### 3. Automated Contributors List 🙌
Maintains an up-to-date list of contributors in your README.
[View Contributors Workflow](.github/workflows/contributors.yml)
### 🚀 Getting Started
1. Dependabot is active out-of-the-box. Review and adjust the config as needed.
2. Ensure proper permissions for the auto-merge workflow.
3. To read more about the contributors list, see the [contributors-readme-action](https://github.com/akhilmhdh/contributors-readme-action) README.
## Versioning and Publishing packages 📦
🧑🔧 WIP
For more information, refer to the official [Changesets documentation](https://github.com/changesets/changesets/blob/main/docs/automating-changesets.md).
## Deployment 🚀
This Turborepo is set up for easy deployment of its various applications.
### Vercel Deployment 🌐
The `docs` and `web` apps can be deployed to Vercel without any additional configuration. This allows for quick and easy deployment of your Next.js applications.
#### Test Deployments
You can view the test deployments for these apps:
* `apps/web`: [https://turborepo-shadcn-nextjs-web.vercel.app/](https://turborepo-shadcn-nextjs-web.vercel.app/)
* `apps/docs`: [https://turborepo-shadcn-nextjs-docs.vercel.app/](https://turborepo-shadcn-nextjs-docs.vercel.app/)
### Storybook Deployment 📚
The `apps/storybook` is automatically deployed to GitHub Pages using a custom workflow.
* **Workflow File**: You can find the deployment workflow at `.github/workflows/storybook-deploy.yml`
* **Deployment URL**: The deployed Storybook can be accessed at [https://gmickel.github.io/turborepo-shadcn-nextjs/](https://gmickel.github.io/turborepo-shadcn-nextjs/)
## Useful Links and Thanks 🙏
### Build Tools and Configuration
* [Turborepo Documentation](https://turbo.build/repo/docs)
+ [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
+ [Caching](https://turbo.build/repo/docs/core-concepts/caching)
+ [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
+ [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
+ [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
+ [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)
* [Bun Documentation](https://bun.sh/docs)
* [Biome Documentation](https://biomejs.dev/guides/getting-started/)
### Frameworks and Libraries
* [Next.js Documentation](https://nextjs.org/docs)
* [Nextra Documentation](https://nextra.site/docs)
* [shadcn/ui Documentation](https://ui.shadcn.com/docs)
### Testing Tools
* [Vitest Documentation](https://vitest.dev/guide/)
* [Playwright Documentation](https://playwright.dev/docs/intro)
### Development Tools
* [Storybook Documentation](https://storybook.js.org/docs)
* [Changesets Documentation](https://github.com/changesets/changesets)
## Contributors 👨💻
<!-- readme: collaborators, contributors -start -->
<table>
<tbody>
<tr>
<td align="center">
<a href="https://github.com/gmickel">
<img src="https://avatars.githubusercontent.com/u/139907?v=4" width="100;" alt="gmickel"/>
<br />
<sub><b>Gordon Mickel</b></sub>
</a>
</td>
</tr>
<tbody>
</table>
<!-- readme: collaborators, contributors -end -->
## CI cadence
PRs and main pushes run the deterministic build, unit tests, Chromium smoke and lint.
Superseded PR runs are cancelled. Dependency updates are grouped weekly at the workspace root;
Storybook publishes only when its inputs change. Contributor refreshes run weekly or manually.
Run focused tests locally during edits; no scheduled browser suite is needed for this template.
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

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