A professional monorepo template with TypeScript, ESLint, Prettier, Vitest, and git hooks pre-configured.
- Node.js >= 22.22.0
- pnpm >= 10.15.0
pnpm install
pnpm lefthook installapps/
web/ # Next.js web application
packages/
ui/ # Shared React UI component library (Tailwind CSS v4 + Radix UI)
eslint-config/
typescript-config/
vitest-config/
| App | Description | Stack |
|---|---|---|
@monorepo/web |
Web application | Next.js, Tailwind v4 |
| Package | Description |
|---|---|
@monorepo/ui |
Shared UI component library |
@monorepo/typescript-config |
Shared TypeScript configurations |
@monorepo/eslint-config |
Shared ESLint configurations |
@monorepo/vitest-config |
Shared Vitest configurations |
Run from the monorepo root — NX orchestrates execution across all packages:
pnpm dev # Start dev servers
pnpm test # Run tests
pnpm test:coverage # Run tests with coverage
pnpm lint # Lint all packages
pnpm typecheck # Type-check all packages
pnpm format # Format all files with Prettier- TypeScript — strict mode with per-context configs (
node,nextjs,react-library) - ESLint — flat config with
typescript-eslintandeslint-config-prettier - Tailwind CSS v4 — shared theme via
@monorepo/ui/theme.css, class sorting viatailwindFunctions - Prettier — with
prettier-plugin-organize-importsandprettier-plugin-tailwindcss - Vitest — shared base and React configs with jsdom and Testing Library
- NX — package-based monorepo orchestration (
nx affectedfor smart task running) - Lefthook — runs Prettier and
nx affected --target=linton staged files before commit - Commitlint — enforces Conventional Commits
<type>(<scope>): <description>
- <body>
Common types: feat, fix, chore, docs, refactor, test, ci