Skip to content

abhishek207/Nextjs-supabase-starter

Repository files navigation

Next.js SaaS Boilerplate

A comprehensive starter template for building modern SaaS applications with Next.js, Supabase, and Tailwind CSS.

Next.js SaaS Boilerplate

Features

  • Authentication System: Complete user management with email/password authentication
  • Modern UI Components: Pre-configured UI with Tailwind CSS and shadcn/ui
  • Database Integration: Supabase for backend services and PostgreSQL database
  • Responsive Design: Mobile-first approach with adaptive layouts
  • Dark/Light Mode: Theme switching with system preference detection
  • AI Integration: OpenAI API integration via LangChain
  • TypeScript: Type-safe development experience
  • App Router: Next.js App Router for improved routing and layouts

Tech Stack

Frontend

  • Next.js 14: React framework with App Router
  • React 18: UI library
  • Tailwind CSS: Utility-first CSS framework
  • shadcn/ui: Accessible and customizable component library
  • Lucide Icons: Beautiful, consistent icon set
  • Framer Motion: Animation library
  • next-themes: Theme management

Backend & Authentication

  • Supabase: Backend-as-a-service with PostgreSQL
  • Prisma: Type-safe ORM for database access

Payments

  • Stripe: Payment processing and subscription management

AI Integration

  • LangChain: Framework for LLM applications
  • OpenAI: AI model provider

Development Tools

  • TypeScript: Static type checking
  • ESLint: Code linting
  • Prettier: Code formatting

Getting Started

Prerequisites

  • Node.js 18+ and npm/yarn/pnpm
  • Supabase account (optional for production)
  • (Optional) Stripe account for payment processing
  • (Optional) OpenAI API key for AI features

Installation

  1. Clone the repository
git clone https://github.com/yourusername/nextjs-saas-boilerplate.git
cd nextjs-saas-boilerplate
  1. Install dependencies
npm install
# or
yarn install
# or
pnpm install
  1. Set up environment variables

Copy the .env.example file to .env.local and fill in your credentials:

cp .env.example .env.local
  1. Run the development server
npm run dev
# or
yarn dev
# or
pnpm dev
  1. Open http://localhost:3000 in your browser

Development Mode

This boilerplate includes a server-side storage implementation for development purposes. This allows you to test the SaaS functionality without setting up Supabase immediately.

Supabase Setup (For Production)

  1. Create a new Supabase project
  2. Run the SQL migrations in supabase/migrations/
  3. Update your .env.local with the Supabase URL and anon key

Project Structure

├── src/
│   ├── app/                 # Next.js App Router
│   │   ├── (auth)/          # Authentication routes
│   │   ├── api/             # API routes
│   │   ├── dashboard/       # Dashboard pages
│   │   └── page.tsx         # Landing page
│   ├── components/          # React components
│   │   ├── ui/              # UI components (shadcn)
│   │   └── ...              # Other components
│   ├── lib/                 # Utility functions
│   └── types/               # TypeScript types
├── supabase/                # Supabase configuration
│   └── migrations/          # Database migrations
├── prisma/                  # Prisma schema
└── public/                  # Static assets

Authentication

This boilerplate uses Supabase Authentication with the following features:

  • Email/password sign up and sign in
  • Password reset flow
  • Protected routes
  • User profile management

For development purposes, you can use the built-in server-side storage implementation without connecting to Supabase.

Deployment

Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform.

Other Platforms

You can also deploy to other platforms like Netlify, AWS, or your own server.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages