# inertiajs/pingcrm architecture

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

- Interactive diagram: https://gitdiagram.com/inertiajs/pingcrm
- Repository: https://github.com/inertiajs/pingcrm

## Overview

Ping CRM is a Laravel/Inertia demo CRM. An authenticated user enters through web routes, manages account users, organizations, and contacts, and receives Inertia-rendered pages; login and dashboard are separate entry points. Controllers validate requests and coordinate account-scoped Eloquent models, while middleware supplies the Inertia web layer. The excerpts establish several controller-to-model and page-render relationships; other page and runtime connections are omitted where the sampled source does not show them.

Main entry points: [`routes/web.php`](https://github.com/inertiajs/pingcrm/blob/master/routes/web.php) (Web routes), [`app/Http/Controllers/ContactsController.php`](https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/ContactsController.php) (Contacts), [`app/Http/Controllers/OrganizationsController.php`](https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/OrganizationsController.php) (Organizations), [`bootstrap/app.php`](https://github.com/inertiajs/pingcrm/blob/master/bootstrap/app.php) (Application setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry"]
  node_web_routes["Web routes<br/>[web.php]"]
end

subgraph group_crm["CRM workflows"]
  node_dashboard["Dashboard"]
  node_reports["Reports"]
  node_images["Image delivery"]
  node_contacts["Contacts"]
  node_organizations["Organizations"]
  node_users["User management"]
end

subgraph group_identity["Identity and middleware"]
  node_sessions["Session auth"]
  node_login_request["Login validation<br/>[LoginRequest.php]"]
  node_inertia_middleware["Inertia middleware"]
  node_proxy_middleware["Proxy middleware<br/>[TrustProxies.php]"]
  node_bootstrap["Application setup<br/>[app.php]"]
end

subgraph group_domain["Domain models"]
  node_account_model["Account model<br/>[Account.php]"]
  node_contact_model["Contact model<br/>[Contact.php]"]
  node_organization_model["Organization model<br/>[Organization.php]"]
  node_user_model["User model<br/>[User.php]"]
end

subgraph group_client["Inertia client"]
  node_login_page["Login page<br/>[Login.vue]"]
  node_contact_pages["Contact pages"]
  node_organization_pages["Organization pages"]
  node_user_pages["User pages"]
  node_dashboard_page["Dashboard page<br/>[Index.vue]"]
  node_report_page["Reports page<br/>[Index.vue]"]
  node_shared_layout["Shared layout<br/>[Layout.vue]"]
end

node_user_actor(("User"))

node_user_actor -->|"requests pages"| node_web_routes
node_web_routes -->|"routes login"| node_sessions
node_web_routes -->|"routes dashboard"| node_dashboard
node_web_routes -->|"routes contacts"| node_contacts
node_web_routes -->|"routes organizations"| node_organizations
node_web_routes -->|"routes users"| node_users
node_web_routes -->|"routes reports"| node_reports
node_web_routes -->|"routes images"| node_images
node_bootstrap -->|"loads routes"| node_web_routes
node_bootstrap -->|"registers middleware"| node_inertia_middleware
node_bootstrap -->|"replaces proxy"| node_proxy_middleware
node_sessions -->|"authenticates via"| node_login_request
node_sessions -->|"renders"| node_login_page
node_contacts -->|"queries and updates"| node_contact_model
node_contacts -->|"renders"| node_contact_pages
node_contacts -->|"loads organization data"| node_organization_model
node_organizations -->|"queries and updates"| node_organization_model
node_organizations -->|"renders"| node_organization_pages
node_organizations -->|"loads contact data"| node_contact_model
node_users -->|"queries and updates"| node_user_model
node_users -->|"renders"| node_user_pages
node_dashboard -.->|"renders"| node_dashboard_page
node_reports -.->|"renders"| node_report_page
node_shared_layout -.->|"wraps pages"| node_contact_pages

click node_web_routes "https://github.com/inertiajs/pingcrm/blob/master/routes/web.php"
click node_dashboard "https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/DashboardController.php"
click node_reports "https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/ReportsController.php"
click node_images "https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/ImagesController.php"
click node_contacts "https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/ContactsController.php"
click node_organizations "https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/OrganizationsController.php"
click node_users "https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/UsersController.php"
click node_sessions "https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_login_request "https://github.com/inertiajs/pingcrm/blob/master/app/Http/Requests/Auth/LoginRequest.php"
click node_inertia_middleware "https://github.com/inertiajs/pingcrm/blob/master/app/Http/Middleware/HandleInertiaRequests.php"
click node_proxy_middleware "https://github.com/inertiajs/pingcrm/blob/master/app/Http/Middleware/TrustProxies.php"
click node_bootstrap "https://github.com/inertiajs/pingcrm/blob/master/bootstrap/app.php"
click node_account_model "https://github.com/inertiajs/pingcrm/blob/master/app/Models/Account.php"
click node_contact_model "https://github.com/inertiajs/pingcrm/blob/master/app/Models/Contact.php"
click node_organization_model "https://github.com/inertiajs/pingcrm/blob/master/app/Models/Organization.php"
click node_user_model "https://github.com/inertiajs/pingcrm/blob/master/app/Models/User.php"
click node_login_page "https://github.com/inertiajs/pingcrm/blob/master/resources/js/Pages/Auth/Login.vue"
click node_contact_pages "https://github.com/inertiajs/pingcrm/tree/master/resources/js/Pages/Contacts"
click node_organization_pages "https://github.com/inertiajs/pingcrm/tree/master/resources/js/Pages/Organizations"
click node_user_pages "https://github.com/inertiajs/pingcrm/tree/master/resources/js/Pages/Users"
click node_dashboard_page "https://github.com/inertiajs/pingcrm/blob/master/resources/js/Pages/Dashboard/Index.vue"
click node_report_page "https://github.com/inertiajs/pingcrm/blob/master/resources/js/Pages/Reports/Index.vue"
click node_shared_layout "https://github.com/inertiajs/pingcrm/blob/master/resources/js/Shared/Layout.vue"

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_user_actor toneBlue
class node_dashboard,node_reports,node_images,node_contacts,node_organizations,node_users toneAmber
class node_sessions,node_login_request,node_inertia_middleware,node_proxy_middleware,node_bootstrap toneMint
class node_account_model,node_contact_model,node_organization_model,node_user_model toneRose
class node_login_page,node_contact_pages,node_organization_pages,node_user_pages,node_dashboard_page,node_report_page,node_shared_layout toneIndigo
```

## Components

### Web entry

- [Web routes](https://github.com/inertiajs/pingcrm/blob/master/routes/web.php): `routes/web.php`

### CRM workflows

- [Dashboard](https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Reports](https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/ReportsController.php): `app/Http/Controllers/ReportsController.php`
- [Image delivery](https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/ImagesController.php): `app/Http/Controllers/ImagesController.php`
- [Contacts](https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/ContactsController.php): `app/Http/Controllers/ContactsController.php`
- [Organizations](https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/OrganizationsController.php): `app/Http/Controllers/OrganizationsController.php`
- [User management](https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/UsersController.php): `app/Http/Controllers/UsersController.php`

### Identity and middleware

- [Session auth](https://github.com/inertiajs/pingcrm/blob/master/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [Login validation](https://github.com/inertiajs/pingcrm/blob/master/app/Http/Requests/Auth/LoginRequest.php): `app/Http/Requests/Auth/LoginRequest.php`
- [Inertia middleware](https://github.com/inertiajs/pingcrm/blob/master/app/Http/Middleware/HandleInertiaRequests.php): `app/Http/Middleware/HandleInertiaRequests.php`
- [Proxy middleware](https://github.com/inertiajs/pingcrm/blob/master/app/Http/Middleware/TrustProxies.php): `app/Http/Middleware/TrustProxies.php`
- [Application setup](https://github.com/inertiajs/pingcrm/blob/master/bootstrap/app.php): `bootstrap/app.php`

### Domain models

- [Account model](https://github.com/inertiajs/pingcrm/blob/master/app/Models/Account.php): `app/Models/Account.php`
- [Contact model](https://github.com/inertiajs/pingcrm/blob/master/app/Models/Contact.php): `app/Models/Contact.php`
- [Organization model](https://github.com/inertiajs/pingcrm/blob/master/app/Models/Organization.php): `app/Models/Organization.php`
- [User model](https://github.com/inertiajs/pingcrm/blob/master/app/Models/User.php): `app/Models/User.php`

### Inertia client

- [Login page](https://github.com/inertiajs/pingcrm/blob/master/resources/js/Pages/Auth/Login.vue): `resources/js/Pages/Auth/Login.vue`
- [Contact pages](https://github.com/inertiajs/pingcrm/tree/master/resources/js/Pages/Contacts): `resources/js/Pages/Contacts`
- [Organization pages](https://github.com/inertiajs/pingcrm/tree/master/resources/js/Pages/Organizations): `resources/js/Pages/Organizations`
- [User pages](https://github.com/inertiajs/pingcrm/tree/master/resources/js/Pages/Users): `resources/js/Pages/Users`
- [Dashboard page](https://github.com/inertiajs/pingcrm/blob/master/resources/js/Pages/Dashboard/Index.vue): `resources/js/Pages/Dashboard/Index.vue`
- [Reports page](https://github.com/inertiajs/pingcrm/blob/master/resources/js/Pages/Reports/Index.vue): `resources/js/Pages/Reports/Index.vue`
- [Shared layout](https://github.com/inertiajs/pingcrm/blob/master/resources/js/Shared/Layout.vue): `resources/js/Shared/Layout.vue`

### Other components

- **User**

## Connections

- User → Web routes: requests pages (evidence: `routes/web.php`)
- Web routes → Session auth: routes login (evidence: `routes/web.php`)
- Web routes → Dashboard: routes dashboard (evidence: `routes/web.php`)
- Web routes → Contacts: routes contacts (evidence: `routes/web.php`)
- Web routes → Organizations: routes organizations (evidence: `routes/web.php`)
- Web routes → User management: routes users (evidence: `routes/web.php`)
- Web routes → Reports: routes reports (evidence: `routes/web.php`)
- Web routes → Image delivery: routes images (evidence: `routes/web.php`)
- Application setup → Web routes: loads routes (evidence: `bootstrap/app.php`)
- Application setup → Inertia middleware: registers middleware (evidence: `bootstrap/app.php`)
- Application setup → Proxy middleware: replaces proxy (evidence: `bootstrap/app.php`)
- Session auth → Login validation: authenticates via (evidence: `app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- Session auth → Login page: renders (evidence: `app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- Contacts → Contact model: queries and updates (evidence: `app/Http/Controllers/ContactsController.php`)
- Contacts → Contact pages: renders (evidence: `app/Http/Controllers/ContactsController.php`)
- Contacts → Organization model: loads organization data (evidence: `app/Http/Controllers/ContactsController.php`)
- Organizations → Organization model: queries and updates (evidence: `app/Http/Controllers/OrganizationsController.php`)
- Organizations → Organization pages: renders (evidence: `app/Http/Controllers/OrganizationsController.php`)
- Organizations → Contact model: loads contact data (evidence: `app/Http/Controllers/OrganizationsController.php`)
- User management → User model: queries and updates (evidence: `app/Http/Controllers/UsersController.php`)
- User management → User pages: renders (evidence: `app/Http/Controllers/UsersController.php`)
- Dashboard → Dashboard page: renders
- Reports → Reports page: renders
- Shared layout → Contact pages: wraps pages
