A modern Next.js template with TypeScript, Tailwind CSS v4, and a complete developer experience setup.
- Next.js 16 with React 19
- TypeScript for type safety
- Tailwind CSS v4 for styling
- Biome for fast linting and formatting
- React Compiler enabled for automatic optimizations
- Git Hooks (Husky + Commitlint + lint-staged)
- Pre-commit: Auto-format and lint staged files
- Commit-msg: Validate conventional commit messages
- Pre-push: Run full lint and type checks
# Install dependencies
bun install
# Start development server
bun devVisit http://localhost:3000 to see your app.
Clone this repo for a new project, then run init to wipe git history and rename everything:
git clone https://github.com/chev0004/Nextjs-Template.git my-project && cd my-project
bun run init my-project
bun install
bun devThe init script will: remove existing git history, run git init, create develop branch, set package.json name, update README/layout metadata, and commit everything as "Initial commit".
bun dev- Start development serverbun build- Build for productionbun start- Start production serverbun lint- Run linting checksbun lint:fix- Fix linting issues automaticallybun format- Format codebun type-check- Run TypeScript type checking
This template includes a comprehensive Biome setup optimized for Next.js:
Formatter:
- 2-space indentation
- 80 character line width
- Single quotes for JavaScript/TypeScript
- Auto-organize imports
Linter:
- Next.js domain rules enabled
- Strict rules for unused imports/variables
- Next.js-specific rules (no
<img>, no<head>in pages, etc.) - Tailwind CSS directive support
- Auto-fix for safe transformations
Overrides:
- Allows default exports in Next.js app/pages directories
- Config files and middleware exempt from default export rule
This template uses Conventional Commits. Examples:
feat: add user authenticationfix: resolve navigation bugdocs: update READMErefactor: simplify component structure
src/
└── app/
├── layout.tsx
├── page.tsx
├── globals.css
├── loading.tsx
├── error.tsx
└── not-found.tsx