๐Ÿš€ AIaaS Boilerplate 2025

June 25, 2025 ยท View on GitHub

A complete, production-ready Next.js 15 AIaaS boilerplate with modern integrations, AI capabilities, and automation features.

โœจ Features

๐Ÿ” Authentication & Database

  • Clerk Authentication - Complete user management with social logins
  • Supabase Database - PostgreSQL with Row Level Security (RLS)
  • Real-time sync - Webhook-based synchronization between Clerk and Supabase

๐Ÿ’ณ Payments & Billing

  • Stripe Integration - Subscriptions, one-time payments, customer portal
  • European VAT compliance - Automatic tax calculation
  • Invoice generation - Custom PDF invoices with branding
  • Webhook handling - Complete payment lifecycle management

๐Ÿค– AI Integrations

  • CopilotKit - AI chat assistant with context awareness
  • Model Context Protocol (MCP) - Advanced AI tool execution
  • AG-UI Protocol - AI-generated UI components
  • Google A2A Protocol - Agent-to-agent communication

โšก Automation

  • n8n Integration - Visual workflow automation
  • Make.com Integration - Advanced scenario automation
  • Webhook management - Secure event handling

๐ŸŽจ Modern UI/UX

  • shadcn/ui Components - Beautiful, accessible components
  • Tailwind CSS - Utility-first styling
  • Dark mode support - System preference detection
  • Responsive design - Mobile-first approach

๐Ÿ”ง Developer Experience

  • TypeScript - Full type safety
  • ESLint & Prettier - Code quality tools
  • Docker support - Production-ready containers
  • CI/CD Pipeline - GitHub Actions automation

๐Ÿ—๏ธ Architecture

graph TB
    A[Next.js App] --> B[Clerk Auth]
    A --> C[Supabase DB]
    A --> D[Stripe Payments]
    A --> E[AI Services]
    A --> F[Automation]
    
    E --> E1[CopilotKit]
    E --> E2[MCP]
    E --> E3[AG-UI]
    E --> E4[Google A2A]
    
    F --> F1[n8n]
    F --> F2[Make.com]
    
    A --> G[WordPress CMS]
    A --> H[Waitlist System]

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 20+
  • pnpm 9+
  • Docker (optional)

1. Clone the Repository

git clone https://github.com/Vesias/AIaaS-Boilerplate-Framework.git
cd AIaaS-Boilerplate-Framework

2. Install Dependencies

pnpm install

3. Environment Setup

Copy the environment template:

cp .env.example .env.local

Fill in your environment variables:

# App Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000
NODE_ENV=development

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your_key_here
CLERK_SECRET_KEY=sk_test_your_key_here
CLERK_WEBHOOK_SECRET=your_webhook_secret_here

# 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
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_key
STRIPE_SECRET_KEY=sk_test_your_stripe_secret
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret

# AI Integrations
OPENAI_API_KEY=your_openai_api_key
NEXT_PUBLIC_COPILOTKIT_RUNTIME_URL=/api/copilotkit

# Automation
N8N_API_KEY=your_n8n_api_key
N8N_WEBHOOK_URL=http://localhost:5678
MAKE_WEBHOOK_TOKEN=your_make_webhook_token

4. Database Setup

  1. Create a Supabase project
  2. Run the SQL schema from supabase/schema.sql in your Supabase SQL editor
  3. Configure RLS policies as defined in the schema

Option B: Use Local PostgreSQL

# Start local database with Docker
docker-compose -f docker-compose.dev.yml up postgres redis -d

5. Start Development Server

pnpm dev

Visit http://localhost:3000 to see your application.

๐Ÿ“ฆ Deployment

Docker Deployment

Development

# Start all services for development
docker-compose -f docker-compose.dev.yml up

Production

# Build and start production services
docker-compose up -d
  1. Push your code to GitHub
  2. Connect your repository to Vercel
  3. Configure environment variables in Vercel dashboard
  4. Deploy automatically on push to main branch

Manual Deployment

# Build the application
pnpm build

# Start production server
pnpm start

๐Ÿ”ง Configuration

Webhook Endpoints

Configure these webhook URLs in your service dashboards:

  • Clerk: https://yourdomain.com/api/webhooks/clerk
  • Stripe: https://yourdomain.com/api/webhooks/stripe
  • n8n: https://yourdomain.com/api/webhooks/n8n
  • Make.com: https://yourdomain.com/api/webhooks/make

Service Setup Guides

Detailed setup guides are available in the docs/ directory:

๐Ÿงช Testing

# Run type checking
pnpm type-check

# Run linting
pnpm lint

# Run tests (when implemented)
pnpm test

# Build check
pnpm build

๐Ÿ“Š Monitoring

Health Checks

  • Application health: GET /api/health
  • Service status: Monitor all integrated services
  • Database connectivity: Automatic checks

Performance

  • Built-in Lighthouse CI in GitHub Actions
  • Core Web Vitals monitoring
  • Real User Monitoring (RUM) ready

๐Ÿ”’ Security

Features

  • Row Level Security (RLS) - Database-level security
  • Webhook signature validation - Secure webhook handling
  • Environment variable validation - Runtime checks
  • CORS configuration - Proper cross-origin setup
  • Rate limiting - API protection (configurable)

Best Practices

  • Never commit secrets to version control
  • Use environment-specific configurations
  • Regular dependency updates via Dependabot
  • Security scanning in CI/CD pipeline

๐Ÿค Contributing

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

๐Ÿ“ Scripts

# Development
pnpm dev                 # Start development server
pnpm build              # Build for production
pnpm start              # Start production server
pnpm lint               # Run ESLint
pnpm type-check         # Run TypeScript checks

# Docker
pnpm docker:build       # Build Docker image
pnpm docker:run         # Run Docker container
pnpm docker:dev         # Start development environment
pnpm docker:prod        # Start production environment

๐Ÿ› ๏ธ Tech Stack

  • Framework: Next.js 15 with App Router
  • Language: TypeScript
  • Styling: Tailwind CSS + shadcn/ui
  • Authentication: Clerk
  • Database: Supabase (PostgreSQL)
  • Payments: Stripe
  • AI: CopilotKit, MCP, AG-UI, Google A2A
  • Automation: n8n, Make.com
  • CMS: WordPress (Headless)
  • Deployment: Docker, Vercel
  • CI/CD: GitHub Actions

๐Ÿ“š Documentation

๐Ÿ“„ License

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

๐Ÿ™ Acknowledgments

๐Ÿ†˜ Support


Built with โค๏ธ for the developer community