A modern, feature-rich SaaS boilerplate built with Next.js, Tailwind CSS, TypeScript, and Supabase.
- 🔐 Authentication - Email/password and social logins via Supabase Auth
- 👮♂️ Role-based Access Control - Admin, User, and Guest roles with middleware protection
- 📊 Admin Dashboard - Manage users, content, and payments
- 🏠 Landing Page - Modern, responsive marketing page
- 📝 Blog System - Create and manage blog content
- 💳 Stripe Integration - Subscriptions and one-time payments
- 🔄 Type Safety - End-to-end TypeScript with Zod validation
- 🎯 Optimistic UI - Instant feedback with background syncing
- 📋 Forms System - React Hook Form with Zod validation
- 🚨 Error Handling - Global error boundaries and form-level validation
- 👤 User Profiles - Complete profile management system
- 🔍 SEO Ready - Dynamic meta tags and OpenGraph support
- 📱 Responsive Design - Mobile-first with dark/light mode
- 📄 Pagination - Client and server-side pagination
- 🏗️ Code Scaffolding - Generate new components and pages quickly
- 🌐 Server-side Rendering - SEO-friendly with App Router
- 🕒 Timezone Awareness - Localized date/time handling
- 🌍 Internationalization - Multi-language support / Internationalized Routing
- Framework: Next.js (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- UI Components: shadcn/ui
- Forms: React Hook Form + Zod
- Backend: Supabase (Auth, Database, Storage)
- Payments: Stripe
- Animations: Framer Motion
- Node.js 18+ and npm
- Supabase account
- Stripe account (for payment features)
-
Clone the repository:
git clone https://github.com/memins/nextjs-supabase-saas-boilerplate cd nextjs-supabase-saas-boilerplate -
Install dependencies:
npm install
-
Copy the example environment file:
cp .env.example .env.local
-
Update the environment variables in
.env.localwith your Supabase and Stripe credentials. -
Start the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
├── public/ # Static assets
├── src/
│ ├── app/ # App Router pages and layouts
│ │ ├── ui/ # shadcn/ui components
│ │ ├── layout/ # Layout components
│ │ └── forms/ # Form components
│ ├── lib/ # Utility functions
│ ├── hooks/ # Custom React hooks
│ ├── middleware.ts # Next.js middleware for auth protection
│ ├── types/ # TypeScript type definitions
│ ├── server/ # Server-only code (API routes, database)
│ └── styles/ # Global styles
└── ...config files
- Feature Development: Create a new feature branch from
main - Component Creation: Use the generator with
npm run generate component - Page Creation: Use the generator with
npm run generate page - API Creation: Follow the server actions pattern in the App Router
Required environment variables:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
# Stripe
STRIPE_SECRET_KEY=your-stripe-secret-key
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your-stripe-publishable-key
STRIPE_WEBHOOK_SECRET=your-stripe-webhook-secret
This template is optimized for deployment on Vercel:
npm run build
# Then deploy with Vercel CLI or GitHub integration- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add 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.