百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

turborepo-shadcn-nextjs

> 前端框架
开源

一个 Turborepo 启动模板,包含 Next.js、Nextra、Storybook 以及一个共享的预配置 shadcn/ui 包,由 Bun 和 Biome 提供支持

99 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个 Turborepo 启动模板,包含 Next.js、Nextra、Storybook 以及一个共享的预配置 shadcn/ui 包,由 Bun 和 Biome 提供支持

Turborepo Starter with Next.js, Nextra, and shadcn/ui

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
  • Quick Start
  • What's Inside?
  • ️ Useful Commands
  • Development Tools
  • Deployment
  • Useful Links
  • 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

bash
# 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

bash
bun ui:add:component 

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
@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.

Utilities

This Turborepo has some additional tools already set up for you:

  • TypeScript for static type checking ✅
  • Biome for code linting, formatting, and fixing
  • Vitest for unit tests
  • Playwright for end-to-end tests
  • Changesets for managing versioning, changelogs, and publishing
  • Storybook 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:

bash
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:

bash
bun turbo gen workspace [--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:

bash
bun turbo gen workspace [--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

This Turborepo uses GitHub 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.
  5. E2E Tests: Installs Playwright browsers and runs end-to-end tests using Playwright.
  6. Lint: Performs linting and formatting checks using Biome.

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

2. Auto-merge for Dependabot PRs

Can automatically merges patch updates from Dependabot to reduce manual work.

View Auto-merge Workflow

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

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 README.

Versioning and Publishing packages

‍ WIP

For more information, refer to the official Changesets documentation.

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/
  • apps/docs: 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/

Useful Links and Thanks

Build Tools and Configuration

  • Turborepo Documentation
    • Tasks
    • Caching
    • Remote Caching
    • Filtering
    • Configuration Options
    • CLI Usage
  • Bun Documentation
  • Biome Documentation

Frameworks and Libraries

  • Next.js Documentation
  • Nextra Documentation
  • shadcn/ui Documentation

Testing Tools

  • Vitest Documentation
  • Playwright Documentation

Development Tools

  • Storybook Documentation
  • Changesets Documentation

Contributors ‍

                Gordon Mickel

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.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptbiomejsbunnextjs-templatenextjs14

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架