# dmitryisaenko/larafoundry architecture

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

- Interactive diagram: https://gitdiagram.com/dmitryisaenko/larafoundry
- Repository: https://github.com/dmitryisaenko/larafoundry

## Overview

LaraFoundry is a reusable Laravel SaaS/CRM foundation, not a finished application: it provides authentication, tenancy and authorization primitives, operator-console features, and optional cross-cutting product modules. Users authenticate, work within a company context, and use profile, legal, notification, and support features; operators manage users, companies, and platform activity. The graph preserves documented capabilities even where implementation was not sampled. Edges are limited to explicit README claims or source-index/excerpt references; several module-to-module relationships are therefore omitted.

Main entry points: [`src/Tenancy`](https://github.com/dmitryisaenko/larafoundry/tree/main/src/Tenancy) (Company tenancy), [`src/Tenancy/Http/Controllers/EmployeeController.php`](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Tenancy/Http/Controllers/EmployeeController.php) (Employee lifecycle), [`resources/js/Pages/Auth`](https://github.com/dmitryisaenko/larafoundry/tree/main/resources/js/Pages/Auth) (Authentication screens), [`src/Admin/Http/Controllers/UserController.php`](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Admin/Http/Controllers/UserController.php) (User administration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and access"]
  node_auth["Authentication"]
  node_authui["Authentication screens"]
end

subgraph group_tenancy["Tenancy and roles"]
  node_tenancy[("Company tenancy")]
  node_employee["Employee lifecycle"]
  node_rbac["Roles and permissions"]
end

subgraph group_operator["Operator console"]
  node_adminusers["User administration<br/>[UserController.php]"]
  node_admincompanies["Company administration"]
  node_dashboard["Admin dashboard"]
end

subgraph group_platform["Shared platform services"]
  node_activity["Activity logging"]
  node_media["Media library"]
  node_billing["Billing seam"]
  node_settings[("Settings service")]
  node_seo["SEO and sitemap<br/>[SeoManager.php]"]
  node_onboarding["Onboarding checklist"]
end

subgraph group_userfeatures["User-facing features"]
  node_profile["Profile and data rights"]
  node_legal["Legal and consent<br/>[ConsentManager.php]"]
  node_notifications["Notifications"]
  node_tickets[("Support tickets")]
  node_email["Email templates"]
end

node_user(("User"))
node_operator(("Operator"))

node_user -->|"starts sign-in"| node_authui
node_authui -->|"authenticates"| node_auth
node_user -->|"uses company"| node_tenancy
node_operator -->|"manages users"| node_adminusers
node_operator -->|"manages companies"| node_admincompanies
node_operator -->|"views metrics"| node_dashboard
node_adminusers -->|"records actions"| node_activity
node_employee -->|"manages members"| node_tenancy
node_employee -->|"assigns roles"| node_rbac
node_user -->|"manages account"| node_profile
node_user -->|"records consent"| node_legal
node_legal -->|"stores consent"| node_settings
node_user -->|"reads notifications"| node_notifications
node_user -->|"opens tickets"| node_tickets
node_operator -->|"handles tickets"| node_tickets
node_operator -->|"edits templates"| node_email
node_dashboard -->|"shows widgets"| node_operator
node_onboarding -->|"nudges setup"| node_user
node_seo -->|"serves metadata"| node_user
node_tenancy -->|"exposes billing seam"| node_billing
node_user -->|"uploads files"| node_media

click node_auth "https://github.com/dmitryisaenko/larafoundry/tree/main/src/Auth"
click node_authui "https://github.com/dmitryisaenko/larafoundry/tree/main/resources/js/Pages/Auth"
click node_tenancy "https://github.com/dmitryisaenko/larafoundry/tree/main/src/Tenancy"
click node_employee "https://github.com/dmitryisaenko/larafoundry/blob/main/src/Tenancy/Http/Controllers/EmployeeController.php"
click node_rbac "https://github.com/dmitryisaenko/larafoundry/tree/main/src/Authorization"
click node_adminusers "https://github.com/dmitryisaenko/larafoundry/blob/main/src/Admin/Http/Controllers/UserController.php"
click node_admincompanies "https://github.com/dmitryisaenko/larafoundry/blob/main/src/Admin/Http/Controllers/CompanyController.php"
click node_dashboard "https://github.com/dmitryisaenko/larafoundry/blob/main/src/Dashboard/Support/DashboardBuilder.php"
click node_activity "https://github.com/dmitryisaenko/larafoundry/tree/main/src/ActivityLog"
click node_media "https://github.com/dmitryisaenko/larafoundry/blob/main/src/Media/Support/FileStorageManager.php"
click node_billing "https://github.com/dmitryisaenko/larafoundry/tree/main/src/Billing"
click node_settings "https://github.com/dmitryisaenko/larafoundry/blob/main/src/Settings/Support/SettingsRepository.php"
click node_seo "https://github.com/dmitryisaenko/larafoundry/blob/main/src/Seo/Support/SeoManager.php"
click node_onboarding "https://github.com/dmitryisaenko/larafoundry/blob/main/src/Onboarding/Support/OnboardingBuilder.php"
click node_profile "https://github.com/dmitryisaenko/larafoundry/tree/main/src/Profile"
click node_legal "https://github.com/dmitryisaenko/larafoundry/blob/main/src/Legal/Support/ConsentManager.php"
click node_notifications "https://github.com/dmitryisaenko/larafoundry/tree/main/src/Notifications"
click node_tickets "https://github.com/dmitryisaenko/larafoundry/blob/main/src/Tickets/Http/Controllers/TicketController.php"
click node_email "https://github.com/dmitryisaenko/larafoundry/blob/main/src/Email/Http/Controllers/Admin/EmailTemplateController.php"

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_auth,node_authui,node_user toneBlue
class node_tenancy,node_employee,node_rbac toneAmber
class node_adminusers,node_admincompanies,node_dashboard toneMint
class node_activity,node_media,node_billing,node_settings,node_seo,node_onboarding toneRose
class node_profile,node_legal,node_notifications,node_tickets,node_email,node_operator toneIndigo
```

## Components

### Identity and access

- [Authentication](https://github.com/dmitryisaenko/larafoundry/tree/main/src/Auth): `src/Auth`
- [Authentication screens](https://github.com/dmitryisaenko/larafoundry/tree/main/resources/js/Pages/Auth): `resources/js/Pages/Auth`

### Tenancy and roles

- [Company tenancy](https://github.com/dmitryisaenko/larafoundry/tree/main/src/Tenancy): `src/Tenancy`
- [Employee lifecycle](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Tenancy/Http/Controllers/EmployeeController.php): `src/Tenancy/Http/Controllers/EmployeeController.php`
- [Roles and permissions](https://github.com/dmitryisaenko/larafoundry/tree/main/src/Authorization): `src/Authorization`

### Operator console

- [User administration](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Admin/Http/Controllers/UserController.php): `src/Admin/Http/Controllers/UserController.php`
- [Company administration](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Admin/Http/Controllers/CompanyController.php): `src/Admin/Http/Controllers/CompanyController.php`
- [Admin dashboard](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Dashboard/Support/DashboardBuilder.php): `src/Dashboard/Support/DashboardBuilder.php`

### Shared platform services

- [Activity logging](https://github.com/dmitryisaenko/larafoundry/tree/main/src/ActivityLog): `src/ActivityLog`
- [Media library](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Media/Support/FileStorageManager.php): `src/Media/Support/FileStorageManager.php`
- [Billing seam](https://github.com/dmitryisaenko/larafoundry/tree/main/src/Billing): `src/Billing`
- [Settings service](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Settings/Support/SettingsRepository.php): `src/Settings/Support/SettingsRepository.php`
- [SEO and sitemap](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Seo/Support/SeoManager.php): `src/Seo/Support/SeoManager.php`
- [Onboarding checklist](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Onboarding/Support/OnboardingBuilder.php): `src/Onboarding/Support/OnboardingBuilder.php`

### User-facing features

- [Profile and data rights](https://github.com/dmitryisaenko/larafoundry/tree/main/src/Profile): `src/Profile`
- [Legal and consent](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Legal/Support/ConsentManager.php): `src/Legal/Support/ConsentManager.php`
- [Notifications](https://github.com/dmitryisaenko/larafoundry/tree/main/src/Notifications): `src/Notifications`
- [Support tickets](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Tickets/Http/Controllers/TicketController.php): `src/Tickets/Http/Controllers/TicketController.php`
- [Email templates](https://github.com/dmitryisaenko/larafoundry/blob/main/src/Email/Http/Controllers/Admin/EmailTemplateController.php): `src/Email/Http/Controllers/Admin/EmailTemplateController.php`

### Other components

- **User**
- **Operator**

## Connections

- User → Authentication screens: starts sign-in
- Authentication screens → Authentication: authenticates
- User → Company tenancy: uses company
- Operator → User administration: manages users
- Operator → Company administration: manages companies
- Operator → Admin dashboard: views metrics
- User administration → Activity logging: records actions (evidence: `src/Admin/Http/Controllers/UserController.php`)
- Employee lifecycle → Company tenancy: manages members (evidence: `src/Tenancy/Http/Controllers/EmployeeController.php`)
- Employee lifecycle → Roles and permissions: assigns roles (evidence: `src/Tenancy/Http/Controllers/EmployeeController.php`)
- User → Profile and data rights: manages account
- User → Legal and consent: records consent
- Legal and consent → Settings service: stores consent (evidence: `src/Legal/Support/ConsentManager.php`)
- User → Notifications: reads notifications
- User → Support tickets: opens tickets
- Operator → Support tickets: handles tickets
- Operator → Email templates: edits templates
- Admin dashboard → Operator: shows widgets
- Onboarding checklist → User: nudges setup
- SEO and sitemap → User: serves metadata
- Company tenancy → Billing seam: exposes billing seam (evidence: `src/Tenancy/Models/Company.php`)
- User → Media library: uploads files
