This is a Next.js boilerplate project setup with TailwindCSS, shadcn components, Husky, lint-staged, Biome linter and formatter, and Million lint for performance testing. This setup aims to provide a robust starting point for developing high-performance web applications with a focus on best practices and development efficiency.
- Next.js: The React framework for production.
- TailwindCSS: A utility-first CSS framework for rapid UI development.
- shadcn Components: A component library designed to integrate seamlessly with TailwindCSS.
- Husky: Git hooks to automate tasks.
- lint-staged: Run linters on git staged files.
- Biome: Linter and formatter for JavaScript, TypeScript, JSON, HTML, and CSS.
- Million lint: Performance linting to ensure high-performance React components.
- Bun: The all-in-one JavaScript runtime and package manager.
Make sure you have Bun installed on your local development machine:
- Bun (>=1.0.0)
- Clone the repository:
git clone https://github.com/fzkhan19/nextjs-tailwind-shadcn-Boilerplate.git
cd nextjs-boilerplate
- Install the dependencies:
bun install
To start the development server, run:
bun dev
Open http://localhost:3000 with your browser to see the result.
To create an optimized production build, run:
bun build
Then, start the production server:
bun start
This project uses Biome for linting and formatting JavaScript, TypeScript, JSON, HTML, and CSS files. To run Biome, use:
bun lint
To automatically fix linting and formatting issues, use:
bun format
Husky and lint-staged are configured to run pre-commit hooks. This ensures that all staged files are linted and formatted before each commit. No additional setup is required; this runs automatically when you commit changes.
Million lint is configured to ensure high-performance React components. To run the performance linting, use:
bun dlx million@latest
.
├── public # Public assets
├── src
│ ├── components # React components
│ ├── pages # Next.js pages
│ ├── styles # Global styles
│ ├── utils # Utility functions
│ └── ...
├── .husky # Husky configuration
├── biome.json # Biome configuration
├── components.json # Components configuration
├── package.json # Project dependencies and scripts
└── ...
Contributions are welcome! Please open an issue or submit a pull request with any improvements or bug fixes.
This project is licensed under the MIT License.