Next.jsReact启动器

nextjs-starter — Next.js 启动器模板

作者 MKSinghDev

基于 Next.js App Router 的启动模板,集成 TypeScript、Tailwind CSS、shadcn/ui、next-intl 多语言、Biome 代码检查与 Vitest/Playwright 测试,使用 Bun 作为包管理器。

看看你的网站会是什么样

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

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

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

全部页面与视图 2

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

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

值得关注的模板亮点

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

01

Next.js App Router 与 Server Components,TypeScript 严格模式

02

Tailwind CSS 与 shadcn/ui 组件,按原子设计组织组件目录

03

next-intl 国际化:区域变体 URL、基础语言加覆盖模型、YAML 字典编译为 JSON

04

Biome 统一负责 lint、格式化与导入排序,配合 Husky、lint-staged、Commitlint

05

Vitest 单元/组件测试与 Playwright 端到端测试,含组件测试覆盖治理脚本

06

使用 Bun 作为包管理器,提供 dev、build、test-all 等脚本

模板详细介绍

该模板是一个 Next.js 启动项目,使用 App Router 与 Server Components,采用 TypeScript 严格模式,样式基于 Tailwind CSS 并集成 shadcn/ui 组件。组件按原子设计(atoms、molecules、organisms、ui)组织,路由位于 src/app/[locale] 下。

国际化使用 next-intl,采用基础语言加区域覆盖的模型:URL 只暴露区域变体(en-US、en-GB、es-ES、es-MX、hi-IN),每个区域变体通过 baseOf 映射到基础语言(en、es、hi),基础语言不直接出现在 URL 中。字典以 YAML 编写在 locales/ 下,由 scripts/gen-messages.ts 编译为 messages/ 下的 JSON 与 index.ts,messages/ 被 gitignore,并在每次构建、开发或类型检查时重新生成。运行时按请求深度合并基础字典与区域覆盖。键值类型完整,useTranslations 与 t() 可基于 en 参考结构自动补全。README 说明如需移除 i18n,可运行 remove-i18n skill 或参照其文件手动移除。

代码质量方面使用 Biome 进行 lint、格式化与导入排序,Husky 与 lint-staged 执行提交前检查,Commitlint 约束提交信息。测试包括 Vitest 单元/组件测试与 Playwright 端到端测试,并有 test:governance 脚本断言每个编写的组件在 tests/ 下都有对应测试。项目还包含 CLAUDE.md、AGENTS.md、STANDARDS.md、TESTING.md、SKILLS.md 等文档。README 未提供关于部署平台、性能指标或生产就绪程度的说明。

Next.js启动器

适合你的项目吗?

适用场景

  • 需要 Next.js App Router 与 TypeScript 严格模式起步的新项目
  • 希望使用 Tailwind CSS 与 shadcn/ui 搭建界面并采用原子设计组织组件
  • 需要基于 next-intl 的区域变体 URL 与基础语言加覆盖的多语言方案
  • 希望统一使用 Biome 进行代码检查、格式化与导入排序并配置提交前检查
  • 需要 Vitest 单元/组件测试与 Playwright 端到端测试的初始配置

适合人群

  • 使用 Next.js App Router 并希望以 TypeScript 严格模式开发的前端项目
  • 需要内置多语言(区域变体 URL、YAML 字典)的站点
  • 偏好 Tailwind CSS 与 shadcn/ui 并接受原子设计目录结构的团队
  • 希望以 Biome 替代 ESLint/Prettier 并配置提交前检查的项目
  • 需要单元/组件测试与端到端测试基础配置的开发者

上手与定制指南

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

  1. 1

    前置要求:Node.js v24 或更高版本,推荐使用 Bun,也可使用 pnpm、yarn 或 npm

  2. 2

    克隆仓库后执行 bun install 安装依赖,使用 bun dev 启动开发服务器并访问 http://localhost:3000

  3. 3

    i18n 字典在 locales/ 下以 YAML 编写,由 scripts/gen-messages.ts 编译到 messages/,该目录被 gitignore,会在构建、开发或类型检查时重新生成

  4. 4

    常用脚本包括 dev、build、start、lint、format、check-types、test、test:run、test:coverage、test:governance、test:e2e、test-all

  5. 5

    如需移除 i18n,README 说明可运行 remove-i18n skill 或参照其文件手动移除

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

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

项目核对记录与介绍依据

模板资料

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

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

这个项目需要核对什么

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

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

审核声明: codex-user-requested-batch-review-20261015 · 2026-10-15

查看当时使用的来源资料

SHA-256: aa8881432f80e8d4a5437b65d4bf8a360596af7a6f3984d656a0c27dd0d15bd0

2026-10-13T22:42:22.025Z

来源文件 / 仓库
# Next.js Starter Template

A modern Next.js starter template with App Router, TypeScript, Tailwind CSS v4, shadcn/ui, and a comprehensive linting setup.

## Features

- **Next.js 16** with App Router and Server Components
- **TypeScript** in strict mode
- **Tailwind CSS v4** with shadcn/ui components
- **Atomic Design** component architecture (atoms, molecules, organisms)
- **next-intl** i18n with base+overlay locale model and YAML-authored dictionaries
- **Biome** for linting, formatting, and import sorting (one tool, fast)
- **Husky & lint-staged** for pre-commit code quality checks
- **Commitlint** for conventional commit messages
- **Bun** as the package manager

## Getting Started

### Prerequisites

- Node.js (v24 or later)
- [Bun](https://bun.sh/) (recommended) or any package manager (`pnpm`, `yarn`, `npm`)

### Installation

```bash
git clone https://github.com/MKSinghDev/nextjs-starter.git
cd nextjs-starter
bun install
```

### Development

```bash
bun dev
```

Open [http://localhost:3000](http://localhost:3000) in your browser.

## Scripts

| Script           | Description                                                      |
| ---------------- | ---------------------------------------------------------------- |
| `dev`            | Compile i18n YAML once, then run watcher + Next dev in parallel  |
| `build`          | Compile i18n YAML, then build for production                     |
| `start`          | Start the production server                                      |
| `gen:i18n`       | Compile `messages/**/*.yaml` → sibling `.json` (source of truth) |
| `gen:i18n:watch` | Same as `gen:i18n` plus chokidar watcher for live regen          |
| `lint`           | Lint with Biome                                                  |
| `lint:fix`       | Lint and auto-fix with Biome                                     |
| `format`         | Format code with Biome                                           |
| `check-types`    | Compile i18n YAML, then type-check with TypeScript               |
| `check-format`   | Check formatting without writing                                 |
| `check-lint`     | Lint without writing                                             |
| `test`           | Run unit/component tests (Vitest) in watch mode                  |
| `test:run`       | Run unit/component tests once                                    |
| `test:coverage`  | Run unit/component tests with coverage thresholds                |
| `test:governance`| Assert every authored component has a mirror test in `tests/`    |
| `test:e2e`       | Run Playwright end-to-end tests                                  |
| `test-all`       | Run format, lint, type-check, governance, coverage, and build    |

## Project Structure

```
.
├── locales/                    # i18n YAML source (committed)
│   ├── en/                     # base locale (full dict)
│   ├── en-GB/ en-US/           # regional overlays (partial deltas or .gitkeep)
│   ├── es/ es-ES/ es-MX/
│   └── hi/ hi-IN/
├── messages/                   # i18n generated output (JSON + index.ts, GITIGNORED)
├── scripts/
│   ├── gen-messages.ts         # locales/ → messages/ compiler (one-shot + watch)
│   └── test-governance.ts      # asserts every component has a mirror test
├── tests/                      # unit/component tests (Vitest), mirrors src/ tree
│   └── support/                # shared test helpers (renderWithIntl)
├── e2e/                        # end-to-end tests (Playwright)
├── src/
│   ├── app/                    # Next.js App Router
│   │   ├── [locale]/           # all routes nested under locale segment
│   │   │   └── (pages)/        # route groups for pages
│   │   ├── globals.css         # Global styles
│   │   └── layout.tsx          # Root layout
│   ├── components/
│   │   ├── atoms/              # Basic building blocks (no internal deps)
│   │   ├── molecules/          # Composed from atoms only
│   │   ├── organisms/          # Composed from atoms and/or molecules
│   │   └── ui/                 # shadcn/ui components (CLI-managed)
│   ├── hooks/                  # Shared custom hooks
│   ├── i18n/                   # routing, base/overlay loaders, request config
│   ├── lib/                    # Utilities, constants, interfaces, config
│   ├── global.d.ts             # AppConfig augment + MessageShape/MessageOverride
│   └── proxy.ts                # next-intl locale middleware (Next 16 name)
├── CLAUDE.md                   # AI agent instructions (imports the files below)
├── AGENTS.md                   # Next.js agent rules
├── STANDARDS.md                # Project coding standards
├── TESTING.md                  # Testing standards (unit/component + E2E)
├── SKILLS.md                   # Recommended Claude Code skills
├── biome.json                  # Biome lint + format configuration
├── next.config.ts              # Next.js configuration (wrapped with next-intl plugin)
└── tsconfig.json               # TypeScript configuration
```

## Internationalization

- URL locales are **regional variants only** (`en-US`, `en-GB`, `es-ES`, `es-MX`, `hi-IN`). Listed in `src/i18n/routing.ts`. Default locale serves on clean paths (`/`, `/users`) via `localePrefix: 'as-needed'`; non-default keeps the prefix (`/es-MX`, `/es-MX/users`)
- Each regional variant maps to a **base locale** (`en`, `es`, `hi`) via `baseOf` in `src/i18n/bases.ts`. Bases are never URL-addressable
- Dictionaries authored in **YAML** under `locales/<locale>/*.yaml` (committed). Compiled to `messages/<locale>/*.json` + per-locale `index.ts` by `scripts/gen-messages.ts` (`messages/` is fully gitignored; regenerated on every build / dev / check-types)
- Runtime deep-merges base dict + regional overlay per request. Overlays hold only the keys that differ
- Keys are fully type-checked — `useTranslations('home')` and `t('title')` autocomplete against the `en` reference shape

Adding or editing translations, and the full locale-addition recipe, lives in [STANDARDS.md](./STANDARDS.md#internationalization-i18n).

**Don't need i18n?** Ask Claude to _"remove i18n"_ and it runs the `remove-i18n` skill at [`.claude/skills/remove-i18n/SKILL.md`](./.claude/skills/remove-i18n/SKILL.md) — that same file also serves as the manual removal checklist if you'd rather strip it by hand.

## Standards

See [STANDARDS.md](./STANDARDS.md) for the full coding standards covering naming conventions, component architecture, styling, and more, and [TESTING.md](./TESTING.md) for the testing standards (unit/component + E2E).

## Claude Code Skills

This project recommends a set of Claude Code skills that extend the AI agent with project-specific tooling (e.g. shadcn component registry access). See [SKILLS.md](./SKILLS.md) for the list and install commands.

## License

This project is licensed under the [MIT License](./LICENSE).
反馈内容错误

看看同类模板

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