A modern, production-ready Next.js template with TypeScript, comprehensive tooling, and developer experience optimizations.
- ⚡ Next.js 15 - Latest version with App Router support
- 🔷 TypeScript - Full type safety and IntelliSense
- 🎨 Sass/SCSS - Advanced styling with CSS Modules support
- 🔧 ESLint - Code linting with Next.js and TypeScript rules
- 💅 Prettier - Code formatting
- 🎯 Stylelint - CSS/SCSS linting and formatting
- 🚀 Plop.js - Component and page generation
- 🔒 Pre-commit hooks - Automated code quality checks
- 📦 Dependabot - Automated dependency updates
- 🖼️ SVG support - Import SVGs as React components
- 📱 Responsive - Mobile-first design approach
- 🛠️ Path aliases - Clean imports with
@/prefix
- Node.js 20.19.0+
- Yarn (recommended) or npm
-
Clone the template
git clone <your-repo-url> cd next-js-template
-
Install dependencies
yarn install # or npm install -
Start development server
yarn dev # or npm run dev -
Open your browser Navigate to http://localhost:3000
next-js-template/
├── pages/ # Next.js pages (legacy Pages Router)
│ ├── _app.tsx # App wrapper
│ ├── index.tsx # Home page
│ ├── globals.scss # Global styles
│ └── api/ # API routes
├── src/
│ ├── components/ # Reusable components
│ │ └── Button/ # Component folder structure
│ └── pages/ # Page components
├── public/ # Static assets
├── templates/ # Plop.js templates
├── plopfile.js # Component/page generators
└── next.config.js # Next.js configuration
Generate components and pages quickly with Plop.js:
# Generate a component
yarn plop component
# Generate a page
yarn plop pageThe template includes automated code quality checks:
- ESLint - JavaScript/TypeScript linting
- Prettier - Code formatting
- Stylelint - CSS/SCSS linting
- Husky - Git hooks for pre-commit checks
# Development
yarn dev # Start development server
yarn build # Build for production
yarn start # Start production server
# Code Quality
yarn lint # Run ESLint
yarn lint:fix # Fix ESLint issues
yarn format # Format code with Prettier
yarn stylelint # Run Stylelint
yarn stylelint:fix # Fix Stylelint issuesComponents use CSS Modules with Sass for scoped styling:
import styles from "./Button.module.scss";
const Button = () => {
return <button className={styles.button}>Click me</button>;
};Global styles are defined in pages/globals.scss and imported in _app.tsx.
Import SVGs as React components:
import Logo from "@/public/logo.svg";
const Header = () => {
return <Logo className="logo" />;
};- Strict mode enabled
- Path aliases configured (
@/components/*,@/pages/*) - CSS Modules type support
- SVG support via
@svgr/webpack - Optimized for performance
- SEO-friendly
- Next.js recommended rules
- TypeScript support
- Prettier integration
- Standard CSS rules
- SCSS support
- Prettier integration
- Property ordering
- Next.js 15 - React framework
- React 19 - UI library
- TypeScript - Type safety
- Sass - CSS preprocessor
- CSS Modules - Scoped styling
- ESLint - Code linting
- Prettier - Code formatting
- Stylelint - CSS linting
- Plop.js - Code generation
- Husky - Git hooks
- lint-staged - Pre-commit checks
- Push your code to GitHub
- Connect your repository to Vercel
- Deploy automatically
The template is compatible with any platform that supports Next.js:
- Netlify
- AWS Amplify
- Railway
- DigitalOcean App Platform
- Fork the repository
- Create a feature branch
- Make your changes
- Run quality checks:
yarn lint && yarn stylelint - Commit your changes
- Push to the branch
- Create a Pull Request
This template is open source and available under the MIT License.
If you encounter any issues or have questions:
- Check the Next.js documentation
- Review the TypeScript documentation
- Open an issue in this repository
Happy coding! 🎉