# airamgg99/b2b-operations-hub architecture

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

- Interactive diagram: https://gitdiagram.com/airamgg99/b2b-operations-hub
- Repository: https://github.com/airamgg99/b2b-operations-hub

## Overview

This is a Laravel/Inertia B2B operations hub for managing companies, users, and subscriptions, with authentication, email verification, profile management, and a dashboard. A typical request enters Laravel’s web routes, reaches a controller, and returns an Inertia page or redirect; the Vue app resolves and mounts the page. Controllers use Eloquent models for tenant-aware domain data. The source excerpts support the main routes, CRUD, and page-render links; unsampled route details and persistence configuration limit finer-grained flow claims.

Main entry points: [`app/Models/Company.php`](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Models/Company.php) (Company model), [`resources/js/app.js`](https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/app.js) (Inertia Vue app), [`routes/web.php`](https://github.com/airamgg99/b2b-operations-hub/blob/main/routes/web.php) (Web routes), [`app/Models/User.php`](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Models/User.php) (User model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web and UI"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_auth_routes["Auth routes<br/>[auth.php]"]
  node_inertia_client["Inertia Vue app<br/>[app.js]"]
  node_app_layout["App layout<br/>[AppLayout.vue]"]
  node_dashboard_page["Dashboard page<br/>[Dashboard.vue]"]
  node_companies_page["Companies page<br/>[Index.vue]"]
  node_users_page["Users page<br/>[Index.vue]"]
  node_subscriptions_page["Subscriptions page<br/>[Index.vue]"]
  node_auth_page["Auth pages<br/>[Login.vue]"]
end

subgraph group_identity["Identity and access"]
  node_auth_controller["Session and registration"]
  node_registration_controller["User registration"]
  node_login_request["Login validation<br/>[LoginRequest.php]"]
  node_profile_controller["Profile management"]
end

subgraph group_operations["Operations"]
  node_dashboard_controller["Dashboard"]
  node_company_controller["Company management"]
  node_user_controller["User management<br/>[UserController.php]"]
  node_subscription_controller["Subscription management"]
end

subgraph group_domain["Domain data"]
  node_company_model["Company model<br/>[Company.php]"]
  node_user_model["User model<br/>[User.php]"]
  node_subscription_model["Subscription model<br/>[Subscription.php]"]
  node_tenant_trait["Tenant scoping<br/>[Tenantable.php]"]
end

node_visitor(("Visitor / user"))

node_visitor -->|"requests pages"| node_web_routes
node_visitor -->|"requests identity"| node_auth_routes
node_web_routes -->|"routes to"| node_dashboard_controller
node_web_routes -->|"routes to"| node_company_controller
node_web_routes -->|"routes to"| node_user_controller
node_web_routes -->|"routes to"| node_subscription_controller
node_web_routes -->|"routes to"| node_profile_controller
node_auth_routes -->|"routes to"| node_auth_controller
node_auth_routes -->|"routes to"| node_registration_controller
node_auth_controller -->|"authenticates with"| node_login_request
node_registration_controller -->|"creates user"| node_user_model
node_company_controller -->|"queries and updates"| node_company_model
node_user_controller -->|"queries and updates"| node_user_model
node_user_controller -->|"queries companies"| node_company_model
node_subscription_controller -->|"queries and updates"| node_subscription_model
node_subscription_controller -->|"queries companies"| node_company_model
node_dashboard_controller -->|"reads"| node_company_model
node_dashboard_controller -->|"reads"| node_user_model
node_dashboard_controller -->|"reads"| node_subscription_model
node_auth_controller -->|"renders login"| node_auth_page
node_registration_controller -->|"renders registration"| node_auth_page
node_company_controller -->|"renders"| node_companies_page
node_user_controller -->|"renders"| node_users_page
node_subscription_controller -->|"renders"| node_subscriptions_page
node_inertia_client -->|"applies layout"| node_app_layout
node_inertia_client -->|"resolves pages"| node_dashboard_page
node_inertia_client -->|"resolves pages"| node_companies_page
node_inertia_client -->|"resolves pages"| node_users_page
node_inertia_client -->|"resolves pages"| node_subscriptions_page
node_inertia_client -->|"resolves pages"| node_auth_page
node_user_model -->|"uses"| node_tenant_trait
node_subscription_model -->|"uses"| node_tenant_trait
node_company_model -->|"relates users"| node_user_model
node_company_model -->|"relates subscription"| node_subscription_model
node_user_model -->|"belongs to"| node_company_model
node_subscription_model -->|"belongs to"| node_company_model

click node_web_routes "https://github.com/airamgg99/b2b-operations-hub/blob/main/routes/web.php"
click node_auth_routes "https://github.com/airamgg99/b2b-operations-hub/blob/main/routes/auth.php"
click node_inertia_client "https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/app.js"
click node_app_layout "https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/Layouts/AppLayout.vue"
click node_dashboard_page "https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/Pages/Dashboard.vue"
click node_companies_page "https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/Pages/Companies/Index.vue"
click node_users_page "https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/Pages/Users/Index.vue"
click node_subscriptions_page "https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/Pages/Subscriptions/Index.vue"
click node_auth_page "https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/Pages/Auth/Login.vue"
click node_auth_controller "https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_registration_controller "https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_login_request "https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Requests/Auth/LoginRequest.php"
click node_profile_controller "https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/ProfileController.php"
click node_dashboard_controller "https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/DashboardController.php"
click node_company_controller "https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/CompanyController.php"
click node_user_controller "https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/UserController.php"
click node_subscription_controller "https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/SubscriptionController.php"
click node_company_model "https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Models/Company.php"
click node_user_model "https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Models/User.php"
click node_subscription_model "https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Models/Subscription.php"
click node_tenant_trait "https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Traits/Tenantable.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_web_routes,node_auth_routes,node_inertia_client,node_app_layout,node_dashboard_page,node_companies_page,node_users_page,node_subscriptions_page,node_auth_page,node_visitor toneBlue
class node_auth_controller,node_registration_controller,node_login_request,node_profile_controller toneAmber
class node_dashboard_controller,node_company_controller,node_user_controller,node_subscription_controller toneMint
class node_company_model,node_user_model,node_subscription_model,node_tenant_trait toneRose
```

## Components

### Web and UI

- [Web routes](https://github.com/airamgg99/b2b-operations-hub/blob/main/routes/web.php): `routes/web.php`
- [Auth routes](https://github.com/airamgg99/b2b-operations-hub/blob/main/routes/auth.php): `routes/auth.php`
- [Inertia Vue app](https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/app.js): `resources/js/app.js`
- [App layout](https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/Layouts/AppLayout.vue): `resources/js/Layouts/AppLayout.vue`
- [Dashboard page](https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/Pages/Dashboard.vue): `resources/js/Pages/Dashboard.vue`
- [Companies page](https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/Pages/Companies/Index.vue): `resources/js/Pages/Companies/Index.vue`
- [Users page](https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/Pages/Users/Index.vue): `resources/js/Pages/Users/Index.vue`
- [Subscriptions page](https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/Pages/Subscriptions/Index.vue): `resources/js/Pages/Subscriptions/Index.vue`
- [Auth pages](https://github.com/airamgg99/b2b-operations-hub/blob/main/resources/js/Pages/Auth/Login.vue): `resources/js/Pages/Auth/Login.vue`

### Identity and access

- [Session and registration](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [User registration](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php): `app/Http/Controllers/Auth/RegisteredUserController.php`
- [Login validation](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Requests/Auth/LoginRequest.php): `app/Http/Requests/Auth/LoginRequest.php`
- [Profile management](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/ProfileController.php): `app/Http/Controllers/ProfileController.php`

### Operations

- [Dashboard](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Company management](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/CompanyController.php): `app/Http/Controllers/CompanyController.php`
- [User management](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/UserController.php): `app/Http/Controllers/UserController.php`
- [Subscription management](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Http/Controllers/SubscriptionController.php): `app/Http/Controllers/SubscriptionController.php`

### Domain data

- [Company model](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Models/Company.php): `app/Models/Company.php`
- [User model](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Models/User.php): `app/Models/User.php`
- [Subscription model](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Models/Subscription.php): `app/Models/Subscription.php`
- [Tenant scoping](https://github.com/airamgg99/b2b-operations-hub/blob/main/app/Traits/Tenantable.php): `app/Traits/Tenantable.php`

### Other components

- **Visitor / user**

## Connections

- Visitor / user → Web routes: requests pages (evidence: `routes/web.php`)
- Visitor / user → Auth routes: requests identity (evidence: `routes/auth.php`)
- Web routes → Dashboard: routes to (evidence: `routes/web.php`)
- Web routes → Company management: routes to (evidence: `routes/web.php`)
- Web routes → User management: routes to (evidence: `routes/web.php`)
- Web routes → Subscription management: routes to (evidence: `routes/web.php`)
- Web routes → Profile management: routes to (evidence: `routes/web.php`)
- Auth routes → Session and registration: routes to (evidence: `routes/auth.php`)
- Auth routes → User registration: routes to (evidence: `routes/auth.php`)
- Session and registration → Login validation: authenticates with (evidence: `app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- User registration → User model: creates user (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- Company management → Company model: queries and updates (evidence: `app/Http/Controllers/CompanyController.php`)
- User management → User model: queries and updates (evidence: `app/Http/Controllers/UserController.php`)
- User management → Company model: queries companies (evidence: `app/Http/Controllers/UserController.php`)
- Subscription management → Subscription model: queries and updates (evidence: `app/Http/Controllers/SubscriptionController.php`)
- Subscription management → Company model: queries companies (evidence: `app/Http/Controllers/SubscriptionController.php`)
- Dashboard → Company model: reads (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard → User model: reads (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard → Subscription model: reads (evidence: `app/Http/Controllers/DashboardController.php`)
- Session and registration → Auth pages: renders login (evidence: `app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- User registration → Auth pages: renders registration (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- Company management → Companies page: renders (evidence: `app/Http/Controllers/CompanyController.php`)
- User management → Users page: renders (evidence: `app/Http/Controllers/UserController.php`)
- Subscription management → Subscriptions page: renders (evidence: `app/Http/Controllers/SubscriptionController.php`)
- Inertia Vue app → App layout: applies layout (evidence: `resources/js/app.js`)
- Inertia Vue app → Dashboard page: resolves pages (evidence: `resources/js/app.js`)
- Inertia Vue app → Companies page: resolves pages (evidence: `resources/js/app.js`)
- Inertia Vue app → Users page: resolves pages (evidence: `resources/js/app.js`)
- Inertia Vue app → Subscriptions page: resolves pages (evidence: `resources/js/app.js`)
- Inertia Vue app → Auth pages: resolves pages (evidence: `resources/js/app.js`)
- User model → Tenant scoping: uses (evidence: `app/Models/User.php`)
- Subscription model → Tenant scoping: uses (evidence: `app/Models/Subscription.php`)
- Company model → User model: relates users (evidence: `app/Models/Company.php`)
- Company model → Subscription model: relates subscription (evidence: `app/Models/Company.php`)
- User model → Company model: belongs to (evidence: `app/Models/User.php`)
- Subscription model → Company model: belongs to (evidence: `app/Models/Subscription.php`)
