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="[email protected]"
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
- π Next.js Docs
- π NextAuth.js Docs
- ποΈ Prisma Docs
- π³ Stripe Docs
- π¨ Tailwind CSS Docs
- π§© Shadcn/ui Docs
- π€ AI Agent Guide
- π Full Documentation
- π― Prompt Templates
- β Troubleshooting
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: [email protected]
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