A modern, production-ready Next.js starter kit with authentication, database integration, password reset functionality, and all the essential tools you need to build your next web application.
- Next.js 15 - App Router, Server Components, and optimized performance
- Authentication - Complete auth system with NextAuth.js
- Password Reset - Secure password reset functionality with email notifications
- Email Templates - Beautiful email templates using React Email and Tailwind CSS
- Database - MongoDB with Prisma ORM for type-safe database operations
- Payments - Stripe Checkout sessions with secure webhook handling
- Styling - Tailwind CSS for rapid UI development
- Dark/Light Theme - Theme switching with
next-themes - TypeScript - Full type safety throughout the application
- Developer Experience - ESLint, hot reload, and modern tooling
- Framework: Next.js 15
- Language: TypeScript
- Styling: Tailwind CSS
- Authentication: NextAuth.js
- Database: MongoDB
- ORM: Prisma
- Email: Resend with React Email
- Payments: Stripe
- Theme: next-themes
- UI Components: Custom components with Tailwind CSS
- Node.js 18+
- MongoDB (local installation or MongoDB Atlas)
- Git
- Resend account for email functionality
- Stripe account for payments
-
Clone the repository
git clone https://github.com/mklozinski/NextJS-CC-Starter-Kit my-app cd my-app -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Update the
.envfile with your configuration:# Core DATABASE_URL="<your-mongodb-url>" NEXTAUTH_URL="http://localhost:3000" NEXT_PUBLIC_URL="http://localhost:3000" NEXTAUTH_SECRET="<generate-strong-secret>" # OAuth (optional) GOOGLE_CLIENT_ID="" GOOGLE_CLIENT_SECRET="" GITHUB_CLIENT_ID="" GITHUB_CLIENT_SECRET="" # Analytics (optional) NEXT_PUBLIC_GOOGLE_ANALYTICS="" # Emails (Resend) RESEND_API_KEY="" FROM_EMAIL="[email protected]" EMAIL_NAME="Your App" # Stripe STRIPE_SECRET_KEY="" STRIPE_WEBHOOK_SECRET="" STRIPE_PRICE_PRO_MONTHLY="" STRIPE_PRICE_PRO_YEARLY="" STRIPE_PRICE_ULTRA_MONTHLY="" STRIPE_PRICE_ULTRA_YEARLY=""
-
Set up the database
# Generate Prisma client npx prisma generate # Push the schema to your database npx prisma db push # Optional: Seed the database npm run db:seed
-
Start the development server
npm run dev
Visit http://localhost:3000 to see your application.
- Email/Password - Traditional credential-based authentication
- Google OAuth - Sign in with Google (configure in .env)
- GitHub OAuth - Sign in with GitHub (configure in .env)
- User clicks "Forgot Password?" on the login page
- User enters their email address
- System generates a secure reset token (valid for 1 hour)
- Beautiful email with reset link is sent via Resend
- User clicks the link and enters a new password
- Password is securely hashed and updated in the database
/- Home (instructions)/pricing- Pricing page with Stripe checkout example/dashboard- Protected example page/login- Sign in page with all authentication methods/register- User registration/forgot-password- Request password reset/reset-password- Reset password with token
The starter kit includes beautiful, responsive email templates built with React Email and Tailwind CSS:
- Forgot Password Email - Clean, professional password reset email
- Password Reset Success - Confirmation email after successful reset
Templates are located in src/components/emails/ and use:
- React Email components for structure
- Tailwind CSS for styling
- Reusable header and footer components
The application uses the following main models:
- Basic user information (name, email)
- Password (hashed with bcryptjs)
- Account status and role (roles for future use, right now admin dashboard not implemented)
- Password reset tokens and expiry
- NextAuth.js models for OAuth and session management
- Email verification and password reset tokens
Make sure to set all required environment variables in your deployment platform:
DATABASE_URL="your-production-mongodb-url"
NEXT_PUBLIC_URL="https://yourdomain.com"
NEXTAUTH_URL="https://yourdomain.com"
NEXTAUTH_SECRET="your-production-secret"
RESEND_API_KEY="your-resend-api-key"
FROM_EMAIL="[email protected]"
# OAuth credentials if using (optional)
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""
GITHUB_CLIENT_ID=""
GITHUB_CLIENT_SECRET=""
# Stripe
STRIPE_SECRET_KEY="sk_live_your_key"
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_live_your_key"
STRIPE_WEBHOOK_SECRET="whsec_your_live_secret"
STRIPE_PRICE_PRO_MONTHLY="price_plan1-monthly"
STRIPE_PRICE_PRO_YEARLY="price_plan1-yearly"
STRIPE_PRICE_ULTRA_MONTHLY="price-plan2-monthly"
STRIPE_PRICE_ULTRA_YEARLY="price-plan2-yearly"# In production, use migrate instead of db push
npx prisma migrate deploynpm run dev- Start development server with Turbopacknpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run db:generate- Generate Prisma clientnpm run db:push- Push schema changes to databasenpm run db:studio- Open Prisma Studionpm run db:seed- Seed the database
src/
βββ app/ # Next.js 13+ app directory
β βββ api/ # API routes
β β βββ auth/ # Authentication endpoints
β β βββ stripe/ # Stripe checkout + webhook
β β βββ user/ # User profile/password endpoints
β βββ pricing/ # Pricing page (Stripe example)
β βββ (auth)/dashboard/ # Protected example page
β βββ login/ # Login page
β βββ register/ # Registration page
β βββ forgot-password/ # Password reset request
β βββ reset-password/ # Password reset form
βββ components/ # React components
β βββ auth/ # Authentication components
β βββ emails/ # Email templates
β βββ providers/ # Context providers (theme, auth)
β βββ ui/ # UI components
βββ lib/ # Utility functions
βββ types/ # TypeScript type definitions
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or need help, please open an issue on GitHub.
Built using Next.js, TypeScript, NextAuth, Prisma, and Stripe with dark/light theme support.