canx-starter-saas
v1.1.1
Published
SaaS Starter Kit for CanxJS - Multi-tenancy, Billing, Team Management
Downloads
10
Maintainers
Readme
Canx SaaS Starter
💼 SaaS application template with multi-tenancy, team management, and billing.
Features
- ✅ Multi-Tenancy - Subdomain/header-based tenant isolation
- ✅ Team Management - Invite members, assign roles
- ✅ Billing Ready - Subscription management, invoice history
- ✅ Authentication - Login/register with team creation
- ✅ Queue Dashboard - Built-in at
/canx-queue
Quick Start
# Clone the starter
bunx degit chandafa/canx-starters/saas my-saas
# Install dependencies
cd my-saas
bun install
# Start development server
bun run devProject Structure
src/
├── controllers/
│ ├── AuthController.ts # Login/register with team
│ ├── BillingController.ts # Subscription & invoices
│ ├── DashboardController.ts # Main dashboard
│ ├── HomeController.ts # Landing & pricing
│ └── TeamController.ts # Team management
├── middleware/
│ └── tenant.ts # Multi-tenancy middleware
├── views/
│ └── layouts/
│ └── saas.ts # App layout
├── routes.ts # Route definitions
└── app.ts # Application entryMulti-Tenancy
Tenants are identified by:
- Subdomain:
acme.yourdomain.com→ tenant:acme - Header:
X-Tenant-Id: acme
Access tenant in controllers:
const tenant = this.request.context.get("tenant");
console.log(tenant.id); // "acme"Available Routes
| Route | Description |
| ---------------- | ----------------------- |
| / | Landing page |
| /pricing | Pricing page |
| /auth/login | Login |
| /auth/register | Register + create team |
| /dashboard | Main dashboard |
| /team | Team management |
| /billing | Subscription & invoices |
Stripe Integration
To integrate Stripe:
- Install Stripe:
bun add stripe - Set environment variables:
STRIPE_SECRET_KEY=sk_test_... STRIPE_WEBHOOK_SECRET=whsec_... - Update
BillingController.tswith Stripe checkout
License
MIT
