A modern, production-ready Next.js starter template with pre-configured SEO, authentication, and internationalization (i18n).
- ⚡ Next.js 14 with App Router
- 🔐 Authentication with NextAuth.js v5 (Auth.js)
- 🌍 Internationalization with next-intl (English & Ukrainian)
- 🔍 SEO Optimized with metadata, sitemap, and robots.txt
- 🎨 Tailwind CSS for styling
- 📝 TypeScript for type safety
- 🧹 ESLint & Prettier for code quality
- 🪝 Husky with pre-commit and pre-push hooks
- 📦 Lint-staged for optimized linting
- Node.js 18+
- npm, yarn, or pnpm
- Clone the repository:
git clone <your-repo-url>
cd starter__next- Install dependencies:
npm install
# or
yarn install
# or
pnpm install- Set up environment variables:
cp .env.example .env.localEdit .env.local and add your configuration:
NEXTAUTH_URL- Your application URLNEXTAUTH_SECRET- Generate a secret key (you can useopenssl rand -base64 32)- OAuth provider credentials (Google, GitHub, etc.)
- Run the development server:
npm run devOpen http://localhost:3000 in your browser.
starter__next/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── [locale]/ # Internationalized routes
│ │ ├── api/ # API routes
│ │ ├── layout.tsx # Root layout
│ │ ├── globals.css # Global styles
│ │ ├── robots.ts # Robots.txt generator
│ │ └── sitemap.ts # Sitemap generator
│ ├── components/ # React components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utility functions
│ │ ├── auth.ts # NextAuth configuration
│ │ ├── i18n.ts # i18n configuration
│ │ ├── prisma.ts # Prisma client (optional)
│ │ └── seo.ts # SEO utilities
│ ├── types/ # TypeScript type definitions
│ └── middleware.ts # Next.js middleware
├── messages/ # Translation files
│ ├── en.json
│ └── uk.json
├── .husky/ # Git hooks
├── .eslintrc.json # ESLint configuration
├── .prettierrc # Prettier configuration
└── next.config.js # Next.js configuration
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run lint:fix- Run ESLint and fix issuesnpm run format- Format code with Prettiernpm run format:check- Check code formattingnpm run type-check- Run TypeScript type checking
Authentication is configured using NextAuth.js v5. The configuration is in src/lib/auth.ts.
Supported providers:
- Google OAuth
- GitHub OAuth
- Credentials (email/password)
To add more providers or customize authentication, edit src/lib/auth.ts.
The project uses next-intl for internationalization. Supported locales:
- English (
en) - default - Ukrainian (
uk)
To add more languages:
- Add translation files in
messages/directory - Update
localesarray insrc/lib/i18n.ts - Update
middleware.tsif needed
SEO is configured in:
src/app/layout.tsx- Default metadatasrc/app/robots.ts- Robots.txtsrc/app/sitemap.ts- Sitemap generationsrc/lib/seo.ts- SEO utility functions
Use the generateSEO function from @/lib/seo in your pages for dynamic metadata.
The project includes:
- ESLint - Linting with Next.js and TypeScript rules
- Prettier - Code formatting
- Husky - Git hooks
pre-commit- Runs lint-staged (ESLint + Prettier)pre-push- Runs lint and type-check
Husky is configured with:
- pre-commit: Automatically runs ESLint and Prettier on staged files
- pre-push: Runs full lint and type-check before pushing
To skip hooks (not recommended):
git commit --no-verify
git push --no-verifyIf you want to use a database with Prisma:
- Install Prisma:
npm install prisma @prisma/client - Initialize Prisma:
npx prisma init - Configure your database in
prisma/schema.prisma - Uncomment PrismaAdapter in
src/lib/auth.ts
- Push your code to GitHub
- Import your repository in Vercel
- Add environment variables
- Deploy!
The project can be deployed to any platform that supports Next.js:
- Netlify
- AWS Amplify
- Railway
- DigitalOcean App Platform
Make sure to set all required environment variables in your deployment platform.
MIT
Contributions are welcome! Please feel free to submit a Pull Request.