JSPM

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

CLI tool to instantly bootstrap full-featured SaaS applications with customizable modules

Package Exports

  • saas-factory
  • saas-factory/src/cli.js

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-factory) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

🏭 SaaS Factory

Bootstrap Your SaaS in Minutes, Not Months

npm version license downloads


SaaS Factory is a powerful CLI tool that generates production-ready SaaS applications with authentication, payments, multi-tenancy, teams, and more. Stop writing boilerplate — start building your product.

✨ Features

  • 🎨 Frontend Options: Next.js 14 with App Router and Tailwind CSS
  • ⚙️ Backend Options: Node.js (Express) or Python (FastAPI)
  • 🔐 Authentication: Login, Register, OAuth, JWT tokens, Email verification
  • 💳 Payments: Stripe subscriptions, billing portal, webhooks
  • 🏢 Multi-tenancy: Workspaces with isolated data
  • 🛡️ RBAC: Role-based access control system
  • 👥 Teams: Invite system, member management
  • 📊 Dashboard: Pre-built UI components
  • Add to Existing Projects: Add modules to existing projects easily

🚀 Quick Start

# Create a new SaaS project
npx saas-factory init

# Or add modules to an existing project
npx saas-factory add

# Or install globally
npm install -g saas-factory
saas-factory init

📸 Screenshots

CLI Interface

  ╔═══════════════════════════════════════════════════════════╗
  ║                                                           ║
  ║   ███████╗ █████╗  █████╗ ███████╗                       ║
  ║   ██╔════╝██╔══██╗██╔══██╗██╔════╝                       ║
  ║   ███████╗███████║███████║███████╗                       ║
  ║   ╚════██║██╔══██║██╔══██║╚════██║                       ║
  ║   ███████║██║  ██║██║  ██║███████║                       ║
  ║   ╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝                       ║
  ║                                                           ║
  ║         Bootstrap Your SaaS in Minutes, Not Months        ║
  ║                                                           ║
  ╚═══════════════════════════════════════════════════════════╝

? 🎨 Choose your frontend framework: Next.js (React with App Router)
? ⚙️  Choose your backend framework: Node.js (Express)
? 📦 Select additional modules to include:
  ◉ 🔐 Authentication (Login, Register, OAuth)
  ◉ 💳 Payments (Stripe integration)
  ◉ 🏢 Workspaces (Multi-tenant support)
  ◉ 🛡️  Permissions (RBAC system)
  ◉ 👥 Teams (Invite & collaboration)
  ◉ 📊 Dashboard UI Pack
? 📁 Enter your project name: my-saas-app

📖 Usage

Initialize a New Project

npx saas-factory init

The CLI will guide you through:

  1. Frontend Selection: Choose Next.js or API-only
  2. Backend Selection: Node.js (Express) or Python (FastAPI)
  3. Module Selection: Pick the features you need
  4. Project Name: Name your project

Add Modules to Existing Project

Already have a project? Add SaaS modules directly:

# Interactive mode - choose modules
npx saas-factory add

# Add specific module
npx saas-factory add auth
npx saas-factory add payments
npx saas-factory add teams
npx saas-factory add workspaces
npx saas-factory add permissions
npx saas-factory add ui

# Add to a specific project path
npx saas-factory add payments --path ./my-project

The CLI will:

  1. Auto-detect your project type (Next.js, Express, FastAPI)
  2. Copy files to appropriate locations
  3. Update .env.example with required variables
  4. Preserve existing code (won't overwrite)

List Available Templates

npx saas-factory list

CLI Commands

Command Description
saas-factory init Create a new SaaS project
saas-factory add Add modules interactively
saas-factory add <module> Add specific module
saas-factory add <module> --path <dir> Add module to specific path
saas-factory list Show available modules

Generated Project Structure

my-saas-app/
├── frontend/                 # Next.js application
│   ├── app/                  # App router pages
│   │   ├── auth/            # Login, Register pages
│   │   ├── dashboard/       # Dashboard pages
│   │   └── ...
│   ├── components/          # React components
│   └── lib/                 # Utilities
├── backend/                  # Express/FastAPI server
│   ├── routes/              # API routes
│   ├── middleware/          # Auth, RBAC middleware
│   └── utils/               # Helpers
├── shared/                   # Shared modules
│   ├── auth/                # Auth utilities
│   ├── payments/            # Stripe integration
│   ├── workspaces/          # Multi-tenant logic
│   ├── permissions/         # RBAC system
│   ├── teams/               # Team management
│   └── utils/               # Common utilities
├── .env.example             # Environment template
├── package.json             # Root package.json
└── README.md                # Project documentation

🛠️ Modules

🔐 Authentication

  • Email/Password login and registration
  • Email verification (optional, configurable)
  • OAuth support (Google, GitHub, Twitter/X, Discord)
  • JWT access & refresh tokens
  • Password reset flow
  • Session management

💳 Payments (Stripe)

  • Subscription management
  • Checkout sessions
  • Customer portal
  • Webhook handlers
  • Invoice history

🏢 Workspaces

  • Multi-tenant architecture
  • Workspace switching
  • Isolated data per workspace
  • Workspace settings

🛡️ Permissions (RBAC)

  • Role-based access control
  • Custom roles
  • Permission middleware
  • Wildcard permissions

👥 Teams

  • Email invitations
  • Member management
  • Role assignment
  • Leave workspace

📊 Dashboard UI

  • Statistics cards
  • Data tables
  • Navigation layout
  • Modal dialogs
  • Form components

⚙️ Configuration

After generating your project:

  1. Copy environment variables:

    cp .env.example .env
  2. Configure your database:

    DATABASE_URL=postgresql://user:password@localhost:5432/mydb
  3. Set up Stripe (if using payments):

    STRIPE_SECRET_KEY=sk_test_...
    STRIPE_WEBHOOK_SECRET=whsec_...
  4. Configure OAuth (optional):

    GOOGLE_CLIENT_ID=...
    GOOGLE_CLIENT_SECRET=...
  5. Email verification (if enabled):

    EMAIL_VERIFICATION_REQUIRED=true
    SMTP_HOST=smtp.example.com
    SMTP_PORT=587
    SMTP_USER=...
    SMTP_PASSWORD=...
    FROM_EMAIL=noreply@yourapp.com
  6. Install dependencies:

    npm run install:all
  7. Start development:

    npm run dev

🔧 Project Commands

Command Description
npm run dev Start all development servers
npm run dev:frontend Start frontend only
npm run dev:backend Start backend only
npm run build Build for production
npm run lint Run linters
npm run install:all Install all dependencies

📚 Tech Stack

Frontend

  • Next.js 14 - React framework with App Router
  • Tailwind CSS - Utility-first CSS
  • React Hook Form - Form handling
  • Zod - Schema validation
  • Lucide Icons - Icon library

Backend (Node.js)

  • Express - Web framework
  • Prisma - Database ORM
  • JWT - Authentication tokens
  • Stripe - Payment processing
  • Nodemailer - Email sending
  • Zod - Validation

Backend (FastAPI)

  • FastAPI - Python web framework
  • SQLAlchemy - Database ORM
  • Pydantic - Data validation
  • JWT - Authentication
  • Stripe - Payment processing

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your 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

📄 License

MIT License - see the LICENSE file for details.

🙏 Acknowledgments


Made with ❤️ by the SaaS Factory team

GitHubnpm