# ayu-dash/onecare architecture

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

- Interactive diagram: https://gitdiagram.com/ayu-dash/onecare
- Repository: https://github.com/ayu-dash/onecare

## Overview

This Laravel application appears to manage rental units and tenant complaints through admin, tenant, and technician portals. The main workflow is complaint submission, administrative triage and technician assignment, then technician status updates, with history and notifications supporting follow-up. The graph reflects controller-to-service calls and model references visible in the excerpts or SOURCE INDEX; several listed capabilities are represented by their exact tree paths, but their implementation details were not sampled.

Main entry points: [`app/Models/Complaint.php`](https://github.com/ayu-dash/onecare/blob/main/app/Models/Complaint.php) (Complaint), [`app/Http/Controllers/Tenant`](https://github.com/ayu-dash/onecare/tree/main/app/Http/Controllers/Tenant) (Tenant Portal), [`app/Services/Tenant/ComplaintService.php`](https://github.com/ayu-dash/onecare/blob/main/app/Services/Tenant/ComplaintService.php) (Tenant Complaint Service), [`app/Http/Controllers/Admin`](https://github.com/ayu-dash/onecare/tree/main/app/Http/Controllers/Admin) (Admin Portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["User Portals"]
  node_tenant_portal["Tenant Portal"]
  node_admin_portal["Admin Portal"]
  node_technician_portal["Technician Portal"]
  node_profile["Profile Management"]
  node_admin_dashboard["Admin Dashboard"]
  node_tenant_dashboard["Tenant Dashboard"]
  node_technician_dashboard["Technician Dashboard"]
end

subgraph group_workflow["Complaint Workflow"]
  node_tenant_complaint["Tenant Complaint Service"]
  node_admin_complaint["Admin Complaint Service"]
  node_task_service["Task Service<br/>[TaskService.php]"]
  node_notifications["Complaint Notifications"]
end

subgraph group_domain["Rental Domain"]
  node_complaint["Complaint<br/>[Complaint.php]"]
  node_history["Complaint History"]
  node_tenant_model["Tenant Records<br/>[Tenant.php]"]
  node_unit["Unit Records<br/>[Unit.php]"]
  node_technician_model["Technician Records<br/>[Technician.php]"]
  node_status_priority["Complaint Status and Priority"]
  node_unit_status["Unit Status<br/>[UnitStatus.php]"]
  node_tenant_service["Tenant Administration<br/>[TenantService.php]"]
  node_technician_service["Technician Administration"]
  node_unit_controller["Unit Administration<br/>[UnitController.php]"]
  node_tenant_controller["Tenant Administration Controller"]
  node_technician_controller["Technician Administration Controller"]
end

subgraph group_access["Access and Support"]
  node_rbac["Roles and Permissions<br/>[Role.php]"]
  node_permission["Permission Records<br/>[Permission.php]"]
  node_user["User Accounts<br/>[User.php]"]
  node_role_middleware["Role Middleware"]
  node_rbac_seeder["RBAC Setup<br/>[RbacSeeder.php]"]
  node_base_controller["Controller Base<br/>[Controller.php]"]
end

node_tenant(("Tenant"))
node_administrator(("Administrator"))
node_technician(("Technician"))

node_tenant -->|"uses"| node_tenant_portal
node_administrator -->|"uses"| node_admin_portal
node_technician -->|"uses"| node_technician_portal
node_tenant_portal -->|"delegates to"| node_tenant_complaint
node_admin_portal -->|"delegates to"| node_admin_complaint
node_technician_portal -->|"updates tasks"| node_task_service
node_tenant_complaint -->|"creates and updates"| node_complaint
node_admin_complaint -->|"assigns and manages"| node_complaint
node_task_service -->|"updates status"| node_complaint
node_tenant_complaint -->|"records history"| node_history
node_admin_complaint -->|"sends updates"| node_notifications
node_tenant_complaint -->|"sends updates"| node_notifications
node_task_service -->|"notifies users"| node_notifications
node_complaint -->|"belongs to"| node_tenant_model
node_complaint -->|"belongs to"| node_unit
node_complaint -->|"belongs to"| node_technician_model
node_complaint -->|"has histories"| node_history
node_complaint -->|"casts status"| node_status_priority
node_unit -->|"casts status"| node_unit_status
node_admin_portal -->|"loads dashboard"| node_admin_dashboard
node_tenant_portal -->|"serves dashboard"| node_tenant_dashboard
node_technician_portal -->|"serves dashboard"| node_technician_dashboard
node_tenant_controller -->|"delegates to"| node_tenant_service
node_technician_controller -->|"delegates to"| node_technician_service
node_unit_controller -->|"manages"| node_unit
node_user -->|"resolves role"| node_rbac
node_rbac -->|"checks permissions"| node_permission
node_rbac_seeder -->|"seeds"| node_permission
node_role_middleware -.->|"guards routes"| node_administrator
node_profile -->|"updates account"| node_user
node_tenant -->|"submits complaints"| node_tenant_portal
node_base_controller -.->|"base class"| node_tenant_portal

click node_tenant_portal "https://github.com/ayu-dash/onecare/tree/main/app/Http/Controllers/Tenant"
click node_admin_portal "https://github.com/ayu-dash/onecare/tree/main/app/Http/Controllers/Admin"
click node_technician_portal "https://github.com/ayu-dash/onecare/tree/main/app/Http/Controllers/Teknisi"
click node_profile "https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/ProfileController.php"
click node_tenant_complaint "https://github.com/ayu-dash/onecare/blob/main/app/Services/Tenant/ComplaintService.php"
click node_admin_complaint "https://github.com/ayu-dash/onecare/blob/main/app/Services/Admin/ComplaintService.php"
click node_task_service "https://github.com/ayu-dash/onecare/blob/main/app/Services/Teknisi/TaskService.php"
click node_notifications "https://github.com/ayu-dash/onecare/blob/main/app/Notifications/ComplaintNotification.php"
click node_complaint "https://github.com/ayu-dash/onecare/blob/main/app/Models/Complaint.php"
click node_history "https://github.com/ayu-dash/onecare/blob/main/app/Models/ComplaintHistory.php"
click node_tenant_model "https://github.com/ayu-dash/onecare/blob/main/app/Models/Tenant.php"
click node_unit "https://github.com/ayu-dash/onecare/blob/main/app/Models/Unit.php"
click node_technician_model "https://github.com/ayu-dash/onecare/blob/main/app/Models/Technician.php"
click node_status_priority "https://github.com/ayu-dash/onecare/blob/main/app/Enums/ComplaintStatus.php"
click node_unit_status "https://github.com/ayu-dash/onecare/blob/main/app/Enums/UnitStatus.php"
click node_rbac "https://github.com/ayu-dash/onecare/blob/main/app/Models/Role.php"
click node_permission "https://github.com/ayu-dash/onecare/blob/main/app/Models/Permission.php"
click node_user "https://github.com/ayu-dash/onecare/blob/main/app/Models/User.php"
click node_role_middleware "https://github.com/ayu-dash/onecare/blob/main/app/Http/Middleware/EnsureUserHasRole.php"
click node_admin_dashboard "https://github.com/ayu-dash/onecare/blob/main/app/Services/Admin/DashboardService.php"
click node_tenant_dashboard "https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/Tenant/DashboardController.php"
click node_technician_dashboard "https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/Teknisi/DashboardController.php"
click node_tenant_service "https://github.com/ayu-dash/onecare/blob/main/app/Services/Admin/TenantService.php"
click node_technician_service "https://github.com/ayu-dash/onecare/blob/main/app/Services/Admin/TechnicianService.php"
click node_unit_controller "https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/Admin/UnitController.php"
click node_tenant_controller "https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/Admin/TenantController.php"
click node_technician_controller "https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/Admin/TechnicianController.php"
click node_rbac_seeder "https://github.com/ayu-dash/onecare/blob/main/database/seeders/RbacSeeder.php"
click node_base_controller "https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/Controller.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_tenant_portal,node_admin_portal,node_technician_portal,node_profile,node_admin_dashboard,node_tenant_dashboard,node_technician_dashboard toneBlue
class node_tenant_complaint,node_admin_complaint,node_task_service,node_notifications toneAmber
class node_complaint,node_history,node_tenant_model,node_unit,node_technician_model,node_status_priority,node_unit_status,node_tenant_service,node_technician_service,node_unit_controller,node_tenant_controller,node_technician_controller toneMint
class node_rbac,node_permission,node_user,node_role_middleware,node_rbac_seeder,node_base_controller toneRose
class node_tenant,node_administrator,node_technician toneIndigo
```

## Components

### User Portals

- [Tenant Portal](https://github.com/ayu-dash/onecare/tree/main/app/Http/Controllers/Tenant): `app/Http/Controllers/Tenant`
- [Admin Portal](https://github.com/ayu-dash/onecare/tree/main/app/Http/Controllers/Admin): `app/Http/Controllers/Admin`
- [Technician Portal](https://github.com/ayu-dash/onecare/tree/main/app/Http/Controllers/Teknisi): `app/Http/Controllers/Teknisi`
- [Profile Management](https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/ProfileController.php): `app/Http/Controllers/ProfileController.php`
- [Admin Dashboard](https://github.com/ayu-dash/onecare/blob/main/app/Services/Admin/DashboardService.php): `app/Services/Admin/DashboardService.php`
- [Tenant Dashboard](https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/Tenant/DashboardController.php): `app/Http/Controllers/Tenant/DashboardController.php`
- [Technician Dashboard](https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/Teknisi/DashboardController.php): `app/Http/Controllers/Teknisi/DashboardController.php`

### Complaint Workflow

- [Tenant Complaint Service](https://github.com/ayu-dash/onecare/blob/main/app/Services/Tenant/ComplaintService.php): `app/Services/Tenant/ComplaintService.php`
- [Admin Complaint Service](https://github.com/ayu-dash/onecare/blob/main/app/Services/Admin/ComplaintService.php): `app/Services/Admin/ComplaintService.php`
- [Task Service](https://github.com/ayu-dash/onecare/blob/main/app/Services/Teknisi/TaskService.php): `app/Services/Teknisi/TaskService.php`
- [Complaint Notifications](https://github.com/ayu-dash/onecare/blob/main/app/Notifications/ComplaintNotification.php): `app/Notifications/ComplaintNotification.php`

### Rental Domain

- [Complaint](https://github.com/ayu-dash/onecare/blob/main/app/Models/Complaint.php): `app/Models/Complaint.php`
- [Complaint History](https://github.com/ayu-dash/onecare/blob/main/app/Models/ComplaintHistory.php): `app/Models/ComplaintHistory.php`
- [Tenant Records](https://github.com/ayu-dash/onecare/blob/main/app/Models/Tenant.php): `app/Models/Tenant.php`
- [Unit Records](https://github.com/ayu-dash/onecare/blob/main/app/Models/Unit.php): `app/Models/Unit.php`
- [Technician Records](https://github.com/ayu-dash/onecare/blob/main/app/Models/Technician.php): `app/Models/Technician.php`
- [Complaint Status and Priority](https://github.com/ayu-dash/onecare/blob/main/app/Enums/ComplaintStatus.php): `app/Enums/ComplaintStatus.php`
- [Unit Status](https://github.com/ayu-dash/onecare/blob/main/app/Enums/UnitStatus.php): `app/Enums/UnitStatus.php`
- [Tenant Administration](https://github.com/ayu-dash/onecare/blob/main/app/Services/Admin/TenantService.php): `app/Services/Admin/TenantService.php`
- [Technician Administration](https://github.com/ayu-dash/onecare/blob/main/app/Services/Admin/TechnicianService.php): `app/Services/Admin/TechnicianService.php`
- [Unit Administration](https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/Admin/UnitController.php): `app/Http/Controllers/Admin/UnitController.php`
- [Tenant Administration Controller](https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/Admin/TenantController.php): `app/Http/Controllers/Admin/TenantController.php`
- [Technician Administration Controller](https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/Admin/TechnicianController.php): `app/Http/Controllers/Admin/TechnicianController.php`

### Access and Support

- [Roles and Permissions](https://github.com/ayu-dash/onecare/blob/main/app/Models/Role.php): `app/Models/Role.php`
- [Permission Records](https://github.com/ayu-dash/onecare/blob/main/app/Models/Permission.php): `app/Models/Permission.php`
- [User Accounts](https://github.com/ayu-dash/onecare/blob/main/app/Models/User.php): `app/Models/User.php`
- [Role Middleware](https://github.com/ayu-dash/onecare/blob/main/app/Http/Middleware/EnsureUserHasRole.php): `app/Http/Middleware/EnsureUserHasRole.php`
- [RBAC Setup](https://github.com/ayu-dash/onecare/blob/main/database/seeders/RbacSeeder.php): `database/seeders/RbacSeeder.php`
- [Controller Base](https://github.com/ayu-dash/onecare/blob/main/app/Http/Controllers/Controller.php): `app/Http/Controllers/Controller.php`

### Other components

- **Tenant**
- **Administrator**
- **Technician**

## Connections

- Tenant → Tenant Portal: uses
- Administrator → Admin Portal: uses
- Technician → Technician Portal: uses
- Tenant Portal → Tenant Complaint Service: delegates to (evidence: `app/Http/Controllers/Tenant/ComplaintController.php`)
- Admin Portal → Admin Complaint Service: delegates to (evidence: `app/Http/Controllers/Admin/ComplaintController.php`)
- Technician Portal → Task Service: updates tasks (evidence: `app/Http/Controllers/Teknisi/TaskController.php`)
- Tenant Complaint Service → Complaint: creates and updates (evidence: `app/Services/Tenant/ComplaintService.php`)
- Admin Complaint Service → Complaint: assigns and manages (evidence: `app/Services/Admin/ComplaintService.php`)
- Task Service → Complaint: updates status (evidence: `app/Services/Teknisi/TaskService.php`)
- Tenant Complaint Service → Complaint History: records history (evidence: `app/Services/Tenant/ComplaintService.php`)
- Admin Complaint Service → Complaint Notifications: sends updates (evidence: `app/Services/Admin/ComplaintService.php`)
- Tenant Complaint Service → Complaint Notifications: sends updates (evidence: `app/Services/Tenant/ComplaintService.php`)
- Task Service → Complaint Notifications: notifies users (evidence: `app/Services/Teknisi/TaskService.php`)
- Complaint → Tenant Records: belongs to (evidence: `app/Models/Complaint.php`)
- Complaint → Unit Records: belongs to (evidence: `app/Models/Complaint.php`)
- Complaint → Technician Records: belongs to (evidence: `app/Models/Complaint.php`)
- Complaint → Complaint History: has histories (evidence: `app/Models/Complaint.php`)
- Complaint → Complaint Status and Priority: casts status (evidence: `app/Models/Complaint.php`)
- Unit Records → Unit Status: casts status (evidence: `app/Models/Unit.php`)
- Admin Portal → Admin Dashboard: loads dashboard (evidence: `app/Http/Controllers/Admin/DashboardController.php`)
- Tenant Portal → Tenant Dashboard: serves dashboard (evidence: `routes/web.php`)
- Technician Portal → Technician Dashboard: serves dashboard (evidence: `routes/web.php`)
- Tenant Administration Controller → Tenant Administration: delegates to (evidence: `app/Http/Controllers/Admin/TenantController.php`)
- Technician Administration Controller → Technician Administration: delegates to (evidence: `app/Http/Controllers/Admin/TechnicianController.php`)
- Unit Administration → Unit Records: manages (evidence: `app/Http/Controllers/Admin/UnitController.php`)
- User Accounts → Roles and Permissions: resolves role (evidence: `app/Models/User.php`)
- Roles and Permissions → Permission Records: checks permissions (evidence: `database/seeders/RbacSeeder.php`)
- RBAC Setup → Permission Records: seeds (evidence: `database/seeders/RbacSeeder.php`)
- Role Middleware → Administrator: guards routes
- Profile Management → User Accounts: updates account (evidence: `app/Http/Controllers/ProfileController.php`)
- Tenant → Tenant Portal: submits complaints
- Controller Base → Tenant Portal: base class (evidence: `app/Http/Controllers/Tenant/ComplaintController.php`)
