Welcome to Multi-tenant SaaS
Build enterprise-grade SaaS applications with this comprehensive multi-tenant starter kit. Includes tenant isolation, subscription management, billing, and team collaboration out of the box.
What's Included
- Tenant Management - Complete workspace/organization management with isolation
- Subscription Plans - Flexible plan tiers with feature gating
- Billing Integration - Stripe Billing integration with invoicing
- Team Collaboration - Invite team members with role-based permissions
- User Management - Manage users across multiple tenants
- Settings & Preferences - Tenant-level and user-level settings
- Audit Logs - Track all actions for compliance and security
- API Integration - RESTful API with tenant-scoped endpoints
- White Labeling - Customize branding per tenant
Tech Stack
- React 18
- TypeScript
- DashForm for complex forms
- Material-UI components
- Stripe Billing for subscriptions
- React Router with tenant routing
- TanStack Query for data management
- Vite for development
Getting Started
- Download and extract the starter kit
- Install dependencies:
npm install
- Configure environment variables in
.env
- Set up Stripe Billing products
- Start development server:
npm run dev
- Create your first tenant organization
Prerequisites
- Node.js 18 or higher
- npm or yarn
- Stripe account with Billing enabled
- PostgreSQL or MySQL database (for tenant data)
- Understanding of multi-tenancy concepts
Project Structure
multitenant-saas/
├── src/
│ ├── components/
│ │ ├── Tenant/
│ │ ├── Subscription/
│ │ ├── Team/
│ │ └── Settings/
│ ├── pages/
│ │ ├── Dashboard.tsx
│ │ ├── Organization.tsx
│ │ ├── Team.tsx
│ │ └── Billing.tsx
│ ├── services/
│ │ ├── tenant/
│ │ └── subscription/
│ ├── hooks/
│ └── main.tsx
├── package.json
└── README.md
Key Features
Tenant Isolation
Complete data isolation between tenants. Each organization has its own workspace with separate data and settings.
Subscription Management
Flexible subscription plans with:
- Free, Starter, Pro, and Enterprise tiers
- Feature gating based on plan
- Automatic billing and renewals
- Upgrade/downgrade flows
- Usage-based billing support
Team Collaboration
Invite team members with granular permissions:
- Owner, Admin, Member, and Guest roles
- Custom role creation
- Permission-based UI rendering
- Team activity tracking
Billing & Invoicing
Integrated Stripe Billing:
- Automatic invoice generation
- Payment method management
- Billing history and receipts
- Failed payment handling
- Proration for plan changes
Settings Management
Multi-level settings:
- Tenant-level (organization settings)
- User-level (personal preferences)
- Plan-based feature flags
- Custom domain configuration
Audit Logging
Track all important actions:
- User authentication
- Data modifications
- Permission changes
- Billing events
- Export for compliance
Tenant Architecture
This kit uses a shared database with tenant identifier approach:
- Single application instance serves all tenants
- Database rows tagged with tenant_id
- Middleware ensures tenant isolation
- Optimized for performance and cost
Subscription Plans
Configure plans in src/config/plans.ts:
const plans = {
free: {
price: 0,
features: ['5 users', 'Basic support'],
},
pro: {
price: 49,
features: ['Unlimited users', 'Priority support', 'Advanced analytics'],
},
// ...
};
Stripe Configuration
Set up Stripe in .env:
VITE_STRIPE_PUBLIC_KEY=pk_live_...
VITE_STRIPE_PRICE_FREE=price_...
VITE_STRIPE_PRICE_PRO=price_...
VITE_STRIPE_PRICE_ENTERPRISE=price_...
Backend Requirements
For production, you'll need:
- API server with tenant-scoped endpoints
- Database with tenant isolation
- Stripe webhook handlers for billing events
- Email service for notifications
- Background jobs for subscription management
Mock API included for frontend development.
White Labeling
Customize appearance per tenant:
- Custom logos and colors
- Custom domain support
- Branded email templates
- Tenant-specific settings
Support
Enterprise support available:
License
Commercial license with extended terms for SaaS applications. Contact us for enterprise licensing options.