Docs Rental System

How the project works

A practical overview of the SaaS platform: tenancy, roles, modules, billing, accounting, and background automation.

Architecture

Request flow and tenancy

The platform supports a base public site and per-business tenant sites (subdomain/custom domain). Each request resolves the tenant (if any), then renders the correct theme and content.

Tenancy resolution (host → business)

Middleware runs first on all web requests:

ResolveTenantFromHost
  1) base domain? → no tenant
  2) subdomain match → Business.subdomain = {subdomain}
  3) fallback host match → Business.subdomain = {full host}

TenantContext::setBusiness($business)

Files: app/Http/Middleware/ResolveTenantFromHost.php, app/Support/TenantContext.php.

Themes (public marketing)

Public pages use a theme resolver so each business can have its own look.

Theme::current()
  - default: config('themes.default')
  - per-tenant: TenantContext::business()->public_theme
  - otherwise: system_options['theme']

Views live under resources/views/theme/{theme}/....

Roles & Billing

How access and subscriptions work

The app enforces role-based permissions and ensures a business has an active plan before accessing most operational screens.

Roles

Users belong to a business and have a role (e.g. agent, office admin, finance, manager, client). Tenants/landlords have portal-specific access.

Reference: ROLE_ACCESS.md.

Subscription gating

If a business has no plan or its status is inactive/expired, users are redirected to select a plan or complete billing.

Middleware: subscription (business subscription checks).

Audit trail

Requests capture route/method/ip/user-agent/request-id which is used across audit logging and security traceability.

Middleware: CaptureAuditContext.

Modules

What the system does

This is the high-level workflow most teams follow.

Properties & Units

Inventory setup, vacancy tracking, unit attributes, and public unit listings.

Tenants & Leases

Tenant onboarding, lease lifecycle, renewals, and unit occupancy.

Invoices & Payments

Monthly invoicing, receipts, allocations, credit balances, and statements.

Reconciliation

Import bank/M-PESA statements and auto-match to tenants/invoices.

Accounting

Double-entry ledger posting and core reports (TB, P&L, Balance Sheet, VAT).

Security Logbook

Security incidents/occurrence logs with audit traceability.

Background jobs (scheduler)

Background automation runs recurring tasks like subscriptions, invoice generation, M-PESA settlement polling, reconciliation auto-match, and rent reminders.

Want to see it in action?

Create an account and explore the dashboard modules with your team roles.

Chat on WhatsApp