# senatroxx/openkos architecture

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

- Interactive diagram: https://gitdiagram.com/senatroxx/openkos
- Repository: https://github.com/senatroxx/openkos

## Overview

OpenKOS is a Laravel/React rental property management platform. The main owner/staff workflow manages properties and units, establishes tenant leases, generates invoices, records and verifies payments, and monitors rent, reminders, and maintenance. Separate capabilities include applicant screening, inspections, expenses/utilities, tenant self-service, data transfer, and extensible notification/payment plugins. The graph reflects README-described features and sampled controller/service behavior; unsampled subsystem wiring is represented only where product capabilities are clear.

Main entry points: [`app/Models/Lease.php`](https://github.com/senatroxx/openkos/blob/main/app/Models/Lease.php) (Application database), [`app/Http/Controllers/LeaseController.php`](https://github.com/senatroxx/openkos/blob/main/app/Http/Controllers/LeaseController.php) (Lease controller), [`app/Actions/Payments/RecordPayment.php`](https://github.com/senatroxx/openkos/blob/main/app/Actions/Payments/RecordPayment.php) (Payment workflow), [`app/Services/Payments/PaymentGatewayManager.php`](https://github.com/senatroxx/openkos/blob/main/app/Services/Payments/PaymentGatewayManager.php) (Gateway manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rental["Rental operations"]
  node_leaseweb["Lease controller"]
  node_leaseactions["Lease actions<br/>[CreateLease.php]"]
  node_propertyunit["Properties &amp; units<br/>[Property.php]"]
  node_applications["Applications"]
  node_maintenance["Maintenance tickets<br/>[ResolveTicket.php]"]
  node_inspections["Inspections"]
  node_expenseutility["Expenses &amp; utilities<br/>[RecordExpense.php]"]
end

subgraph group_billing["Billing operations"]
  node_invoice["Invoices"]
  node_payment["Payment workflow<br/>[RecordPayment.php]"]
  node_gateway["Gateway manager"]
  node_dashboard["Dashboard &amp; reports<br/>[RentController.php]"]
end

subgraph group_engagement["Tenant operations"]
  node_tenant["Tenants &amp; portal"]
  node_reminders["Rent reminders"]
  node_whatsapp["WhatsApp manager"]
end

subgraph group_platform["Platform services"]
  node_datatransfer["Data transfer"]
  node_plugins["Runtime plugins"]
  node_settings["Settings<br/>[SettingManager.php]"]
  node_store[("Application database<br/>[Lease.php]")]
end

node_staff(("Owner / staff"))
node_gatewayexternal{{"Payment gateway"}}
node_whatsappdriver{{"WhatsApp driver"}}
node_tenantactor(("Tenant"))

node_staff -->|"manages leases"| node_leaseweb
node_leaseweb -->|"executes"| node_leaseactions
node_leaseweb -->|"loads units"| node_propertyunit
node_leaseactions -->|"persists leases"| node_store
node_applications -->|"records applications"| node_store
node_maintenance -->|"updates tickets"| node_store
node_inspections -->|"records inspections"| node_store
node_expenseutility -->|"records costs/readings"| node_store
node_tenantactor -->|"uses portal"| node_tenant
node_tenant -->|"submits payment"| node_payment
node_payment -->|"records payment"| node_store
node_payment -.->|"starts gateway attempt"| node_gateway
node_gateway -->|"reads configuration"| node_settings
node_gateway -.->|"dispatches payment"| node_gatewayexternal
node_invoice -->|"generates invoices"| node_store
node_reminders -->|"reads due invoices"| node_store
node_reminders -->|"sends reminders"| node_whatsapp
node_whatsapp -->|"reads driver settings"| node_settings
node_whatsapp -->|"dispatches message"| node_whatsappdriver
node_dashboard -->|"queries rent data"| node_store
node_datatransfer -->|"imports / exports"| node_store
node_plugins -->|"manages platform settings"| node_settings
node_staff -->|"reviews applicants"| node_applications
node_staff -->|"handles maintenance"| node_maintenance
node_staff -->|"conducts inspections"| node_inspections
node_staff -->|"tracks costs"| node_expenseutility
node_staff -->|"generates billing"| node_invoice
node_staff -->|"reviews operations"| node_dashboard
node_staff -->|"transfers records"| node_datatransfer

click node_leaseweb "https://github.com/senatroxx/openkos/blob/main/app/Http/Controllers/LeaseController.php"
click node_leaseactions "https://github.com/senatroxx/openkos/blob/main/app/Actions/Leases/CreateLease.php"
click node_propertyunit "https://github.com/senatroxx/openkos/blob/main/app/Models/Property.php"
click node_applications "https://github.com/senatroxx/openkos/blob/main/app/Actions/Applications/SubmitApplication.php"
click node_maintenance "https://github.com/senatroxx/openkos/blob/main/app/Actions/Maintenance/ResolveTicket.php"
click node_inspections "https://github.com/senatroxx/openkos/blob/main/app/Actions/Inspections/CreateInspection.php"
click node_expenseutility "https://github.com/senatroxx/openkos/blob/main/app/Actions/Expenses/RecordExpense.php"
click node_tenant "https://github.com/senatroxx/openkos/blob/main/app/Http/Controllers/TenantPortal/PaymentController.php"
click node_invoice "https://github.com/senatroxx/openkos/blob/main/app/Actions/Invoices/GenerateInvoices.php"
click node_payment "https://github.com/senatroxx/openkos/blob/main/app/Actions/Payments/RecordPayment.php"
click node_gateway "https://github.com/senatroxx/openkos/blob/main/app/Services/Payments/PaymentGatewayManager.php"
click node_reminders "https://github.com/senatroxx/openkos/blob/main/app/Actions/Reminders/SendRentReminders.php"
click node_whatsapp "https://github.com/senatroxx/openkos/blob/main/app/Services/WhatsAppManager.php"
click node_dashboard "https://github.com/senatroxx/openkos/blob/main/app/Http/Controllers/Dashboard/RentController.php"
click node_datatransfer "https://github.com/senatroxx/openkos/blob/main/app/Services/DataTransfer/MasterDataTransferService.php"
click node_plugins "https://github.com/senatroxx/openkos/blob/main/app/Services/Platform/PluginManagementService.php"
click node_settings "https://github.com/senatroxx/openkos/blob/main/app/Services/Settings/SettingManager.php"
click node_store "https://github.com/senatroxx/openkos/blob/main/app/Models/Lease.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_leaseweb,node_leaseactions,node_propertyunit,node_applications,node_maintenance,node_inspections,node_expenseutility toneBlue
class node_invoice,node_payment,node_gateway,node_dashboard toneAmber
class node_tenant,node_reminders,node_whatsapp toneMint
class node_datatransfer,node_plugins,node_settings,node_store toneRose
class node_staff,node_gatewayexternal,node_whatsappdriver,node_tenantactor toneIndigo
```

## Components

### Rental operations

- [Lease controller](https://github.com/senatroxx/openkos/blob/main/app/Http/Controllers/LeaseController.php): `app/Http/Controllers/LeaseController.php`
- [Lease actions](https://github.com/senatroxx/openkos/blob/main/app/Actions/Leases/CreateLease.php): `app/Actions/Leases/CreateLease.php`
- [Properties & units](https://github.com/senatroxx/openkos/blob/main/app/Models/Property.php): `app/Models/Property.php`
- [Applications](https://github.com/senatroxx/openkos/blob/main/app/Actions/Applications/SubmitApplication.php): `app/Actions/Applications/SubmitApplication.php`
- [Maintenance tickets](https://github.com/senatroxx/openkos/blob/main/app/Actions/Maintenance/ResolveTicket.php): `app/Actions/Maintenance/ResolveTicket.php`
- [Inspections](https://github.com/senatroxx/openkos/blob/main/app/Actions/Inspections/CreateInspection.php): `app/Actions/Inspections/CreateInspection.php`
- [Expenses & utilities](https://github.com/senatroxx/openkos/blob/main/app/Actions/Expenses/RecordExpense.php): `app/Actions/Expenses/RecordExpense.php`

### Billing operations

- [Invoices](https://github.com/senatroxx/openkos/blob/main/app/Actions/Invoices/GenerateInvoices.php): `app/Actions/Invoices/GenerateInvoices.php`
- [Payment workflow](https://github.com/senatroxx/openkos/blob/main/app/Actions/Payments/RecordPayment.php): `app/Actions/Payments/RecordPayment.php`
- [Gateway manager](https://github.com/senatroxx/openkos/blob/main/app/Services/Payments/PaymentGatewayManager.php): `app/Services/Payments/PaymentGatewayManager.php`
- [Dashboard & reports](https://github.com/senatroxx/openkos/blob/main/app/Http/Controllers/Dashboard/RentController.php): `app/Http/Controllers/Dashboard/RentController.php`

### Tenant operations

- [Tenants & portal](https://github.com/senatroxx/openkos/blob/main/app/Http/Controllers/TenantPortal/PaymentController.php): `app/Http/Controllers/TenantPortal/PaymentController.php`
- [Rent reminders](https://github.com/senatroxx/openkos/blob/main/app/Actions/Reminders/SendRentReminders.php): `app/Actions/Reminders/SendRentReminders.php`
- [WhatsApp manager](https://github.com/senatroxx/openkos/blob/main/app/Services/WhatsAppManager.php): `app/Services/WhatsAppManager.php`

### Platform services

- [Data transfer](https://github.com/senatroxx/openkos/blob/main/app/Services/DataTransfer/MasterDataTransferService.php): `app/Services/DataTransfer/MasterDataTransferService.php`
- [Runtime plugins](https://github.com/senatroxx/openkos/blob/main/app/Services/Platform/PluginManagementService.php): `app/Services/Platform/PluginManagementService.php`
- [Settings](https://github.com/senatroxx/openkos/blob/main/app/Services/Settings/SettingManager.php): `app/Services/Settings/SettingManager.php`
- [Application database](https://github.com/senatroxx/openkos/blob/main/app/Models/Lease.php): `app/Models/Lease.php`

### Other components

- **Owner / staff**
- **Payment gateway**
- **WhatsApp driver**
- **Tenant**

## Connections

- Owner / staff → Lease controller: manages leases
- Lease controller → Lease actions: executes
- Lease controller → Properties & units: loads units
- Lease actions → Application database: persists leases
- Applications → Application database: records applications
- Maintenance tickets → Application database: updates tickets
- Inspections → Application database: records inspections
- Expenses & utilities → Application database: records costs/readings
- Tenant → Tenants & portal: uses portal
- Tenants & portal → Payment workflow: submits payment
- Payment workflow → Application database: records payment
- Payment workflow → Gateway manager: starts gateway attempt
- Gateway manager → Settings: reads configuration
- Gateway manager → Payment gateway: dispatches payment
- Invoices → Application database: generates invoices
- Rent reminders → Application database: reads due invoices
- Rent reminders → WhatsApp manager: sends reminders
- WhatsApp manager → Settings: reads driver settings
- WhatsApp manager → WhatsApp driver: dispatches message
- Dashboard & reports → Application database: queries rent data
- Data transfer → Application database: imports / exports
- Runtime plugins → Settings: manages platform settings
- Owner / staff → Applications: reviews applicants
- Owner / staff → Maintenance tickets: handles maintenance
- Owner / staff → Inspections: conducts inspections
- Owner / staff → Expenses & utilities: tracks costs
- Owner / staff → Invoices: generates billing
- Owner / staff → Dashboard & reports: reviews operations
- Owner / staff → Data transfer: transfers records
