A comprehensive, production-ready Next.js template with internationalization, authentication, database integration, and modern UI components.
- π Next.js 15 - Latest React framework with App Router
- π Internationalization - Multi-language support (English, Chinese, Japanese)
- π Authentication - Secure auth with NextAuth.js v5 and GitHub OAuth
- ποΈ Database - PostgreSQL with Prisma 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, ESLint, Prettier, Husky
- π³ Docker Support - Development and production containers
- π State Management - Zustand for client state
- π― Form Handling - React Hook Form with Zod validation
- Next.js 15 - React framework with App Router
- 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
- Prisma - Next-generation ORM
- PostgreSQL - Advanced open source database
- i18next - Internationalization framework
- react-i18next - React integration for i18next
- ESLint - Code linting
- Prettier - Code formatting
- 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://username:password@localhost:5432/mydb"
# 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.yml up -dEnsure PostgreSQL is running and create a database, then update DATABASE_URL.
# Generate Prisma client
sh prisma/generate.sh
# Run migrations (creates tables)
sh prisma/migrate.shpnpm 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
βββ prisma/ # Database schema & 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
prisma/schema_template.prisma - Run
sh prisma/generate.shto regenerate client
- Modify
-
Migrations:
- Development:
sh prisma/migrate.sh - Production:
sh prisma/migrate_deploy.sh
- Development:
- 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
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run ESLint
pnpm lint:fix # Fix ESLint issues
pnpm type-check # Run TypeScript check- 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
- Prisma 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.yml ps
# Restart containers
docker compose -f docker/docker-compose.yml restartPrisma Client Issues:
# Regenerate Prisma client
sh prisma/generate.sh
# Reset database (β οΈ This will delete all data)
npx prisma db push --force-resetAuthentication 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 15, TypeScript, and modern web technologies.