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
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
- 💳 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
🚀 Quick Start
# Create a new SaaS project
npx saas-factory init
# 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 initThe CLI will guide you through:
- Frontend Selection: Choose Next.js or API-only
- Backend Selection: Node.js (Express) or Python (FastAPI)
- Module Selection: Pick the features you need
- Project Name: Name your project
List Available Templates
npx saas-factory listGenerated 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
- OAuth support (Google, GitHub)
- 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:
Copy environment variables:
cp .env.example .envConfigure your database:
DATABASE_URL=postgresql://user:password@localhost:5432/mydbSet up Stripe (if using payments):
STRIPE_SECRET_KEY=sk_test_... STRIPE_WEBHOOK_SECRET=whsec_...Configure OAuth (optional):
GOOGLE_CLIENT_ID=... GOOGLE_CLIENT_SECRET=...Install dependencies:
npm run install:allStart development:
npm run dev
🔧 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
- 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.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Next.js - The React Framework
- Tailwind CSS - Utility-first CSS
- Stripe - Payment processing
- Prisma - Database toolkit
Made with ❤️ by the SaaS Factory team