The SaaS Boilerplate ($59) includes multi-tenancy with organizations, team member invites, and role-based access control (RBAC). Users can belong to multiple organizations and switch between them. Each organization has its own billing, users, and settings. The database schema includes organizations, memberships (with roles), and subscriptions tables.
// Organization schema
export const organizations = sqliteTable("organizations", {
id: text("id").primaryKey(),
name: text("name").notNull(),
slug: text("slug").notNull().unique(),
});
export const memberships = sqliteTable("memberships", {
id: text("id").primaryKey(),
userId: text("user_id").notNull(),
organizationId: text("organization_id").notNull(),
role: text("role").default("member"),
});