# ngimhana/cmms architecture

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

- Interactive diagram: https://gitdiagram.com/ngimhana/cmms
- Repository: https://github.com/ngimhana/cmms

## Overview

COTENCE is a Laravel maintenance-management application. Users manage buildings, sectors, assets, immediate and scheduled jobs, and calendar events through web pages and API endpoints; job assignment and scheduled-job updates can notify users. The route map and job controllers support the main API workflow, while the README documents the product scope. Several controller implementations and the web routes were not sampled, so their internal calls are omitted; edges show only documented routing or excerpted calls.

Main entry points: [`routes/api.php`](https://github.com/ngimhana/cmms/blob/master/routes/api.php) (API routes), [`app/Http/Controllers/JobController.php`](https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/JobController.php) (Immediate jobs), [`app/Http/Controllers/ScheduledJobController.php`](https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/ScheduledJobController.php) (Scheduled jobs), [`app/Http/Controllers/AssetController.php`](https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/AssetController.php) (Assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Request entry"]
  node_api_routes["API routes<br/>[api.php]"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_route_provider["Route provider"]
end

subgraph group_maintenance["Maintenance records"]
  node_job_controller["Immediate jobs<br/>[JobController.php]"]
  node_job_resource["Job resource<br/>[JobResource.php]"]
  node_immediate_job[("Immediate job model<br/>[Immediate_Job.php]")]
  node_asset_controller["Assets"]
  node_asset_resource["Asset resource<br/>[AssetResource.php]"]
  node_asset_model[("Asset model<br/>[Asset.php]")]
  node_building_controller["Buildings"]
  node_building_resource["Building resource"]
  node_sector_controller["Sectors"]
  node_sector_resource["Sector resource<br/>[SectorResource.php]"]
end

subgraph group_planning["Planning and alerts"]
  node_calendar_controller["Calendar events"]
  node_calendar_model[("Calendar model<br/>[Calendar.php]")]
  node_calendar_resource["Calendar resource"]
  node_scheduled_controller["Scheduled jobs"]
  node_scheduled_model[("Scheduled job model<br/>[Scheduled_Job.php]")]
  node_scheduled_resource["Scheduled job resource"]
  node_job_notification["Job notification<br/>[JobNotificaton.php]"]
  node_scheduled_notification["Scheduled notification"]
end

subgraph group_identity["Users and access"]
  node_user_controller["User management<br/>[UserController.php]"]
  node_user_model[("User model<br/>[User.php]")]
  node_notification_controller["Notification management"]
end

node_user(("User"))

node_user -->|"requests endpoints"| node_api_routes
node_user -.->|"uses web pages"| node_web_routes
node_route_provider -->|"loads routes"| node_api_routes
node_route_provider -->|"loads routes"| node_web_routes
node_api_routes -->|"routes job actions"| node_job_controller
node_api_routes -->|"routes asset actions"| node_asset_controller
node_api_routes -->|"routes building actions"| node_building_controller
node_api_routes -->|"routes sector actions"| node_sector_controller
node_api_routes -->|"routes event creation"| node_calendar_controller
node_api_routes -->|"lists events"| node_calendar_model
node_api_routes -->|"routes schedule actions"| node_scheduled_controller
node_api_routes -->|"routes user actions"| node_user_controller
node_api_routes -->|"routes notifications"| node_notification_controller
node_job_controller -->|"reads and writes"| node_immediate_job
node_job_controller -->|"returns resource"| node_job_resource
node_job_controller -->|"finds assignee"| node_user_model
node_job_controller -->|"notifies assignee"| node_job_notification
node_asset_controller -->|"reads and writes"| node_asset_model
node_asset_controller -->|"returns resource"| node_asset_resource
node_asset_controller -.->|"queries job records"| node_immediate_job
node_building_controller -->|"uses resource"| node_building_resource
node_sector_controller -->|"uses resource"| node_building_resource
node_sector_controller -->|"uses resource"| node_sector_resource
node_calendar_controller -->|"uses model"| node_calendar_model
node_calendar_controller -->|"uses resource"| node_calendar_resource
node_scheduled_controller -->|"reads and writes"| node_scheduled_model
node_scheduled_controller -->|"returns resource"| node_scheduled_resource
node_scheduled_controller -->|"finds assignee"| node_user_model
node_scheduled_controller -->|"notifies assignee"| node_scheduled_notification
node_user_controller -->|"manages users"| node_user_model

click node_api_routes "https://github.com/ngimhana/cmms/blob/master/routes/api.php"
click node_web_routes "https://github.com/ngimhana/cmms/blob/master/routes/web.php"
click node_route_provider "https://github.com/ngimhana/cmms/blob/master/app/Providers/RouteServiceProvider.php"
click node_job_controller "https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/JobController.php"
click node_job_resource "https://github.com/ngimhana/cmms/blob/master/app/Http/Resources/JobResource.php"
click node_immediate_job "https://github.com/ngimhana/cmms/blob/master/app/Immediate_Job.php"
click node_asset_controller "https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/AssetController.php"
click node_asset_resource "https://github.com/ngimhana/cmms/blob/master/app/Http/Resources/AssetResource.php"
click node_asset_model "https://github.com/ngimhana/cmms/blob/master/app/Asset.php"
click node_building_controller "https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/BuildingController.php"
click node_building_resource "https://github.com/ngimhana/cmms/blob/master/app/Http/Resources/BuildingResource.php"
click node_sector_controller "https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/SectorController.php"
click node_sector_resource "https://github.com/ngimhana/cmms/blob/master/app/Http/Resources/SectorResource.php"
click node_calendar_controller "https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/CalendarController.php"
click node_calendar_model "https://github.com/ngimhana/cmms/blob/master/app/Calendar.php"
click node_calendar_resource "https://github.com/ngimhana/cmms/blob/master/app/Http/Resources/CalendarResource.php"
click node_scheduled_controller "https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/ScheduledJobController.php"
click node_scheduled_model "https://github.com/ngimhana/cmms/blob/master/app/Scheduled_Job.php"
click node_scheduled_resource "https://github.com/ngimhana/cmms/blob/master/app/Http/Resources/ScheduledJobResource.php"
click node_job_notification "https://github.com/ngimhana/cmms/blob/master/app/Notifications/JobNotificaton.php"
click node_scheduled_notification "https://github.com/ngimhana/cmms/blob/master/app/Notifications/ScheduledJobNotification.php"
click node_user_controller "https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/UserController.php"
click node_user_model "https://github.com/ngimhana/cmms/blob/master/app/User.php"
click node_notification_controller "https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/NotificationController.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_api_routes,node_web_routes,node_route_provider,node_user toneBlue
class node_job_controller,node_job_resource,node_immediate_job,node_asset_controller,node_asset_resource,node_asset_model,node_building_controller,node_building_resource,node_sector_controller,node_sector_resource toneAmber
class node_calendar_controller,node_calendar_model,node_calendar_resource,node_scheduled_controller,node_scheduled_model,node_scheduled_resource,node_job_notification,node_scheduled_notification toneMint
class node_user_controller,node_user_model,node_notification_controller toneRose
```

## Components

### Request entry

- [API routes](https://github.com/ngimhana/cmms/blob/master/routes/api.php): `routes/api.php`
- [Web routes](https://github.com/ngimhana/cmms/blob/master/routes/web.php): `routes/web.php`
- [Route provider](https://github.com/ngimhana/cmms/blob/master/app/Providers/RouteServiceProvider.php): `app/Providers/RouteServiceProvider.php`

### Maintenance records

- [Immediate jobs](https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/JobController.php): `app/Http/Controllers/JobController.php`
- [Job resource](https://github.com/ngimhana/cmms/blob/master/app/Http/Resources/JobResource.php): `app/Http/Resources/JobResource.php`
- [Immediate job model](https://github.com/ngimhana/cmms/blob/master/app/Immediate_Job.php): `app/Immediate_Job.php`
- [Assets](https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/AssetController.php): `app/Http/Controllers/AssetController.php`
- [Asset resource](https://github.com/ngimhana/cmms/blob/master/app/Http/Resources/AssetResource.php): `app/Http/Resources/AssetResource.php`
- [Asset model](https://github.com/ngimhana/cmms/blob/master/app/Asset.php): `app/Asset.php`
- [Buildings](https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/BuildingController.php): `app/Http/Controllers/BuildingController.php`
- [Building resource](https://github.com/ngimhana/cmms/blob/master/app/Http/Resources/BuildingResource.php): `app/Http/Resources/BuildingResource.php`
- [Sectors](https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/SectorController.php): `app/Http/Controllers/SectorController.php`
- [Sector resource](https://github.com/ngimhana/cmms/blob/master/app/Http/Resources/SectorResource.php): `app/Http/Resources/SectorResource.php`

### Planning and alerts

- [Calendar events](https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/CalendarController.php): `app/Http/Controllers/CalendarController.php`
- [Calendar model](https://github.com/ngimhana/cmms/blob/master/app/Calendar.php): `app/Calendar.php`
- [Calendar resource](https://github.com/ngimhana/cmms/blob/master/app/Http/Resources/CalendarResource.php): `app/Http/Resources/CalendarResource.php`
- [Scheduled jobs](https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/ScheduledJobController.php): `app/Http/Controllers/ScheduledJobController.php`
- [Scheduled job model](https://github.com/ngimhana/cmms/blob/master/app/Scheduled_Job.php): `app/Scheduled_Job.php`
- [Scheduled job resource](https://github.com/ngimhana/cmms/blob/master/app/Http/Resources/ScheduledJobResource.php): `app/Http/Resources/ScheduledJobResource.php`
- [Job notification](https://github.com/ngimhana/cmms/blob/master/app/Notifications/JobNotificaton.php): `app/Notifications/JobNotificaton.php`
- [Scheduled notification](https://github.com/ngimhana/cmms/blob/master/app/Notifications/ScheduledJobNotification.php): `app/Notifications/ScheduledJobNotification.php`

### Users and access

- [User management](https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/UserController.php): `app/Http/Controllers/UserController.php`
- [User model](https://github.com/ngimhana/cmms/blob/master/app/User.php): `app/User.php`
- [Notification management](https://github.com/ngimhana/cmms/blob/master/app/Http/Controllers/NotificationController.php): `app/Http/Controllers/NotificationController.php`

### Other components

- **User**

## Connections

- User → API routes: requests endpoints (evidence: `routes/api.php`)
- User → Web routes: uses web pages
- Route provider → API routes: loads routes (evidence: `app/Providers/RouteServiceProvider.php`)
- Route provider → Web routes: loads routes (evidence: `app/Providers/RouteServiceProvider.php`)
- API routes → Immediate jobs: routes job actions (evidence: `routes/api.php`)
- API routes → Assets: routes asset actions (evidence: `routes/api.php`)
- API routes → Buildings: routes building actions (evidence: `routes/api.php`)
- API routes → Sectors: routes sector actions (evidence: `routes/api.php`)
- API routes → Calendar events: routes event creation (evidence: `routes/api.php`)
- API routes → Calendar model: lists events (evidence: `routes/api.php`)
- API routes → Scheduled jobs: routes schedule actions (evidence: `routes/api.php`)
- API routes → User management: routes user actions (evidence: `routes/api.php`)
- API routes → Notification management: routes notifications (evidence: `routes/api.php`)
- Immediate jobs → Immediate job model: reads and writes (evidence: `app/Http/Controllers/JobController.php`)
- Immediate jobs → Job resource: returns resource (evidence: `app/Http/Controllers/JobController.php`)
- Immediate jobs → User model: finds assignee (evidence: `app/Http/Controllers/JobController.php`)
- Immediate jobs → Job notification: notifies assignee (evidence: `app/Http/Controllers/JobController.php`)
- Assets → Asset model: reads and writes (evidence: `app/Http/Controllers/AssetController.php`)
- Assets → Asset resource: returns resource (evidence: `app/Http/Controllers/AssetController.php`)
- Assets → Immediate job model: queries job records
- Buildings → Building resource: uses resource (evidence: `app/Http/Controllers/BuildingController.php`)
- Sectors → Building resource: uses resource (evidence: `app/Http/Controllers/SectorController.php`)
- Sectors → Sector resource: uses resource (evidence: `app/Http/Controllers/SectorController.php`)
- Calendar events → Calendar model: uses model (evidence: `app/Http/Controllers/CalendarController.php`)
- Calendar events → Calendar resource: uses resource (evidence: `app/Http/Controllers/CalendarController.php`)
- Scheduled jobs → Scheduled job model: reads and writes (evidence: `app/Http/Controllers/ScheduledJobController.php`)
- Scheduled jobs → Scheduled job resource: returns resource (evidence: `app/Http/Controllers/ScheduledJobController.php`)
- Scheduled jobs → User model: finds assignee (evidence: `app/Http/Controllers/ScheduledJobController.php`)
- Scheduled jobs → Scheduled notification: notifies assignee (evidence: `app/Http/Controllers/ScheduledJobController.php`)
- User management → User model: manages users (evidence: `app/Http/Controllers/UserController.php`)
