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! 🎯
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!
# 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 devVisit http://localhost:3000 🎉
👉 Start here: CLAUDE.md - Complete guide for AI coding assistants
SaaSPilot is optimized for AI-assisted development with comprehensive documentation designed specifically for AI assistants like Claude, Cursor, and GitHub Copilot.
/
├── 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
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
For Claude/Cursor/Copilot:
- Read CLAUDE.md for quick context
- Review docs/ai-instructions.md for conventions
- Reference docs/coding-patterns.md when writing code
- 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"
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
- 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
- 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)
- 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)
- Transactional emails via Resend or SendGrid
- React email templates for beautiful emails
- Verification emails
- Password reset emails
- Purchase confirmation emails
- MongoDB with Prisma ORM
- 8 production-ready models
- Type-safe queries
- Easy schema migrations
- Optimized relationships
- Credit balance display
- Purchase history
- Account settings
- Profile management
- Email/username change
- Multi-language support (English, German, Arabic)
- RTL/LTR support automatic detection
- Translation management
- Locale switching
- 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 role detection via environment variable
- Admin-only API endpoints
- User management (Pro version)
- Analytics dashboard (Pro version)
📖 Full Documentation: https://cipherslab.gitbook.io/saas-pilot-docs
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 |
🎬 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.
| 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 | ✅ | ✅ |
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
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 checkingCopy .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="admin@example.com"
INITIAL_CREDITS_FOR_NEW="20"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.
- Push your code to GitHub
- Import project in Vercel
- Add environment variables
- Deploy! ✨
SaaSPilot works on any platform supporting Node.js:
- Railway
- Render
- DigitalOcean App Platform
- AWS (Amplify, ECS)
- Google Cloud Run
Contributions are welcome! Here's how:
- Fork the repository
- Create your 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
- Follow the established coding patterns (see docs/coding-patterns.md)
- Add tests for new features
- Update documentation
- Keep commits clean and descriptive
- 🐞 Bug Reports: Open an issue
- 💬 Questions: Check docs/troubleshooting.md first
- 📧 Contact: support@saaspilot.com
This project is licensed under the MIT License - see the LICENSE file for details.
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! 🌟
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
- 🌐 Website: https://saas-pilot.vercel.app
- 📖 Documentation: https://cipherslab.gitbook.io/saas-pilot-docs
- 🎬 Demo: https://saas-pilot-demo.vercel.app
- 🐙 GitHub: https://github.com/your-repo/saaspilot
- 🐦 Twitter: @saaspilot
Built for developers, optimized for AI agents 🤖
Get Started •
AI Guide •
Documentation
Made with ❤️ for the developer community