A minimal Next.js starter with Next.js 16, Tailwind CSS v4, TypeScript, ESLint 10 (flat config), Prettier, and Husky.
- Next.js 16 – App Router, Turbopack, React Compiler (prod)
- Tailwind CSS v4 – CSS-first config (
@themeinglobals.css) - TypeScript – Strict mode
- ESLint 10 – Flat config with Next, TypeScript, Prettier, React Compiler
- Prettier – Import sort + Tailwind class sorting
- Husky + lint-staged – Pre-commit: ESLint + Prettier on staged files
Node.js ≥ 20.9.0
bunx create-next-app -e "https://github.com/Khushal-ag/nextjs-template" <project-name>Install dependencies
bun i
# or: pnpm i | yarn | npm iInitialize git (optional)
git init
git add .
git commit -m "init"Husky runs on install (prepare) and sets up the pre-commit hook.
| Script | Description |
|---|---|
dev |
Start dev server (Turbopack) |
build |
Production build |
start |
Serve production build |
preview |
Build and serve (production mode) |
lint |
ESLint + TypeScript type-check |
lint:fix |
ESLint with auto-fix |
type-check |
TypeScript type-check only |
fmt:check |
Check Prettier formatting |
fmt |
Format with Prettier |
validate |
lint + fmt:check + build (for CI) |
ui |
Shadcn UI CLI |
clean |
Remove .next cache |
cleani |
Remove .next and node_modules, reinstall |
src/app/– App Router (layout, page, robots, sitemap)src/components/– React componentssrc/config/site.ts– Site config (SEO, links, metadata)src/lib/– Utilities, fontssrc/styles/globals.css– Global styles + Tailwind@theme
Edit src/config/site.ts for your project:
name,description,url,keywordsauthors,creator,links(repo, github, social)twitter,ogImage,robots
Set NEXT_PUBLIC_SITE_URL in .env to override the base URL (e.g. per environment). See .env.example.
If you use remote images with next/image, set NEXT_PUBLIC_IMAGE_HOSTS (comma-separated hostnames, https only), for example: images.example.com,cdn.example.org.
Metadata, Open Graph, Twitter, sitemap, and robots all use this config.
- Update
package.jsonwith your project details - Update
README.mdandLICENSE - Edit
src/config/site.ts - Replace or edit
src/app/page.tsxandsrc/app/layout.tsx - Remove or repurpose
src/app/client-components.tsxif not needed
The template uses bun and keeps bun.lock. To use npm, yarn, or pnpm: remove bun.lock, then run npm i, yarn, or pnpm i. Other lockfiles are in .gitignore.
validate is package-manager agnostic, so npm run validate, pnpm validate, yarn validate, and bun run validate all work.
MIT – see LICENSE.
It may take up to 24h for the contrib.rocks plugin to update.