JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 117
  • Score
    100M100P100Q33464F
  • License MIT

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (saas-forge) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    πŸ”₯ SaaS Forge

    The Ultimate Production-Ready SaaS Boilerplate

    Version License: MIT PRs Welcome Node Version pnpm

    Features β€’ Quick Start β€’ Documentation β€’ Tech Stack β€’ Contributing


    πŸ“– Overview

    SaaS Forge is a production-ready, full-stack SaaS boilerplate built with modern technologies. Launch your SaaS product in days, not months. Built with scalability, performance, and developer experience in mind.

    Why SaaS Forge?

    • ⚑ Lightning Fast Setup - Get up and running in minutes with automated CLI
    • πŸ—οΈ Production Ready - Battle-tested architecture used in real products
    • 🎨 Beautiful UI - Pre-built components with shadcn/ui and Tailwind CSS
    • πŸ” Enterprise Auth - Complete authentication with social logins and email verification
    • πŸ’³ Payment Integration - Built-in payment handling with webhooks
    • πŸ“± Responsive Design - Mobile-first approach with modern aesthetics
    • πŸš€ Optimized Performance - Redis caching, React Query, and Next.js 15 optimizations
    • πŸ§ͺ Type Safe - End-to-end type safety with TypeScript and tRPC
    • πŸ“¦ Monorepo Architecture - Organized with Turborepo for scalability
    • 🎯 Developer Experience - Hot reload, ESLint, Prettier, and comprehensive tooling

    ✨ Features

    πŸ”‘ Authentication & Authorization

    • Email/Password authentication
    • Social logins (GitHub, Google, LinkedIn)
    • Email verification flows
    • Password reset functionality
    • Session management
    • Protected routes middleware
    • User impersonation (admin)

    πŸ’° Payments & Billing

    • Dodo Payments integration
    • Webhook handling
    • Subscription management
    • Usage-based billing support
    • Credit system

    🎨 UI/UX Components

    • 50+ pre-built shadcn/ui components
    • Notion-style block renderer
    • MDX support for documentation
    • Dark mode support
    • Animated components (Aceternity)
    • Responsive design system
    • Loading states & error boundaries

    πŸ› οΈ Developer Tools

    • tRPC for type-safe APIs
    • React Query for data fetching
    • Prisma ORM with PostgreSQL
    • Redis caching (Upstash)
    • Winston + Logtail logging
    • Vitest for testing

    πŸ“„ Content Management

    • Notion CMS Integration - Manage content directly from Notion
    • Dynamic landing pages
    • Documentation system
    • Legal pages (Terms, Privacy, Refund Policy)
    • Newsletter & support forms
    • n8n webhook automation

    πŸ“Š Observability & Monitoring

    • Centralized logging with Winston
    • Logtail integration for log aggregation
    • Request/response logging for Notion API
    • Performance monitoring hooks

    πŸš€ Quick Start

    npx saas-forge my-saas-app
    cd my-saas-app
    pnpm install
    pnpm dev

    Manual Installation

    # Clone the repository
    git clone https://github.com/anoopkarnik/saas-forge.git
    cd saas-forge
    
    # Install dependencies
    pnpm install
    
    # Copy environment variables
    cp apps/web/.env.example apps/web/.env
    
    # Generate Prisma client
    pnpm run generate
    
    # Run development server
    pnpm dev

    Visit http://localhost:3000 to see your app! πŸŽ‰


    πŸ“š Documentation

    Environment Configuration

    Create a apps/web/.env file with the following variables:

    # Database
    DATABASE_URL="postgresql://..."
    
    # Redis (Upstash)
    UPSTASH_REDIS_REST_URL="https://..."
    UPSTASH_REDIS_REST_TOKEN="..."
    
    # Better Auth
    BETTER_AUTH_SECRET="..."
    BETTER_AUTH_URL="http://localhost:3000"
    
    # OAuth Providers
    AUTH_GITHUB_ID="..."
    AUTH_GITHUB_SECRET="..."
    AUTH_GOOGLE_ID="..."
    AUTH_GOOGLE_SECRET="..."
    AUTH_LINKEDIN_ID="..."
    AUTH_LINKEDIN_SECRET="..."
    
    # Email (Resend)
    RESEND_API_KEY="..."
    
    # Notion CMS
    NOTION_API_KEY="..."
    LANDING_DATABASE_ID="..."
    DOCUMENTATION_DATABASE_ID="..."
    
    # Payments (Dodo)
    DODO_API_KEY="..."
    DODO_WEBHOOK_SECRET="..."
    
    # Observability
    BETTERSTACK_TELEMETRY_SOURCE_TOKEN="..."
    BETTERSTACK_TELEMETRY_INGESTING_HOST="..."
    
    # Webhooks (n8n)
    N8N_SUPPORT_WEBHOOK="..."
    N8N_NEWSLETTER_WEBHOOK="..."
    N8N_CHATBOT_WEBHOOK="..."

    See apps/web/.env.example for a complete list.


    πŸ—οΈ Tech Stack

    Frontend

    • Framework: Next.js 15 (App Router)
    • Language: TypeScript 5.7
    • UI Library: React 19
    • Styling: Tailwind CSS 4.x
    • Components: shadcn/ui
    • Animations: Framer Motion
    • Forms: React Hook Form + Zod
    • State: React Query + tRPC

    Backend

    • API: tRPC (Type-safe)
    • Database: PostgreSQL + Prisma
    • Caching: Redis (Upstash)
    • Auth: Better Auth
    • Email: Resend + React Email
    • Payments: Dodo Payments
    • CMS: Notion API
    • Logging: Winston + Logtail

    Tooling & DevOps

    • Monorepo: Turborepo + pnpm workspaces
    • Testing: Vitest
    • Linting: ESLint 9 + Prettier
    • CI/CD: GitHub Actions
    • Deployment: Vercel (recommended)

    πŸ“¦ Project Structure

    saas-forge/
    β”œβ”€β”€ apps/
    β”‚   └── web/                    # Main Next.js application
    β”‚       β”œβ”€β”€ app/                # App router pages
    β”‚       β”‚   β”œβ”€β”€ (auth)/        # Authentication pages
    β”‚       β”‚   β”œβ”€β”€ (home)/        # Protected home pages
    β”‚       β”‚   β”œβ”€β”€ landing/       # Public landing pages
    β”‚       β”‚   └── api/           # API routes
    β”‚       β”œβ”€β”€ blocks/            # Page-level components
    β”‚       β”œβ”€β”€ components/        # Feature components
    β”‚       β”œβ”€β”€ lib/               # Utility functions
    β”‚       β”œβ”€β”€ server/            # Server-side utilities
    β”‚       └── trpc/              # tRPC configuration
    β”‚
    β”œβ”€β”€ packages/
    β”‚   β”œβ”€β”€ ui/                    # Shared UI components
    β”‚   β”œβ”€β”€ auth/                  # Authentication logic
    β”‚   β”œβ”€β”€ database/              # Prisma schema & client
    β”‚   β”œβ”€β”€ email/                 # Email templates
    β”‚   β”œβ”€β”€ cms/                   # Notion CMS integration
    β”‚   β”œβ”€β”€ observability/         # Logging utilities
    β”‚   β”œβ”€β”€ eslint-config/         # Shared ESLint config
    β”‚   └── typescript-config/     # Shared TS config
    β”‚
    β”œβ”€β”€ scripts/
    β”‚   └── cli.js                 # CLI for project scaffolding
    β”‚
    └── templates/
        └── saas-boilerplate/      # Template for new projects

    🎯 Commands

    Development

    # Start all workspaces in dev mode
    pnpm dev
    
    # Start only web app
    pnpm --filter web dev
    
    # Build all workspaces
    pnpm build
    
    # Build only web app
    pnpm --filter web build

    Code Quality

    # Lint all workspaces
    pnpm lint
    
    # Lint with auto-fix
    pnpm --filter web lint:fix
    
    # Format code with Prettier
    pnpm format
    
    # Type check
    pnpm --filter web typecheck

    Database

    # Generate Prisma client
    pnpm --filter @workspace/database postgres:generate
    
    # Run migrations
    pnpm --filter @workspace/database postgres:migrate
    
    # Reset database (⚠️ destroys data)
    pnpm --filter @workspace/database postgres:reset

    Testing

    # Run all tests
    pnpm --filter @workspace/cms test
    
    # Run specific test file
    pnpm --filter @workspace/cms test -- testing/index.test.ts

    🎨 Adding UI Components

    SaaS Forge uses shadcn/ui for components. To add a new component:

    # Add a component (e.g., button)
    pnpm dlx shadcn@latest add button -c apps/web
    
    # Import in your code
    import { Button } from "@workspace/ui/components/button"

    Components are automatically placed in packages/ui/src/components and can be used across all apps.


    πŸ”§ Customization

    Theming

    Modify theme colors in apps/web/app/globals.css:

    @layer base {
      :root {
        --primary: 222 47% 11%;
        --primary-foreground: 210 40% 98%;
        /* ... more variables */
      }
    }

    Content Management

    All content is managed through Notion databases:

    1. Landing Page: Configure in Notion database specified by LANDING_DATABASE_ID
    2. Documentation: Configure in Notion database specified by DOCUMENTATION_DATABASE_ID
    3. Legal Pages: Managed through the same landing database with filters

    Update content in Notion, and it reflects automatically on your site!

    Authentication Providers

    Add/remove providers in packages/auth/src/better-auth/auth.ts:

    socialProviders: {
      github: {
        clientId: process.env.AUTH_GITHUB_ID!,
        clientSecret: process.env.AUTH_GITHUB_SECRET!,
      },
      // Add more providers...
    }

    🚒 Deployment

    Deploy with Vercel

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

    Other Platforms

    SaaS Forge works with any platform that supports Next.js:


    🀝 Contributing

    We love contributions! Please read our Contributing Guide before submitting a Pull Request.

    Development Workflow

    1. Fork the repository
    2. Create a feature branch: git checkout -b feature/amazing-feature
    3. Make your changes
    4. Run tests: pnpm test
    5. Commit changes: git commit -m 'Add amazing feature'
    6. Push to branch: git push origin feature/amazing-feature
    7. Open a Pull Request

    Code Standards

    • Write TypeScript with strict mode
    • Follow ESLint rules
    • Add tests for new features
    • Update documentation
    • Keep components small and focused
    • Use semantic commit messages

    πŸ“ License

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


    πŸ™ Acknowledgments

    Built with amazing open-source projects:


    πŸ’¬ Support & Community


    πŸ—ΊοΈ Roadmap

    Current Focus

    • βœ… Core authentication flows
    • βœ… Payment integration
    • βœ… Notion CMS integration
    • βœ… Monorepo architecture

    Upcoming Features

    • πŸ”„ Multi-tenancy support
    • πŸ”„ Advanced RBAC (Role-Based Access Control)
    • πŸ”„ Team collaboration features
    • πŸ”„ API key management
    • πŸ”„ Advanced analytics dashboard
    • πŸ”„ Email templates library
    • πŸ”„ Mobile app support (React Native)
    • πŸ”„ GraphQL support
    • πŸ”„ i18n (Internationalization)
    • πŸ”„ A/B testing framework

    See our GitHub Projects for detailed progress.


    ⭐ Show Your Support

    If you find SaaS Forge helpful, please consider:

    • ⭐ Starring the repository
    • πŸ› Reporting bugs
    • πŸ’‘ Suggesting new features
    • πŸ“– Improving documentation
    • πŸ”€ Submitting pull requests

    Built with ❀️ by Anoop Karnik

    ⬆ back to top