# finn301287/renthub.pro architecture

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

- Interactive diagram: https://gitdiagram.com/finn301287/renthub.pro
- Repository: https://github.com/finn301287/renthub.pro

## Overview

RentHub combines boarding-house management and vehicle rental in one Laravel/React application. Staff and administrators manage rooms, tenants, leases, rent, vehicles, bookings, maintenance, reports, audit logs, and backups; tenants handle their housing tasks, while customers browse vehicles and manage bookings. The browser enters the role-aware React app, whose pages use a shared API client to reach Laravel routes and controllers backed by relational models. The README documents the broader feature set; unsampled controllers and pages are represented at their tree paths, with links limited to documented or indexed relationships.

Main entry points: [`routes/api.php`](https://github.com/finn301287/renthub.pro/blob/main/routes/api.php) (JSON routes), [`app/Http/Controllers/BookingController.php`](https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/BookingController.php) (Booking workflow), [`resources/js/App.jsx`](https://github.com/finn301287/renthub.pro/blob/main/resources/js/App.jsx) (Role-based app), [`app/Http/Controllers/DashboardController.php`](https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/DashboardController.php) (Dashboard reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Role-based app<br/>[App.jsx]"]
  node_auth["Login state<br/>[auth.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_shared_ui["Shared UI<br/>[ui.jsx]"]
  node_customer_screens["Customer screens<br/>[Customer.jsx]"]
  node_tenant_screens["Tenant screens<br/>[Tenant.jsx]"]
  node_staff_screens["Staff screens<br/>[Bookings.jsx]"]
end

subgraph group_rental["Vehicle rental"]
  node_booking_controller["Booking workflow"]
  node_rental_controller["Rental records"]
  node_rental_maintenance["Vehicle maintenance"]
end

subgraph group_housing["Housing operations"]
  node_lease_service["Lease schedules<br/>[LeaseService.php]"]
  node_rent_payment_controller["Rent payments"]
  node_maintenance_controller["Room maintenance"]
end

subgraph group_platform["Laravel platform"]
  node_web_routes["Web entry routes<br/>[web.php]"]
  node_api_routes["JSON routes<br/>[api.php]"]
  node_auth_controller["Authentication<br/>[AuthController.php]"]
  node_dashboard_controller["Dashboard reports"]
  node_notifications_audit["Notifications and audit<br/>[Helpers.php]"]
end

subgraph group_data["Domain data"]
  node_booking_model["Booking records<br/>[Booking.php]"]
  node_rental_payment_model["Rental payments<br/>[RentalPayment.php]"]
  node_lease_model["Lease records<br/>[Lease.php]"]
  node_rent_payment_model["Rent records<br/>[RentPayment.php]"]
  node_room_model["Room records<br/>[Room.php]"]
  node_tenant_model["Tenant records<br/>[Tenant.php]"]
  node_customer_model["Customer records<br/>[Customer.php]"]
  node_vehicle_model["Vehicle records<br/>[Vehicle.php]"]
  node_user_model["User accounts<br/>[User.php]"]
end

node_browser(("Browser users"))
node_database[("MySQL database")]

node_browser -->|"opens app"| node_web_routes
node_web_routes -->|"serves React app"| node_app
node_app -->|"uses auth state"| node_auth
node_app -->|"renders shared UI"| node_shared_ui
node_app -->|"routes customer"| node_customer_screens
node_app -->|"routes tenant"| node_tenant_screens
node_app -->|"routes staff"| node_staff_screens
node_customer_screens -->|"calls API"| node_api_client
node_staff_screens -->|"calls API"| node_api_client
node_auth -->|"uses API"| node_api_client
node_api_client -->|"sends JSON requests"| node_api_routes
node_api_routes -->|"routes requests"| node_auth_controller
node_api_routes -->|"routes requests"| node_booking_controller
node_api_routes -->|"routes requests"| node_rental_controller
node_api_routes -->|"routes requests"| node_rental_maintenance
node_api_routes -->|"routes requests"| node_dashboard_controller
node_api_routes -.->|"routes lease requests"| node_lease_service
node_api_routes -->|"routes requests"| node_rent_payment_controller
node_api_routes -->|"routes requests"| node_maintenance_controller
node_booking_controller -->|"queries bookings"| node_booking_model
node_booking_controller -->|"creates payments"| node_rental_payment_model
node_booking_controller -->|"checks vehicle"| node_vehicle_model
node_booking_controller -->|"loads customer"| node_customer_model
node_booking_controller -->|"sends notifications"| node_notifications_audit
node_rental_controller -->|"uses booking logic"| node_booking_controller
node_rental_controller -->|"records payments"| node_rental_payment_model
node_rental_controller -->|"queries bookings"| node_booking_model
node_rental_maintenance -->|"updates vehicle"| node_vehicle_model
node_dashboard_controller -->|"reads bookings"| node_booking_model
node_dashboard_controller -->|"reads rent"| node_rent_payment_model
node_dashboard_controller -->|"reads rental income"| node_rental_payment_model
node_dashboard_controller -->|"counts rooms"| node_room_model
node_dashboard_controller -->|"counts vehicles"| node_vehicle_model
node_lease_service -->|"manages leases"| node_lease_model
node_lease_service -->|"builds rent schedule"| node_rent_payment_model
node_lease_service -->|"updates room"| node_room_model
node_lease_service -->|"uses tenant"| node_tenant_model
node_rent_payment_controller -->|"records payments"| node_rent_payment_model
node_maintenance_controller -->|"checks active lease"| node_lease_model
node_maintenance_controller -->|"sends notices"| node_notifications_audit
node_booking_model -->|"persists bookings"| node_database
node_lease_model -->|"persists leases"| node_database
node_rent_payment_model -->|"persists rent"| node_database
node_room_model -->|"persists rooms"| node_database
node_tenant_model -->|"persists tenants"| node_database
node_customer_model -->|"persists customers"| node_database
node_vehicle_model -->|"persists vehicles"| node_database
node_user_model -->|"persists accounts"| node_database

click node_app "https://github.com/finn301287/renthub.pro/blob/main/resources/js/App.jsx"
click node_auth "https://github.com/finn301287/renthub.pro/blob/main/resources/js/auth.jsx"
click node_api_client "https://github.com/finn301287/renthub.pro/blob/main/resources/js/api.js"
click node_shared_ui "https://github.com/finn301287/renthub.pro/blob/main/resources/js/ui.jsx"
click node_customer_screens "https://github.com/finn301287/renthub.pro/blob/main/resources/js/pages/Customer.jsx"
click node_tenant_screens "https://github.com/finn301287/renthub.pro/blob/main/resources/js/pages/Tenant.jsx"
click node_staff_screens "https://github.com/finn301287/renthub.pro/blob/main/resources/js/pages/Bookings.jsx"
click node_web_routes "https://github.com/finn301287/renthub.pro/blob/main/routes/web.php"
click node_api_routes "https://github.com/finn301287/renthub.pro/blob/main/routes/api.php"
click node_auth_controller "https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/AuthController.php"
click node_booking_controller "https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/BookingController.php"
click node_rental_controller "https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/RentalController.php"
click node_rental_maintenance "https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/MaintenanceController.php"
click node_dashboard_controller "https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/DashboardController.php"
click node_lease_service "https://github.com/finn301287/renthub.pro/blob/main/app/Services/LeaseService.php"
click node_rent_payment_controller "https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/RentPaymentController.php"
click node_maintenance_controller "https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/MaintenanceController.php"
click node_booking_model "https://github.com/finn301287/renthub.pro/blob/main/app/Models/Booking.php"
click node_rental_payment_model "https://github.com/finn301287/renthub.pro/blob/main/app/Models/RentalPayment.php"
click node_lease_model "https://github.com/finn301287/renthub.pro/blob/main/app/Models/Lease.php"
click node_rent_payment_model "https://github.com/finn301287/renthub.pro/blob/main/app/Models/RentPayment.php"
click node_room_model "https://github.com/finn301287/renthub.pro/blob/main/app/Models/Room.php"
click node_tenant_model "https://github.com/finn301287/renthub.pro/blob/main/app/Models/Tenant.php"
click node_customer_model "https://github.com/finn301287/renthub.pro/blob/main/app/Models/Customer.php"
click node_vehicle_model "https://github.com/finn301287/renthub.pro/blob/main/app/Models/Vehicle.php"
click node_user_model "https://github.com/finn301287/renthub.pro/blob/main/app/Models/User.php"
click node_notifications_audit "https://github.com/finn301287/renthub.pro/blob/main/app/Support/Helpers.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_app,node_auth,node_api_client,node_shared_ui,node_customer_screens,node_tenant_screens,node_staff_screens,node_browser toneBlue
class node_booking_controller,node_rental_controller,node_rental_maintenance,node_database toneAmber
class node_lease_service,node_rent_payment_controller,node_maintenance_controller toneMint
class node_web_routes,node_api_routes,node_auth_controller,node_dashboard_controller,node_notifications_audit toneRose
class node_booking_model,node_rental_payment_model,node_lease_model,node_rent_payment_model,node_room_model,node_tenant_model,node_customer_model,node_vehicle_model,node_user_model toneIndigo
```

## Components

### React client

- [Role-based app](https://github.com/finn301287/renthub.pro/blob/main/resources/js/App.jsx): `resources/js/App.jsx`
- [Login state](https://github.com/finn301287/renthub.pro/blob/main/resources/js/auth.jsx): `resources/js/auth.jsx`
- [API client](https://github.com/finn301287/renthub.pro/blob/main/resources/js/api.js): `resources/js/api.js`
- [Shared UI](https://github.com/finn301287/renthub.pro/blob/main/resources/js/ui.jsx): `resources/js/ui.jsx`
- [Customer screens](https://github.com/finn301287/renthub.pro/blob/main/resources/js/pages/Customer.jsx): `resources/js/pages/Customer.jsx`
- [Tenant screens](https://github.com/finn301287/renthub.pro/blob/main/resources/js/pages/Tenant.jsx): `resources/js/pages/Tenant.jsx`
- [Staff screens](https://github.com/finn301287/renthub.pro/blob/main/resources/js/pages/Bookings.jsx): `resources/js/pages/Bookings.jsx`

### Vehicle rental

- [Booking workflow](https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/BookingController.php): `app/Http/Controllers/BookingController.php`
- [Rental records](https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/RentalController.php): `app/Http/Controllers/RentalController.php`
- [Vehicle maintenance](https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/MaintenanceController.php): `app/Http/Controllers/MaintenanceController.php`

### Housing operations

- [Lease schedules](https://github.com/finn301287/renthub.pro/blob/main/app/Services/LeaseService.php): `app/Services/LeaseService.php`
- [Rent payments](https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/RentPaymentController.php): `app/Http/Controllers/RentPaymentController.php`
- [Room maintenance](https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/MaintenanceController.php): `app/Http/Controllers/MaintenanceController.php`

### Laravel platform

- [Web entry routes](https://github.com/finn301287/renthub.pro/blob/main/routes/web.php): `routes/web.php`
- [JSON routes](https://github.com/finn301287/renthub.pro/blob/main/routes/api.php): `routes/api.php`
- [Authentication](https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/AuthController.php): `app/Http/Controllers/AuthController.php`
- [Dashboard reports](https://github.com/finn301287/renthub.pro/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Notifications and audit](https://github.com/finn301287/renthub.pro/blob/main/app/Support/Helpers.php): `app/Support/Helpers.php`

### Domain data

- [Booking records](https://github.com/finn301287/renthub.pro/blob/main/app/Models/Booking.php): `app/Models/Booking.php`
- [Rental payments](https://github.com/finn301287/renthub.pro/blob/main/app/Models/RentalPayment.php): `app/Models/RentalPayment.php`
- [Lease records](https://github.com/finn301287/renthub.pro/blob/main/app/Models/Lease.php): `app/Models/Lease.php`
- [Rent records](https://github.com/finn301287/renthub.pro/blob/main/app/Models/RentPayment.php): `app/Models/RentPayment.php`
- [Room records](https://github.com/finn301287/renthub.pro/blob/main/app/Models/Room.php): `app/Models/Room.php`
- [Tenant records](https://github.com/finn301287/renthub.pro/blob/main/app/Models/Tenant.php): `app/Models/Tenant.php`
- [Customer records](https://github.com/finn301287/renthub.pro/blob/main/app/Models/Customer.php): `app/Models/Customer.php`
- [Vehicle records](https://github.com/finn301287/renthub.pro/blob/main/app/Models/Vehicle.php): `app/Models/Vehicle.php`
- [User accounts](https://github.com/finn301287/renthub.pro/blob/main/app/Models/User.php): `app/Models/User.php`

### Other components

- **Browser users**
- **MySQL database**

## Connections

- Browser users → Web entry routes: opens app (evidence: `README.md`)
- Web entry routes → Role-based app: serves React app (evidence: `README.md`)
- Role-based app → Login state: uses auth state (evidence: `resources/js/App.jsx`)
- Role-based app → Shared UI: renders shared UI (evidence: `resources/js/App.jsx`)
- Role-based app → Customer screens: routes customer (evidence: `resources/js/App.jsx`)
- Role-based app → Tenant screens: routes tenant (evidence: `resources/js/App.jsx`)
- Role-based app → Staff screens: routes staff (evidence: `resources/js/App.jsx`)
- Customer screens → API client: calls API (evidence: `resources/js/pages/Customer.jsx`)
- Staff screens → API client: calls API (evidence: `resources/js/pages/Bookings.jsx`)
- Login state → API client: uses API (evidence: `resources/js/auth.jsx`)
- API client → JSON routes: sends JSON requests (evidence: `README.md`)
- JSON routes → Authentication: routes requests (evidence: `routes/api.php`)
- JSON routes → Booking workflow: routes requests (evidence: `routes/api.php`)
- JSON routes → Rental records: routes requests (evidence: `routes/api.php`)
- JSON routes → Vehicle maintenance: routes requests (evidence: `routes/api.php`)
- JSON routes → Dashboard reports: routes requests (evidence: `routes/api.php`)
- JSON routes → Lease schedules: routes lease requests
- JSON routes → Rent payments: routes requests (evidence: `routes/api.php`)
- JSON routes → Room maintenance: routes requests (evidence: `routes/api.php`)
- Booking workflow → Booking records: queries bookings (evidence: `app/Http/Controllers/BookingController.php`)
- Booking workflow → Rental payments: creates payments (evidence: `app/Http/Controllers/BookingController.php`)
- Booking workflow → Vehicle records: checks vehicle (evidence: `app/Http/Controllers/BookingController.php`)
- Booking workflow → Customer records: loads customer (evidence: `app/Http/Controllers/BookingController.php`)
- Booking workflow → Notifications and audit: sends notifications (evidence: `app/Http/Controllers/BookingController.php`)
- Rental records → Booking workflow: uses booking logic (evidence: `app/Http/Controllers/RentalController.php`)
- Rental records → Rental payments: records payments (evidence: `app/Http/Controllers/RentalController.php`)
- Rental records → Booking records: queries bookings (evidence: `app/Http/Controllers/RentalController.php`)
- Vehicle maintenance → Vehicle records: updates vehicle (evidence: `app/Http/Controllers/MaintenanceController.php`)
- Dashboard reports → Booking records: reads bookings (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard reports → Rent records: reads rent (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard reports → Rental payments: reads rental income (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard reports → Room records: counts rooms (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard reports → Vehicle records: counts vehicles (evidence: `app/Http/Controllers/DashboardController.php`)
- Lease schedules → Lease records: manages leases (evidence: `app/Services/LeaseService.php`)
- Lease schedules → Rent records: builds rent schedule (evidence: `app/Services/LeaseService.php`)
- Lease schedules → Room records: updates room (evidence: `app/Services/LeaseService.php`)
- Lease schedules → Tenant records: uses tenant (evidence: `app/Services/LeaseService.php`)
- Rent payments → Rent records: records payments (evidence: `app/Http/Controllers/RentPaymentController.php`)
- Room maintenance → Lease records: checks active lease (evidence: `app/Http/Controllers/MaintenanceController.php`)
- Room maintenance → Notifications and audit: sends notices (evidence: `app/Http/Controllers/MaintenanceController.php`)
- Booking records → MySQL database: persists bookings (evidence: `app/Models/Booking.php`)
- Lease records → MySQL database: persists leases (evidence: `app/Models/Lease.php`)
- Rent records → MySQL database: persists rent (evidence: `app/Models/RentPayment.php`)
- Room records → MySQL database: persists rooms (evidence: `app/Models/Room.php`)
- Tenant records → MySQL database: persists tenants (evidence: `app/Models/Tenant.php`)
- Customer records → MySQL database: persists customers (evidence: `app/Models/Customer.php`)
- Vehicle records → MySQL database: persists vehicles (evidence: `app/Models/Vehicle.php`)
- User accounts → MySQL database: persists accounts (evidence: `app/Models/User.php`)
