Back to Projects

nitrokit

MGβ€’View on GitHubβ€’May 22, 2025
authjs
boilerplate
husky
next-intl
next-themes
nextjs-boilerplate
nextjs15
prisma
radix-ui
resend
rtl-detect
starter-kit
stroybook
tailwindcss
typescript
zod
Nitrokit Logo

Nitrokit

πŸš€ Modern Next.js boilerplate with TypeScript, authentication, and development automation

Netlify Status codecov CodeFactor Grade Crowdin License: Apache-2.0

✨ 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

  1. Go to Google Cloud Console
  2. Create OAuth 2.0 credentials
  3. Add authorized redirect URIs: http://localhost:3000/api/auth/callback/google

GitHub OAuth

  1. Go to GitHub Settings > Developer settings > OAuth Apps
  2. Create new OAuth App
  3. Authorization callback URL: http://localhost:3000/api/auth/callback/github

GitLab OAuth

  1. Go to GitLab Applications settings
  2. Create new application
  3. Redirect URI: http://localhost:3000/api/auth/callback/gitlab

Facebook OAuth

  1. Go to Facebook Developers
  2. Create new app and add Facebook Login
  3. 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)

  1. Push to GitHub
  2. Import to Vercel
  3. Set environment variables from .env.local
  4. 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

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/name
  3. Commit changes: git commit -m 'Add feature'
  4. Push branch: git push origin feature/name
  5. 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!