Production-ready Next.js starter with TypeScript, Tailwind, and i18n support. PWA-enabled for modern web development.
Table of Contents
A modern, feature-rich Next.js template that provides everything you need to build production-ready web applications. Built with TypeScript and React, this template includes:
- π Internationalization - Built-in support for multiple languages using next-localization
- π¨ Theme System - Dark/light mode with customizable color schemes using Tailwind CSS
- π± PWA Ready - Progressive Web App support for offline functionality and mobile installation
- β‘ Performance Focused - Server-side rendering and static site generation capabilities
- π§ͺ Testing Suite - Comprehensive testing setup with Jest and React Testing Library
- π Code Quality - ESLint, Prettier, and CommitLint for consistent code style
- πΆ Git Hooks - Husky for pre-commit formatting and pre-push testing
- π¦ Component Library - Reusable React components with TypeScript types
- π‘οΈ Type Safety - Full TypeScript support throughout the project
- π Documentation - Extensive documentation and examples
This template serves as a foundation for building modern web applications, incorporating best practices and popular tools from the React/Next.js ecosystem. It's designed to be both developer-friendly and production-ready, with careful attention to performance, accessibility, and user experience.
- Node.js 18.17 or later
- npm or yarn package manager
# Clone the repository
git clone https://github.com/montymi/next-template
# Navigate to project directory
cd next-template
# Install dependencies
npm install
# Install Husky git hooks
npm run prepare
# Generate locale mappings
npm run prebuild
The project includes several npm scripts for development, testing, and code quality:
# Start development server at http://localhost:3000
npm run dev
# Start production server
npm run start
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate test coverage report
npm run test:coverage
# Run ESLint
npm run lint
# Format code with Prettier
npm run format
# Full production build
npm run build
next-template/
βββ __tests__/ # Test files
β βββ components/ # Component tests
β βββ hooks/ # Hook tests
β βββ pages/ # Page tests
βββ public/ # Static files
β βββ images/ # Image assets
β βββ locales/ # Translation files
β βββ manifest.json # PWA manifest
βββ scripts/ # Build Scripts
β βββ generate-locale-map.js
βββ src/ # Source code
β βββ components/ # React components
β β βββ title.tsx
β β βββ Header.tsx
β β βββ Footer.tsx
β βββ hooks/ # Custom React hooks
β β βββ useNamespace.tsx
β βββ pages/ # Next.js pages
β β βββ _app.tsx # App wrapper
β β βββ _document.tsx # Document wrapper
β β βββ index.tsx # Home page
β β βββ 404.tsx # Error page
β β βββ 500.tsx # Server error page
β β βββ about.tsx # About page
β β βββ dashboard.tsx # Dashboard page
β β βββ profile.tsx # Profile page
β β βββ services.tsx # Services page
β βββ styles/ # Stylesheets
β βββ mappings.ts # Locale Mapping
β βββ globals.css # Global styles
βββ commitlint.config.js # ESLint configuration
βββ eslint.config.mjs # ESLint configuration
βββ .prettierrc # Prettier configuration
βββ jest.config.ts # Jest configuration
βββ next.config.ts # Next.js configuration
βββ tailwind.config.ts # Tailwind configuration
βββ tsconfig.json # TypeScript configuration
βββ package.json # Dependencies and scripts
-
Testing
- Add unit tests for all components
- Add integration tests for pages
- Add end-to-end tests using Cypress or Playwright
- Setup test coverage reporting
-
Internationalization
- Add more language support
- Implement RTL support for Arabic/Hebrew
- Add language detection
- Create translation contribution guide
-
Documentation
- Add JSDoc comments to all components
- Create Storybook documentation
- Add API documentation
- Create contributing guidelines
-
Performance
- Implement image optimization
- Add lazy loading for components
- Optimize bundle size
- Add performance monitoring
-
Accessibility
- Add ARIA labels
- Implement keyboard navigation
- Add screen reader support
- Create accessibility guide
-
Security
- Add security headers
- Implement CSP
- Add rate limiting
- Setup security scanning
See the open issues for a full list of issues and proposed features.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) using the following naming convention - Commit your Changes (
git commit -m 'feat: Add some AmazingFeature'
) while adhering to the specifications of conventional commits - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Michael Montanaro