An opinionated Next.js 14 project generator that enforces best practices, testing, and modern development workflows. This template sets up a scalable, enterprise-ready Next.js application with built-in testing, TypeScript, Tailwind CSS, shadcn/ui, and comprehensive tooling.
- App Router-based Next.js 14 setup
- Organized directory structure for scalability
- Separation of concerns with dedicated directories
- Type-safe components and utilities
- Tailwind CSS for utility-first styling
- shadcn/ui components pre-configured
- Dark mode support out of the box
- Toast notifications setup
- Jest + React Testing Library configuration
- Unit test templates
- Integration test setup
- E2E testing ready
- 80% code coverage requirement
- Automatic test file generation
- TypeScript for type safety
- ESLint with custom rule set
- Prettier for consistent formatting
- Husky for Git hooks
- Commitlint for conventional commits
- Commitizen for interactive commits
- lint-staged for efficient checks
- VS Code configuration
- Format on save
- Type checking
- Accessibility checks
- Hot reload
- Debug configuration
npm install -g enterprise-nextjs-template
# or
yarn global add enterprise-nextjs-template
# Using npx (recommended)
npx enterprise-nextjs-template new my-app
# Or if installed globally
enterprise-nextjs-template new my-app
npx enterprise-nextjs-template generate component Button
# Creates:
# - src/components/common/Button/Button.tsx
# - src/components/common/Button/Button.test.tsx
npx enterprise-nextjs-template generate page dashboard
# Creates:
# - src/app/dashboard/page.tsx
# - src/app/dashboard/page.test.tsx
src/
├── app/ # Next.js app directory
├── components/ # React components
│ ├── ui/ # shadcn/ui components
│ ├── common/ # Shared components
│ ├── forms/ # Form-related components
│ └── layouts/ # Layout components
├── lib/ # Utility functions and hooks
│ ├── hooks/ # Custom React hooks
│ ├── utils/ # Helper functions
│ ├── api/ # API-related functions
│ ├── constants/ # Constants and configuration
│ ├── types/ # TypeScript types/interfaces
│ └── validation/ # Schema validation
├── styles/ # Global styles
└── tests/ # Test files
├── unit/ # Unit tests
├── integration/ # Integration tests
└── e2e/ # End-to-end tests
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run test # Run tests
npm run lint # Check linting
npm run lint:fix # Fix linting issues
npm run format # Format code with Prettier
npm run type-check # Run TypeScript checks
npm run commit # Create a conventional commit
- Runs linting on staged files
- Formats code with Prettier
- Runs TypeScript checks
- Ensures tests pass
- Enforces conventional commit format
- Checks commit message length
- Validates commit type
This template enforces Conventional Commits specification with the following types:
feat
: New featurefix
: Bug fixdocs
: Documentation changesstyle
: Code style changesrefactor
: Code refactoringtest
: Adding or updating testschore
: Maintenance tasks
- ESLint
- Prettier
- Tailwind CSS IntelliSense
- Jest
- GitLens
- Format on save enabled
- ESLint auto-fix on save
- Tailwind CSS IntelliSense
- Jest runner configuration
npm run test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage report
- Branches: 80%
- Functions: 80%
- Lines: 80%
- Statements: 80%
.eslintrc.js
- ESLint configuration.prettierrc
- Prettier configurationjest.config.js
- Jest configuration.commitlintrc.js
- Commitlint rulestsconfig.json
- TypeScript configurationtailwind.config.js
- Tailwind CSS configuration
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes using
npm run commit
- Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js team for the incredible framework
- shadcn for the amazing UI components
- Testing Library team for the testing utilities
- All other open-source contributors
For support, issues, or feature requests, please create an issue in the GitHub repository.