A complete and modern Next.js 15+ boilerplate for developing React applications with TypeScript, configured with development best practices, code quality tools, and automation. Perfect starter template for frontend developers who want a production-ready setup.
- ποΈ Next.js 15+ with App Router - Latest React framework with Turbopack
- π· TypeScript - Full type safety and better developer experience
- π¨ Tailwind CSS 4 - Modern utility-first CSS framework
- π Complete i18n Support - Multi-language with automatic locale detection
- π§ͺ Complete Testing Suite - Jest, React Testing Library, Vitest, and Playwright
- π Storybook - Component development and documentation
- π Code Quality - ESLint, Prettier, Husky, and Lint-staged
- π³ Docker Support - Production-ready containerization
- π CI/CD Pipeline - GitHub Actions for automated testing and deployment
- π οΈ Code Generation - Plop templates for rapid development
- π¦ Modern Stack - Latest versions of all dependencies
- π Best Practices - Industry-standard project structure and conventions
English | PortuguΓͺs
- Next.js 15+ - React framework with App Router, Turbopack and advanced optimizations
- React 19 - Library for building user interfaces
- TypeScript - JavaScript superset with static typing
- Tailwind CSS 4 - Utility-first CSS framework
- PostCSS - Tool for CSS transformation
- @formatjs/intl-localematcher - Advanced locale matching
- Negotiator - Accept-Language header parsing
- Server-only imports - Optimized translation loading
- Jest - JavaScript testing framework
- React Testing Library - Utilities for testing React components
- Vitest - Fast test runner
- Playwright - Framework for end-to-end testing
- Storybook - Tool for component development and documentation
- ESLint - Linter for identifying code problems
- Prettier - Code formatter
- Husky - Git hooks for automation
- Lint-staged - Run linters on staged files
- Plop - Template-based code generator
- GitHub Actions - Continuous integration and deployment pipeline
k3t-nextjs-boilerplate/
βββ .github/
β βββ workflows/
β β βββ ci.yml # CI/CD Pipeline
β βββ copilot-instructions.md # AI Instructions
βββ generators/
β βββ templates/ # Plop Templates
β βββ plopfile.js # Generator Configuration
βββ public/ # Static Files
βββ src/
β βββ app/ # App Router (Next.js 15+)
β β βββ [lang]/ # Dynamic locale routes
β β β βββ layout.tsx # Localized layout
β β β βββ page.tsx # Localized pages
β β βββ globals.css # Global Styles
β β βββ layout.tsx # Root Layout
β β βββ page.tsx # Root Page (redirects)
β β βββ not-found.jsx # 404 Page
β βββ components/ # Reusable Components
β β βββ Main/
β β βββ index.tsx # Component
β β βββ stories.tsx # Storybook stories
β β βββ test.tsx # Tests
β βββ dictionaries/ # Translation Files
β β βββ en.json # English
β β βββ pt.json # Portuguese
β β βββ es.json # Spanish
β βββ hooks/ # Custom Hooks
β β βββ usePathname.ts # Navigation hook
β βββ lib/ # Utilities
β β βββ i18n/ # i18n Configuration
β β βββ get-dictionary.ts
β β βββ i18n-config.ts
β βββ middleware.ts # Next.js Middleware
βββ I18N.md # i18n Documentation
βββ jest.config.js # Jest Configuration
βββ vitest.config.ts # Vitest Configuration
βββ package.json # Dependencies and scripts
Use the create-next-app command with this boilerplate as an example:
npx create-next-app@latest my-new-project --example https://github.com/kode3tech/k3t-nextjs-boilerplate
cd my-new-project# Using version tag (e.g., v1.0.0)
npx create-next-app@latest my-new-project --example https://github.com/kode3tech/k3t-nextjs-boilerplate/tree/v1.0.0
# Using specific commit
npx create-next-app@latest my-new-project --example https://github.com/kode3tech/k3t-nextjs-boilerplate/tree/9e596e7
# Using specific branch
npx create-next-app@latest my-new-project --example https://github.com/kode3tech/k3t-nextjs-boilerplate/tree/mainnpm install
# or
yarn install
# or
pnpm install-
Update
package.json:{ "name": "my-new-project", "version": "0.1.0", "description": "Description of your project" } -
Initialize Git (if necessary):
git init git add . git commit -m "feat: initial project setup"
-
Customize the content:
- Edit
src/app/page.tsxfor your homepage - Update
src/app/layout.tsxwith your project metadata - Replace the logo in
public/logo.svg
- Edit
| Script | Description |
|---|---|
npm run dev |
Start development server with Turbopack |
npm run build |
Create production build |
npm run start |
Start production server |
npm run lint |
Run ESLint |
npm run test |
Run tests with Jest |
npm run test:watch |
Run tests in watch mode |
npm run test:ci |
Run tests for CI |
npm run gen:component |
Generate new component with template |
npm run storybook |
Start Storybook |
npm run build-storybook |
Build Storybook |
Use the automatic generator to create new components:
npm run gen:componentThis will create:
src/components/YourComponent/index.tsx- React componentsrc/components/YourComponent/stories.tsx- Storybook storiessrc/components/YourComponent/test.tsx- Unit tests
npm run test # Run all tests
npm run test:watch # Watch mode
npm run test:ci # For CI/CDnpx playwright install # Install browsers
npx playwright test # Run E2E testsDevelop and document components in isolation:
npm run storybook # Start at http://localhost:6006
npm run build-storybook # Build for productionRecommended extensions:
- ES7+ React/Redux/React-Native snippets
- Tailwind CSS IntelliSense
- TypeScript Importer
- Prettier - Code formatter
- ESLint
The project includes .editorconfig for consistency across different editors.
The boilerplate includes complete Docker support with optimized multi-stage builds for both development and production environments.
Using the included convenience script:
# Build production image
./docker.sh build
# Run production container
./docker.sh run
# Build and run development container
./docker.sh build-dev
./docker.sh run-dev
# Using docker-compose
./docker.sh compose-up
# View logs
./docker.sh logs
# Stop containers
./docker.sh stop
# Clean up
./docker.sh clean# Build production image
docker build -t k3t-nextjs-boilerplate .
# Run production container
docker run -d -p 3000:3000 --name k3t-nextjs-app k3t-nextjs-boilerplate
# Build development image
docker build -f Dockerfile.dev -t k3t-nextjs-boilerplate:dev .
# Run development container with hot reload
docker run -d -p 3001:3000 -v $(pwd):/app -v /app/node_modules --name k3t-nextjs-dev k3t-nextjs-boilerplate:dev# Production environment
docker-compose up -d
# Development environment
docker-compose --profile dev up -d- Multi-stage builds - Optimized image size (~100MB final image)
- Non-root user - Enhanced security
- Development support - Hot reload with volume mounting
- Production ready - Standalone Next.js output
For complete Docker documentation, see DOCKER.md.
The boilerplate includes complete internationalization support with automatic locale detection and SEO-friendly URLs.
- English (en) - Default locale
- Portuguese (pt) - Brazilian Portuguese
- Spanish (es) - Latin American Spanish
Visit your app and see automatic locale detection in action:
/ β Redirects to /en (or your browser's preferred language)
/en/about β English about page
/pt/sobre β Portuguese about page
/es/acerca β Spanish about page
- Update translation files:
// src/dictionaries/en.json
{
"HomePage": {
"title": "Welcome to My App",
"description": "This is my awesome app"
}
}- Use in server components:
import { getDictionary } from '@/lib/i18n/get-dictionary'
export default async function Page({ params }) {
const { lang } = await params
const t = await getDictionary(lang)
return <h1>{t.HomePage.title}</h1>
}- Client-side navigation:
import { usePathname } from '@/hooks/usePathname'
export default function LanguageSwitcher() {
const { redirectWithLocale } = usePathname()
return (
<button onClick={() => redirectWithLocale('pt')}>
Switch to Portuguese
</button>
)
}- Automatic locale detection from Accept-Language headers
- SEO-friendly URLs with locale prefixes (e.g.,
/en/about,/pt/sobre) - Server-side translation loading with type safety
- Client-side locale switching with navigation hooks
- Fallback support to default locale when needed
- Middleware integration for seamless redirects
π For complete i18n documentation, see I18N.md
- Minimal dependencies - Only production files in final image
- Connect your repository on Vercel
- Configure environment variables
- Automatic deployment on every push
- Netlify: Native Next.js support
- AWS Amplify: Deploy with integrated CI/CD
- Docker: Dockerfile included for containerization
- Fork the project
- Create a branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -m 'feat: add new feature') - Push to the branch (
git push origin feature/new-feature) - Open a Pull Request
We follow the Conventional Commits standard:
feat:for new featuresfix:for bug fixesdocs:for documentationstyle:for formattingrefactor:for refactoringtest:for tests
- Use TypeScript for all files
- Components in PascalCase
- Configuration files in kebab-case
- Use Prettier for automatic formatting
This project is under the MIT license. See the LICENSE file for more details.
We transform ideas into efficient and innovative solutions.
β If this boilerplate was useful, consider giving the repository a star!