Skip to content

πŸš€ SaaSPilot - The most AI-coding-agent-friendly SaaS boilerplate for Next.js. Build faster with 120KB of AI-optimized docs, credit-based billing, and production-ready patterns. Perfect for AI SaaS apps!

Notifications You must be signed in to change notification settings

CiphersLab/SaaSPilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ SaaSPilot - AI-Ready SaaS Starter Kit

The Most AI-Coding-Agent-Friendly SaaS Boilerplate for Next.js

Quick Start β€’ AI Ready β€’ Features β€’ Tech Stack β€’ Documentation


SaaSPilot is a production-ready, full-stack SaaS boilerplate for Next.js - crafted with great attention to both front-end and back-end functionality. Built with developer experience in mind, it comes with all essential integrations and features, plus comprehensive AI-agent documentation for seamless AI-assisted development.

Perfect for launching AI SaaS applications with credit-based billing! 🎯


✨ What's New: AI-Coding-Agent Optimized! πŸ€–

SaaSPilot now includes 120KB of comprehensive documentation specifically designed for AI coding assistants:

  • πŸ“š 13 documentation files covering every aspect
  • 🎯 3 ready-to-use prompt templates for common tasks
  • πŸ” Pattern-based code examples for consistency
  • πŸ›‘οΈ Security-first patterns built-in
  • ⚑ 5-minute codebase understanding for AI agents

AI agents (Claude, Cursor, GitHub Copilot) can now understand and modify the codebase autonomously!


πŸš€ Quick Start

# 1. Clone the repository
git clone https://github.com/your-repo/saaspilot.git
cd saaspilot

# 2. Install dependencies
npm install

# 3. Set up environment variables
cp .env.example .env.local
# Edit .env.local with your credentials

# 4. Set up the database
npx prisma generate
npx prisma db push

# 5. Run the development server
npm run dev

Visit http://localhost:3000 πŸŽ‰

For AI Agents

πŸ‘‰ Start here: CLAUDE.md - Complete guide for AI coding assistants


πŸ€– AI Coding Agent Ready

SaaSPilot is optimized for AI-assisted development with comprehensive documentation designed specifically for AI assistants like Claude, Cursor, and GitHub Copilot.

πŸ“š Documentation Structure

/
β”œβ”€β”€ CLAUDE.md                        β†’ Quick start for AI agents
β”œβ”€β”€ /docs/                           β†’ Comprehensive technical docs
β”‚   β”œβ”€β”€ ai-instructions.md          β†’ Core instructions & conventions ⭐
β”‚   β”œβ”€β”€ architecture.md             β†’ System architecture & diagrams
β”‚   β”œβ”€β”€ coding-patterns.md          β†’ Standard patterns & best practices
β”‚   β”œβ”€β”€ database-schema.md          β†’ Complete schema reference
β”‚   β”œβ”€β”€ component-map.md            β†’ Component relationships
β”‚   β”œβ”€β”€ api-documentation.md        β†’ API reference & server actions
β”‚   └── troubleshooting.md          β†’ Common issues & solutions
└── /prompts/                        β†’ Task templates for AI agents
    β”œβ”€β”€ add-new-feature.md          β†’ Feature addition template
    β”œβ”€β”€ create-api-endpoint.md      β†’ API endpoint template
    └── modify-database-schema.md   β†’ Schema modification guide

🎯 What AI Agents Can Do

With this documentation, AI coding agents can:

βœ… Understand the codebase structure in < 5 minutes βœ… Add new features following established patterns βœ… Create API endpoints without breaking conventions βœ… Modify database schema safely βœ… Navigate components and understand relationships βœ… Troubleshoot issues independently βœ… Generate consistent, production-ready code

πŸš€ Getting Started with AI Agents

For Claude/Cursor/Copilot:

  1. Read CLAUDE.md for quick context
  2. Review docs/ai-instructions.md for conventions
  3. Reference docs/coding-patterns.md when writing code
  4. Use templates in /prompts for specific tasks

Example AI Prompt:

"Add a new task management feature to SaaSPilot following the patterns
in /docs/coding-patterns.md and using the template in /prompts/add-new-feature.md"

πŸŽ› Tech Stack

Frontend:

  • βš›οΈ React 18 - UI library
  • πŸ”· Next.js 14 - Full-stack framework (App Router)
  • πŸ“˜ TypeScript - Type safety
  • 🎨 Tailwind CSS - Styling
  • 🧩 Shadcn/ui - Component library

Backend:

  • πŸ” NextAuth.js v5 - Authentication
  • πŸ—„οΈ Prisma ORM - Database toolkit
  • πŸƒ MongoDB - Database
  • πŸ’³ Stripe - Payments (credit-based)
  • πŸ“§ Resend/SendGrid - Email service

Developer Experience:

  • βœ… TypeScript - Full type safety
  • πŸ“¦ Zod - Schema validation
  • 🎣 React Hook Form - Form management
  • 🌐 next-intl - Internationalization
  • 🎭 Framer Motion - Animations

⚑ Features

πŸ€– AI-Ready Documentation

  • Comprehensive guides for AI coding agents
  • Pattern-based development with code examples
  • Ready-to-use prompt templates for common tasks
  • 5-minute onboarding for AI assistants

πŸ’³ Payments & Credits System

  • Stripe integration for credit purchases
  • Credit-based billing (perfect for AI SaaS)
  • Purchase history tracking
  • Webhook handling for payment events
  • 3 pricing tiers (Free, Starter, Pro)

πŸ”’ Authentication

  • Email/Password authentication with bcrypt
  • Social login (Google, GitHub OAuth)
  • Email verification system
  • Password reset functionality
  • Two-factor authentication (2FA) support
  • Role-based access (User/Admin)

πŸ“§ Email System

  • Transactional emails via Resend or SendGrid
  • React email templates for beautiful emails
  • Verification emails
  • Password reset emails
  • Purchase confirmation emails

πŸ› οΈ Database

  • MongoDB with Prisma ORM
  • 8 production-ready models
  • Type-safe queries
  • Easy schema migrations
  • Optimized relationships

πŸ‘€ User Dashboard

  • Credit balance display
  • Purchase history
  • Account settings
  • Profile management
  • Email/username change

🌐 Internationalization

  • Multi-language support (English, German, Arabic)
  • RTL/LTR support automatic detection
  • Translation management
  • Locale switching

🎨 UI Components

  • 20+ Shadcn/ui components included
  • Responsive design (mobile-first)
  • Dark mode support with next-themes
  • Accessible components (Radix UI)
  • Landing page templates
  • Marketing pages (About, Contact, Pricing)

πŸ‘©β€πŸ’Ό Admin Features

  • Admin role detection via environment variable
  • Admin-only API endpoints
  • User management (Pro version)
  • Analytics dashboard (Pro version)

πŸ“œ Documentation

Official Docs

πŸ“– Full Documentation: https://cipherslab.gitbook.io/saas-pilot-docs

AI-Ready Docs (New!)

Start with these for AI-assisted development:

Document Purpose Size
CLAUDE.md Quick start for AI agents 8 KB
docs/ai-instructions.md Core instructions & conventions 6 KB
docs/architecture.md System architecture 8 KB
docs/coding-patterns.md Standard code patterns 10 KB
docs/database-schema.md Database reference 10 KB
docs/component-map.md Component relationships 11 KB
docs/api-documentation.md API reference 6 KB
docs/troubleshooting.md Common issues 7 KB

πŸ“ View all documentation


πŸ’» Demo

🎬 Live Demo (Pro version): https://saas-pilot-demo.vercel.app/

🌐 Website: https://saas-pilot.vercel.app

πŸ”₯ Pricing & FAQ: https://saas-pilot.vercel.app/#pricing

Note: Certain features are disabled in the free version or can't be included in the public repo.


πŸ†š Free vs Pro Comparison

Feature Free Pro
User Dashboard βœ… βœ…
Full Authentication (Email + OAuth) βœ… βœ…
User Profile Management βœ… βœ…
Landing & Pricing Pages βœ… Single βœ… Multiple
Marketing Pages (About, Contact) βœ… βœ…
Multi-Language Support (i18n) βœ… βœ…
Stripe Credit Purchases βœ… βœ…
Stripe Subscriptions ❌ βœ…
Admin Dashboard ❌ βœ…
Fully Featured Blog ❌ βœ…
Event-Based Analytics ❌ βœ…
AI-Ready Documentation βœ… βœ…

πŸ—‚οΈ Project Structure

saaspilot/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ (marketing)/             # Public pages
β”‚   β”œβ”€β”€ (protected)/             # Auth-required pages
β”‚   β”œβ”€β”€ auth/                    # Authentication pages
β”‚   └── api/                     # API routes & webhooks
β”œβ”€β”€ components/                   # React components
β”‚   β”œβ”€β”€ ui/                      # Shadcn/ui components
β”‚   β”œβ”€β”€ auth/                    # Auth components
β”‚   └── Common/                  # Shared components
β”œβ”€β”€ actions/                      # Server actions
β”œβ”€β”€ lib/                         # Utilities & services
β”œβ”€β”€ prisma/                      # Database schema
β”œβ”€β”€ docs/                        # AI-ready documentation ⭐
β”œβ”€β”€ prompts/                     # AI prompt templates ⭐
β”œβ”€β”€ hooks/                       # React hooks
β”œβ”€β”€ types/                       # TypeScript types
β”œβ”€β”€ schemas/                     # Zod validation schemas
β”œβ”€β”€ translations/                # i18n translations
└── config/                      # Configuration files

πŸ› οΈ Development

Available Scripts

# Development
npm run dev              # Start dev server (http://localhost:3000)
npm run build           # Create production build
npm run start           # Start production server

# Database
npx prisma studio       # Open Prisma Studio (visual database)
npx prisma generate     # Regenerate Prisma client
npx prisma db push      # Push schema changes to database
npx prisma migrate dev  # Create and apply migration

# Code Quality
npm run lint            # Run ESLint
npm run type-check      # TypeScript type checking

Environment Variables

Copy .env.example to .env.local and configure:

# Database
DATABASE_URL="mongodb://..."

# Authentication
NEXTAUTH_SECRET="your-secret"
NEXTAUTH_URL="http://localhost:3000"

# OAuth Providers
GITHUB_CLIENT_ID="..."
GITHUB_CLIENT_SECRET="..."
GOOGLE_CLIENT_ID="..."
GOOGLE_CLIENT_SECRET="..."

# Stripe
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."

# Email
RESEND_API_KEY="re_..."

# App Configuration
NEXT_PUBLIC_APP_URL="http://localhost:3000"
ADMIN_EMAILS="[email protected]"
INITIAL_CREDITS_FOR_NEW="20"

🎯 Use Cases

Perfect for building:

  • πŸ€– AI SaaS Applications (ChatGPT-style apps, AI tools)
  • πŸ’Ό B2B SaaS Platforms
  • πŸ“Š Analytics Dashboards
  • 🎨 Creative Tools
  • πŸ“ Content Management Systems
  • πŸ”§ Developer Tools
  • πŸ“± Mobile-First Web Apps

The credit-based billing system is especially suited for AI/ML applications with usage-based pricing.


πŸš€ Deployment

Vercel (Recommended)

  1. Push your code to GitHub
  2. Import project in Vercel
  3. Add environment variables
  4. Deploy! ✨

Deploy with Vercel

Other Platforms

SaaSPilot works on any platform supporting Node.js:

  • Railway
  • Render
  • DigitalOcean App Platform
  • AWS (Amplify, ECS)
  • Google Cloud Run

πŸŽ“ Learning Resources

Documentation

SaaSPilot Specific


🀝 Contributing

Contributions are welcome! Here's how:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Contribution Guidelines

  • Follow the established coding patterns (see docs/coding-patterns.md)
  • Add tests for new features
  • Update documentation
  • Keep commits clean and descriptive

πŸ› Issues & Support


πŸ“„ License

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


⭐ Show Your Support

If you find SaaSPilot helpful:

  • ⭐ Star this repository to show your support
  • 🐦 Tweet about it and tag us
  • πŸ“ Write a blog post about your experience
  • πŸŽ₯ Create a video tutorial
  • πŸ’¬ Share with your network

Every star helps! 🌟


πŸŽ‰ Credits

Built with ❀️ by the SaaSPilot team

Special Thanks:

  • Next.js team for the amazing framework
  • Vercel for hosting and deployment
  • Shadcn for the beautiful components
  • The open-source community

πŸ”— Links


Built for developers, optimized for AI agents πŸ€–

Get Started β€’ AI Guide β€’ Documentation

Made with ❀️ for the developer community