//The Hierarchy (App/Org/User)

The Hierarchy: App, Org, User

Understanding the ButtrBase data model is crucial for effective integration. The system is built around a strict hierarchy that enforces multi-tenancy and data isolation.

1. Application (The Root)

The Application represents your SaaS product.
  • It contains global settings, feature definitions, and subscription plans.
  • Example: "SuperTasker" (your SaaS).
  • 2. Organization (The Tenant)

    The Organization is the billing unit and the primary container for data.
  • Users belong to Organizations.
  • Subscriptions are attached to Organizations.
  • Feature flags can be targeted at Organizations.
  • Example: "Acme Corp" (your customer).
  • 3. Team (The Sub-Group)

    Teams allow for granular grouping within an Organization.
  • Useful for RBAC (e.g., "Developers", "Marketing").
  • Users can belong to multiple teams within an Organization.
  • 4. User (The Identity)

    The User is the individual actor.
  • A user has a unique identity (email/password).
  • A user is linked to an Organization via a membership.
  • Users can hold specific Roles (e.g., "Admin", "Editor").

Relationship Diagram

App** (1) -> (N) *Organizations Organization** (1) -> (N) *Teams Organization** (1) -> (N) *Users User** (1) -> (N) *Teams