# danidoble/maestro architecture

> Architecture diagram of the GitHub repository danidoble/maestro, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/danidoble/maestro
- Repository: https://github.com/danidoble/maestro

## Overview

Maestro is a multi-tenant SaaS starter kit: a central application manages customer workspaces, domains, plans, and billing, while domain-resolved tenant applications provide isolated organization features. Users enter through central management or tenant-domain authentication, then interact with workspace administration, access controls, and notifications; subscribed customers also pass through plan checkout and ongoing billing enforcement. The README documents tenant database provisioning and additional Stripe and authentication capabilities. Some subsystems are represented by their exact enclosing directories because their implementation excerpts were not provided.

Main entry points: [`resources/js/pages/central`](https://github.com/danidoble/maestro/tree/main/resources/js/pages/central) (Central dashboard), [`app/Http/Controllers/Web/Central/TenantsController.php`](https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Central/TenantsController.php) (Tenant administration), [`app/Http/Controllers/Web/Central/BillingController.php`](https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Central/BillingController.php) (Checkout and billing), [`database/seeders/Tenant/DatabaseSeeder.php`](https://github.com/danidoble/maestro/blob/main/database/seeders/Tenant/DatabaseSeeder.php) (Tenant databases)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_central["Central management"]
  node_centralui["Central dashboard"]
  node_tenantadmin["Tenant administration"]
  node_domains["Domain management"]
  node_announcements["Announcements"]
end

subgraph group_tenant["Tenant lifecycle"]
  node_tenantrecord[("Tenant and domains<br/>[Tenant.php]")]
  node_provisioning["Tenant provisioning"]
  node_tenantdb[("Tenant databases<br/>[DatabaseSeeder.php]")]
end

subgraph group_billing["Plans and billing"]
  node_planadmin["Plan management<br/>[PlanController.php]"]
  node_billingui["Checkout and billing"]
  node_webhook["Subscription sync"]
  node_entitlements["Plan entitlements"]
  node_access["Billing access"]
end

subgraph group_universal["Shared user features"]
  node_auth["Authentication"]
  node_useradmin["Users and roles<br/>[UserController.php]"]
  node_permissions[("Roles and permissions<br/>[Role.php]")]
  node_inbox["Notification inbox"]
end

subgraph group_platform["Frontend and tenancy"]
  node_tenantcontext["Domain tenancy routing<br/>[app.php]"]
  node_inertia["Inertia frontend<br/>[app.tsx]"]
end

node_operator(("Central user"))
node_tenantuser(("Tenant user"))
node_stripe["Stripe"]

node_operator -->|"uses"| node_centralui
node_centralui -->|"manages tenants"| node_tenantadmin
node_tenantadmin -->|"creates tenant"| node_tenantrecord
node_tenantadmin -->|"registers domain"| node_domains
node_tenantadmin -.->|"triggers provisioning"| node_provisioning
node_provisioning -.->|"creates and seeds"| node_tenantdb
node_centralui -->|"manages announcements"| node_announcements
node_centralui -->|"manages plans"| node_planadmin
node_operator -->|"starts checkout"| node_billingui
node_billingui -->|"opens checkout"| node_stripe
node_stripe -->|"sends events"| node_webhook
node_webhook -->|"synchronizes access"| node_access
node_billingui -->|"checks entitlements"| node_entitlements
node_tenantrecord -->|"tracks access state"| node_access
node_tenantuser -->|"opens tenant domain"| node_tenantcontext
node_tenantcontext -.->|"selects tenant context"| node_tenantdb
node_tenantuser -->|"authenticates"| node_auth
node_tenantuser -->|"manages users"| node_useradmin
node_useradmin -->|"assigns roles"| node_permissions
node_tenantuser -->|"views notifications"| node_inbox
node_inbox -->|"reads tenant announcements"| node_tenantdb
node_centralui -.->|"renders interface"| node_inertia

click node_centralui "https://github.com/danidoble/maestro/tree/main/resources/js/pages/central"
click node_tenantadmin "https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Central/TenantsController.php"
click node_domains "https://github.com/danidoble/maestro/tree/main/app/Http/Controllers/Web/Central"
click node_announcements "https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Central/TenantAnnouncementController.php"
click node_tenantrecord "https://github.com/danidoble/maestro/blob/main/app/Models/Central/Tenant.php"
click node_provisioning "https://github.com/danidoble/maestro/blob/main/app/Providers/TenancyServiceProvider.php"
click node_tenantdb "https://github.com/danidoble/maestro/blob/main/database/seeders/Tenant/DatabaseSeeder.php"
click node_planadmin "https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Central/PlanController.php"
click node_billingui "https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Central/BillingController.php"
click node_webhook "https://github.com/danidoble/maestro/blob/main/app/Listeners/HandleStripeWebhook.php"
click node_entitlements "https://github.com/danidoble/maestro/blob/main/app/Billing/EntitlementService.php"
click node_access "https://github.com/danidoble/maestro/blob/main/app/Billing/BillingAccessManager.php"
click node_auth "https://github.com/danidoble/maestro/blob/main/app/Providers/FortifyServiceProvider.php"
click node_useradmin "https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Universal/UserController.php"
click node_permissions "https://github.com/danidoble/maestro/blob/main/app/Models/Universal/Role.php"
click node_inbox "https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Universal/NotificationController.php"
click node_tenantcontext "https://github.com/danidoble/maestro/blob/main/bootstrap/app.php"
click node_inertia "https://github.com/danidoble/maestro/blob/main/resources/js/app.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_centralui,node_tenantadmin,node_domains,node_announcements,node_operator,node_tenantuser toneBlue
class node_tenantrecord,node_provisioning,node_tenantdb toneAmber
class node_planadmin,node_billingui,node_webhook,node_entitlements,node_access toneMint
class node_auth,node_useradmin,node_permissions,node_inbox toneRose
class node_tenantcontext,node_inertia,node_stripe toneIndigo
```

## Components

### Central management

- [Central dashboard](https://github.com/danidoble/maestro/tree/main/resources/js/pages/central): `resources/js/pages/central`
- [Tenant administration](https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Central/TenantsController.php): `app/Http/Controllers/Web/Central/TenantsController.php`
- [Domain management](https://github.com/danidoble/maestro/tree/main/app/Http/Controllers/Web/Central): `app/Http/Controllers/Web/Central`
- [Announcements](https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Central/TenantAnnouncementController.php): `app/Http/Controllers/Web/Central/TenantAnnouncementController.php`

### Tenant lifecycle

- [Tenant and domains](https://github.com/danidoble/maestro/blob/main/app/Models/Central/Tenant.php): `app/Models/Central/Tenant.php`
- [Tenant provisioning](https://github.com/danidoble/maestro/blob/main/app/Providers/TenancyServiceProvider.php): `app/Providers/TenancyServiceProvider.php`
- [Tenant databases](https://github.com/danidoble/maestro/blob/main/database/seeders/Tenant/DatabaseSeeder.php): `database/seeders/Tenant/DatabaseSeeder.php`

### Plans and billing

- [Plan management](https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Central/PlanController.php): `app/Http/Controllers/Web/Central/PlanController.php`
- [Checkout and billing](https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Central/BillingController.php): `app/Http/Controllers/Web/Central/BillingController.php`
- [Subscription sync](https://github.com/danidoble/maestro/blob/main/app/Listeners/HandleStripeWebhook.php): `app/Listeners/HandleStripeWebhook.php`
- [Plan entitlements](https://github.com/danidoble/maestro/blob/main/app/Billing/EntitlementService.php): `app/Billing/EntitlementService.php`
- [Billing access](https://github.com/danidoble/maestro/blob/main/app/Billing/BillingAccessManager.php): `app/Billing/BillingAccessManager.php`

### Shared user features

- [Authentication](https://github.com/danidoble/maestro/blob/main/app/Providers/FortifyServiceProvider.php): `app/Providers/FortifyServiceProvider.php`
- [Users and roles](https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Universal/UserController.php): `app/Http/Controllers/Web/Universal/UserController.php`
- [Roles and permissions](https://github.com/danidoble/maestro/blob/main/app/Models/Universal/Role.php): `app/Models/Universal/Role.php`
- [Notification inbox](https://github.com/danidoble/maestro/blob/main/app/Http/Controllers/Web/Universal/NotificationController.php): `app/Http/Controllers/Web/Universal/NotificationController.php`

### Frontend and tenancy

- [Domain tenancy routing](https://github.com/danidoble/maestro/blob/main/bootstrap/app.php): `bootstrap/app.php`
- [Inertia frontend](https://github.com/danidoble/maestro/blob/main/resources/js/app.tsx): `resources/js/app.tsx`

### Other components

- **Central user**
- **Tenant user**
- **Stripe**

## Connections

- Central user → Central dashboard: uses (evidence: `README.md`)
- Central dashboard → Tenant administration: manages tenants (evidence: `README.md`)
- Tenant administration → Tenant and domains: creates tenant (evidence: `app/Http/Controllers/Web/Central/TenantsController.php`)
- Tenant administration → Domain management: registers domain (evidence: `app/Http/Controllers/Web/Central/TenantsController.php`)
- Tenant administration → Tenant provisioning: triggers provisioning (evidence: `README.md`)
- Tenant provisioning → Tenant databases: creates and seeds (evidence: `README.md`)
- Central dashboard → Announcements: manages announcements (evidence: `README.md`)
- Central dashboard → Plan management: manages plans (evidence: `README.md`)
- Central user → Checkout and billing: starts checkout (evidence: `README.md`)
- Checkout and billing → Stripe: opens checkout (evidence: `README.md`)
- Stripe → Subscription sync: sends events (evidence: `README.md`)
- Subscription sync → Billing access: synchronizes access (evidence: `app/Listeners/HandleStripeWebhook.php`)
- Checkout and billing → Plan entitlements: checks entitlements (evidence: `app/Http/Controllers/Web/Central/BillingController.php`)
- Tenant and domains → Billing access: tracks access state (evidence: `app/Billing/BillingAccessManager.php`)
- Tenant user → Domain tenancy routing: opens tenant domain (evidence: `README.md`)
- Domain tenancy routing → Tenant databases: selects tenant context (evidence: `README.md`)
- Tenant user → Authentication: authenticates (evidence: `README.md`)
- Tenant user → Users and roles: manages users (evidence: `README.md`)
- Users and roles → Roles and permissions: assigns roles (evidence: `app/Http/Controllers/Web/Universal/UserController.php`)
- Tenant user → Notification inbox: views notifications (evidence: `README.md`)
- Notification inbox → Tenant databases: reads tenant announcements (evidence: `app/Http/Controllers/Web/Universal/NotificationController.php`)
- Central dashboard → Inertia frontend: renders interface (evidence: `README.md`)
