nitrokit
authjs
boilerplate
husky
next-intl
next-themes
nextjs-boilerplate
nextjs15
prisma
radix-ui
resend
rtl-detect
starter-kit
stroybook
tailwindcss
typescript
zod
Nitrokit
π Modern Next.js boilerplate with TypeScript, authentication, and development automation
β¨ Features
- π Next.js 15 with App Router
- π TypeScript for type safety
- π¨ TailwindCSS for styling
- π Internationalization with next-intl
- π Multi-provider authentication (Google, GitHub, GitLab, Facebook)
- ποΈ Database with Prisma
- π§ Email with Resend
- π Analytics (Google Analytics, Yandex Metrica)
- π οΈ Development automation scripts
- π§ͺ Testing with Vitest
- π Storybook for components
π Quick Start
# Clone repository
git clone https://github.com/mustafagenc/nitrokit.git
cd nitrokit
# Install dependencies
yarn install
# Setup environment
cp .env.example .env.local
# Setup development environment
./scripts/dev_setup.sh
# Start development
yarn dev
Open http://localhost:3000 to view your app.
π Project Structure
src/
βββ app/ # Next.js app router
β βββ [locale]/ # Internationalized routes
β βββ dashboard/ # Protected dashboard
βββ components/ # React components
β βββ ui/ # Reusable UI components
β βββ dashboard/ # Dashboard components
βββ lib/ # Utilities and configurations
βββ messages/ # Translation files
βββ prisma/ # Database schema
scripts/ # Development scripts
βββ dependency_updater.sh # Update dependencies
βββ dev_setup.sh # Development setup
βββ generate_release_notes.sh # Release notes
π§ Environment Setup
Create .env.local
with the following variables:
Analytics & SEO
GOOGLE_SITE_VERIFICATION="your-google-verification"
GOOGLE_ANALYTICS="GA-XXXXXXXXX"
YANDEX_VERIFICATION="your-yandex-verification"
YANDEX_METRICA="your-metrica-id"
Email (Resend)
RESEND_API_KEY="re_your-api-key"
RESEND_AUDIENCE_ID="your-audience-id"
RESEND_FROM_EMAIL="noreply@yourdomain.com"
Database (Prisma)
DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=xyz"
Authentication (NextAuth.js)
AUTH_TRUST_HOST=true
AUTH_SECRET="your-secret-key"
# Google OAuth
AUTH_GOOGLE_ID="your-google-client-id"
AUTH_GOOGLE_SECRET="your-google-client-secret"
# GitHub OAuth
AUTH_GITHUB_ID="your-github-client-id"
AUTH_GITHUB_SECRET="your-github-client-secret"
# GitLab OAuth
AUTH_GITLAB_ID="your-gitlab-application-id"
AUTH_GITLAB_SECRET="your-gitlab-secret"
# Facebook OAuth
AUTH_FACEBOOK_ID="your-facebook-app-id"
AUTH_FACEBOOK_SECRET="your-facebook-app-secret"
π Authentication Setup
Nitrokit supports multiple OAuth providers. Configure them in your respective platforms:
Google OAuth
- Go to Google Cloud Console
- Create OAuth 2.0 credentials
- Add authorized redirect URIs:
http://localhost:3000/api/auth/callback/google
GitHub OAuth
- Go to GitHub Settings > Developer settings > OAuth Apps
- Create new OAuth App
- Authorization callback URL:
http://localhost:3000/api/auth/callback/github
GitLab OAuth
- Go to GitLab Applications settings
- Create new application
- Redirect URI:
http://localhost:3000/api/auth/callback/gitlab
Facebook OAuth
- Go to Facebook Developers
- Create new app and add Facebook Login
- Valid OAuth Redirect URIs:
http://localhost:3000/api/auth/callback/facebook
π οΈ Development Scripts
Available Automation Scripts
# Development environment setup
./scripts/dev_setup.sh
# Update all dependencies
./scripts/dependency_updater.sh
# Generate release notes
./scripts/generate_release_notes.sh
Package Scripts
yarn dev # Start development server
yarn build # Build for production
yarn start # Start production server
yarn test # Run tests
yarn lint # Run ESLint
yarn storybook # Start Storybook
Database Management
yarn db:generate # Generate Prisma client
yarn db:push # Push schema to database
yarn db:studio # Open Prisma Studio
yarn db:migrate # Run migrations
π Internationalization
Nitrokit uses next-intl for internationalization. Add translations in the messages/
directory:
messages/
βββ en.json # English (default)
βββ tr.json # Turkish
βββ de.json # German
βββ ... # Other languages
Usage in Components
import { useTranslations } from 'next-intl';
export function MyComponent() {
const t = useTranslations('navigation');
return <h1>{t('title')}</h1>;
}
π Deployment
Vercel (Recommended)
- Push to GitHub
- Import to Vercel
- Set environment variables from
.env.local
- Deploy
Environment Variables for Production
Make sure to set all environment variables in your deployment platform:
- Authentication secrets
- Database URL
- API keys (Resend, analytics)
- OAuth credentials
π Analytics & Integrations
Google Analytics
- Automatically integrated when
GOOGLE_ANALYTICS
is set - Page views and events tracked
Yandex Metrica
- Russian market analytics
- Set
YANDEX_METRICA
environment variable
π§ͺ Testing
# Run tests
yarn test
# Run with coverage
yarn test:coverage
# Watch mode
yarn test --watch
π Component Development
Build and document components with Storybook:
yarn storybook
Access at http://localhost:6006
π€ Contributing
- Fork the repository
- Create feature branch:
git checkout -b feature/name
- Commit changes:
git commit -m 'Add feature'
- Push branch:
git push origin feature/name
- Open Pull Request
π License
Licensed under the Apache License 2.0 - see LICENSE file.
Made with β€οΈ by Mustafa GenΓ§
β Star this repository if you find it helpful!