A comprehensive, production-ready Next.js template with internationalization, authentication, database integration, and modern UI components.
- π Next.js 16 - Latest React framework with App Router and Turbopack
- π Internationalization - Multi-language support (English, Chinese, Japanese)
- π Authentication - Secure auth with NextAuth.js v5 and GitHub OAuth
- ποΈ Database - PostgreSQL with Drizzle ORM
- π¨ Modern UI - Beautiful components with Tailwind CSS, shadcn/ui, and HeroUI
- π Dark Mode - Built-in theme switching
- π± Responsive - Mobile-first design
- π¬ Animations - Smooth animations with Framer Motion
- π§ Developer Experience - TypeScript, Biome, Husky
- π³ Docker Support - Development and production containers
- π State Management - Zustand for client state
- π― Form Handling - React Hook Form with Zod validation
- Next.js 16 - React framework with App Router and Turbopack
- TypeScript - Type-safe JavaScript
- React 19 - Latest React with concurrent features
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - High-quality React components
- HeroUI - Modern UI component library
- Framer Motion - Production-ready motion library
- Lucide React - Beautiful & consistent icons
- NextAuth.js v5 - Complete authentication solution
- Drizzle ORM - Lightweight and type-safe ORM
- PostgreSQL - Advanced open source database
- i18next - Internationalization framework
- react-i18next - React integration for i18next
- Biome - Fast linter and formatter
- Husky - Git hooks
- Commitlint - Conventional commits
- Node.js 18+ - Download
- pnpm -
npm install -g pnpm - PostgreSQL - For database (or use Docker)
git clone <your-repo-url>
cd nextjs-i18n-prisma-authjs-tailwindcss-template
pnpm installCreate .env.local file:
# Database
DATABASE_URL="postgresql://leaperone:password@localhost:5432/template_db"
# NextAuth.js
NEXTAUTH_SECRET="your-secret-key"
NEXTAUTH_URL="http://localhost:3000"
# GitHub OAuth (required for auth)
AUTH_GITHUB_ID="your-github-client-id"
AUTH_GITHUB_SECRET="your-github-client-secret"docker compose -f docker/docker-compose-dev-db.yml up -dEnsure PostgreSQL is running and create a database, then update DATABASE_URL.
# Push schema to database (creates tables)
pnpm db:pushpnpm devVisit http://localhost:3000 to see your application!
βββ app/ # Next.js App Router pages
β βββ (default)/ # Default layout group
β βββ dashboard/ # Protected dashboard pages
β βββ api/ # API routes
β βββ signin/ # Authentication pages
βββ components/ # Reusable UI components
β βββ ui/ # shadcn/ui components
β βββ ... # Custom components
βββ i18n/ # Internationalization
β βββ locales/ # Translation files
β βββ settings.ts # i18n configuration
βββ lib/ # Utility libraries
β βββ schema.ts # Drizzle ORM table definitions
β βββ db.ts # Database client
βββ drizzle/ # Database migrations
βββ actions/ # Server actions
βββ hooks/ # Custom React hooks
βββ store/ # Zustand state management
βββ types/ # TypeScript type definitions
-
GitHub OAuth Setup:
- Go to GitHub Settings > Developer settings > OAuth Apps
- Create a new OAuth app
- Set Authorization callback URL:
http://localhost:3000/api/auth/callback/github - Copy Client ID and Client Secret to
.env.local
-
NextAuth.js Configuration:
- Review
auth.tsfor authentication settings - Add additional providers as needed
- Review
-
Schema Customization:
- Modify
lib/schema.tsto add or change table definitions - Run
pnpm db:pushto apply changes in development
- Modify
-
Migrations:
- Generate migration:
pnpm db:generate - Apply migration:
pnpm db:migrate - Visual browser:
pnpm db:studio
- Generate migration:
- Supported Languages: English, Chinese (Simplified), Japanese
- Add New Language:
- Add locale to
i18n/settings.ts - Create translation files in
i18n/locales/[locale]/ - Update language switcher component
- Add locale to
pnpm dev # Start development server (Turbopack)
pnpm build # Build for production (Turbopack)
pnpm start # Start production server
pnpm check # Run Biome lint check
pnpm fix # Auto-fix Biome issues
pnpm format # Format code with Biome
pnpm db:push # Push schema to database (dev)
pnpm db:generate # Generate migration files
pnpm db:migrate # Apply migrations (production)
pnpm db:pull # Introspect database to schema
pnpm db:studio # Open Drizzle Studiodocker compose -f docker/docker-compose-dev-db.yml up -d- Install Docker and VS Code with Remote-Containers extension
- Open project in VS Code
- Press
Ctrl+Shift+Pβ "Reopen in Container" - Wait for container setup to complete
docker build -f docker/Dockerfile -t my-app .
docker run -p 3000:3000 my-app- Push your code to GitHub
- Connect repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push
pnpm build
pnpm start- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'feat: add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project uses Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changesrefactor:- Code refactoringtest:- Test additions/changeschore:- Build process or auxiliary tool changes
- Next.js Documentation - Learn about Next.js features and API
- NextAuth.js Guide - Complete authentication documentation
- Drizzle ORM Docs - Database and ORM documentation
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Re-usable components built with Radix UI
- i18next - Internationalization framework
Database Connection Error:
# Check if PostgreSQL is running
docker compose -f docker/docker-compose-dev-db.yml ps
# Restart container
docker compose -f docker/docker-compose-dev-db.yml restartDatabase Schema Issues:
# Introspect existing database
pnpm db:pull
# Re-push schema (β οΈ May alter tables)
pnpm db:push
# Open visual browser to inspect data
pnpm db:studioAuthentication Not Working:
- Verify GitHub OAuth credentials in
.env.local - Check callback URL matches your GitHub OAuth app settings
- Ensure
NEXTAUTH_SECRETis set
Licensed under the MIT license.
β Star this repository if you found it helpful!
Built with β€οΈ using Next.js 16, TypeScript, and modern web technologies.