# gamothalaman090-jpg/jptl architecture

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

- Interactive diagram: https://gitdiagram.com/gamothalaman090-jpg/jptl
- Repository: https://github.com/gamothalaman090-jpg/jptl

## Overview

JPTL is a property and lease management platform with landlord, tenant, and superadmin interfaces backed by a modular API. Landlords onboard portfolios, manage properties and tenants, then handle leases, rent, documents, announcements, and maintenance; tenants use a portal for corresponding lease, payment, document, and ticket tasks. The server also provides authentication, notifications, and platform administration. The tree and sampled code support the API entry point and selected service interactions; unsampled module wiring is not expanded into asserted call chains.

Main entry points: [`apps/server/app.js`](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/app.js) (API application), [`apps/client/src/App.jsx`](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/client/src/App.jsx) (Client router), [`apps/server/src/modules/auth`](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/auth) (Authentication), [`apps/client/src/services/api.js`](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/client/src/services/api.js) (Client API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User applications"]
  node_client_app["Client router<br/>[App.jsx]"]
  node_landlord_ui["Landlord dashboard<br/>[DashboardPage.jsx]"]
  node_tenant_ui["Tenant portal"]
  node_admin_ui["Admin portal"]
  node_client_api["Client API<br/>[api.js]"]
  node_admin_api["Admin API client<br/>[superadminApi.js]"]
end

subgraph group_server["API and identity"]
  node_api_entry["API application<br/>[app.js]"]
  node_auth["Authentication"]
  node_user_model[("User records<br/>[user.model.js]")]
end

subgraph group_landlord["Landlord operations"]
  node_landlord_onboarding["Portfolio onboarding"]
  node_properties["Properties and units"]
  node_rentroll["Rent roll"]
  node_landlord_tickets["Maintenance tickets"]
  node_landlord_docs["Landlord documents"]
  node_landlord_announcements["Announcements"]
end

subgraph group_tenant["Tenant services"]
  node_tenant_payments["Tenant payments"]
  node_tenant_lease["Lease services"]
  node_tenant_tickets["Tenant tickets"]
  node_tenant_docs["Tenant documents"]
  node_tenant_announcements["Tenant announcements"]
end

subgraph group_platform["Platform administration"]
  node_superadmin["Platform controls"]
  node_notifications["Notifications"]
  node_session_monitor["Session monitoring"]
  node_session_model[("Session records")]
  node_notification_model[("Notification records")]
end

node_landlord_actor(("Landlord"))
node_tenant_actor(("Tenant"))
node_admin_actor(("Superadmin"))

node_landlord_actor -->|"uses"| node_client_app
node_tenant_actor -->|"uses"| node_client_app
node_admin_actor -->|"uses"| node_admin_ui
node_client_app -->|"routes"| node_landlord_ui
node_client_app -->|"routes"| node_tenant_ui
node_landlord_ui -.->|"requests"| node_client_api
node_tenant_ui -.->|"requests"| node_client_api
node_admin_ui -.->|"requests"| node_admin_api
node_client_api -.->|"calls"| node_api_entry
node_admin_api -.->|"calls"| node_api_entry
node_api_entry -->|"mounts"| node_auth
node_api_entry -->|"mounts"| node_landlord_onboarding
node_api_entry -->|"mounts"| node_properties
node_api_entry -->|"mounts"| node_rentroll
node_api_entry -->|"mounts"| node_landlord_tickets
node_api_entry -->|"mounts"| node_landlord_docs
node_api_entry -->|"mounts"| node_landlord_announcements
node_api_entry -->|"mounts"| node_tenant_payments
node_api_entry -->|"mounts"| node_tenant_lease
node_api_entry -->|"mounts"| node_tenant_tickets
node_api_entry -->|"mounts"| node_tenant_docs
node_api_entry -->|"mounts"| node_tenant_announcements
node_api_entry -->|"mounts"| node_superadmin
node_api_entry -->|"mounts"| node_notifications
node_auth -->|"reads and writes"| node_user_model
node_auth -->|"records login"| node_session_monitor
node_session_monitor -->|"stores sessions"| node_session_model
node_superadmin -->|"streams sessions"| node_session_monitor
node_notifications -->|"reads and writes"| node_notification_model

click node_client_app "https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/client/src/App.jsx"
click node_landlord_ui "https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/client/src/pages/DashboardPage.jsx"
click node_tenant_ui "https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/client/src/pages/TenantPortalPage.jsx"
click node_admin_ui "https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/superadmin/src/pages/SuperadminPortalPage.jsx"
click node_client_api "https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/client/src/services/api.js"
click node_admin_api "https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/superadmin/src/services/superadminApi.js"
click node_api_entry "https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/app.js"
click node_auth "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/auth"
click node_landlord_onboarding "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/landlord/onboarding"
click node_properties "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/landlord/properties"
click node_rentroll "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/landlord/rentroll"
click node_landlord_tickets "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/landlord/tickets"
click node_landlord_docs "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/landlord/documents"
click node_landlord_announcements "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/landlord/announcements"
click node_tenant_payments "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/tenant/payments"
click node_tenant_lease "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/tenant/lease"
click node_tenant_tickets "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/tenant/tickets"
click node_tenant_docs "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/tenant/documents"
click node_tenant_announcements "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/tenant/announcements"
click node_superadmin "https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/superadmin"
click node_notifications "https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/src/modules/notifications/notification.routes.js"
click node_session_monitor "https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/src/shared/services/sessionMonitor.service.js"
click node_user_model "https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/src/shared/models/user.model.js"
click node_session_model "https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/src/shared/models/sessionLog.model.js"
click node_notification_model "https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/src/shared/models/notification.model.js"

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_client_app,node_landlord_ui,node_tenant_ui,node_admin_ui,node_client_api,node_admin_api toneBlue
class node_api_entry,node_auth,node_user_model toneAmber
class node_landlord_onboarding,node_properties,node_rentroll,node_landlord_tickets,node_landlord_docs,node_landlord_announcements toneMint
class node_tenant_payments,node_tenant_lease,node_tenant_tickets,node_tenant_docs,node_tenant_announcements toneRose
class node_superadmin,node_notifications,node_session_monitor,node_session_model,node_notification_model,node_landlord_actor,node_tenant_actor,node_admin_actor toneIndigo
```

## Components

### User applications

- [Client router](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/client/src/App.jsx): `apps/client/src/App.jsx`
- [Landlord dashboard](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/client/src/pages/DashboardPage.jsx): `apps/client/src/pages/DashboardPage.jsx`
- [Tenant portal](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/client/src/pages/TenantPortalPage.jsx): `apps/client/src/pages/TenantPortalPage.jsx`
- [Admin portal](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/superadmin/src/pages/SuperadminPortalPage.jsx): `apps/superadmin/src/pages/SuperadminPortalPage.jsx`
- [Client API](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/client/src/services/api.js): `apps/client/src/services/api.js`
- [Admin API client](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/superadmin/src/services/superadminApi.js): `apps/superadmin/src/services/superadminApi.js`

### API and identity

- [API application](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/app.js): `apps/server/app.js`
- [Authentication](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/auth): `apps/server/src/modules/auth`
- [User records](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/src/shared/models/user.model.js): `apps/server/src/shared/models/user.model.js`

### Landlord operations

- [Portfolio onboarding](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/landlord/onboarding): `apps/server/src/modules/landlord/onboarding`
- [Properties and units](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/landlord/properties): `apps/server/src/modules/landlord/properties`
- [Rent roll](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/landlord/rentroll): `apps/server/src/modules/landlord/rentroll`
- [Maintenance tickets](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/landlord/tickets): `apps/server/src/modules/landlord/tickets`
- [Landlord documents](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/landlord/documents): `apps/server/src/modules/landlord/documents`
- [Announcements](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/landlord/announcements): `apps/server/src/modules/landlord/announcements`

### Tenant services

- [Tenant payments](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/tenant/payments): `apps/server/src/modules/tenant/payments`
- [Lease services](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/tenant/lease): `apps/server/src/modules/tenant/lease`
- [Tenant tickets](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/tenant/tickets): `apps/server/src/modules/tenant/tickets`
- [Tenant documents](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/tenant/documents): `apps/server/src/modules/tenant/documents`
- [Tenant announcements](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/tenant/announcements): `apps/server/src/modules/tenant/announcements`

### Platform administration

- [Platform controls](https://github.com/gamothalaman090-jpg/jptl/tree/prod/apps/server/src/modules/superadmin): `apps/server/src/modules/superadmin`
- [Notifications](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/src/modules/notifications/notification.routes.js): `apps/server/src/modules/notifications/notification.routes.js`
- [Session monitoring](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/src/shared/services/sessionMonitor.service.js): `apps/server/src/shared/services/sessionMonitor.service.js`
- [Session records](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/src/shared/models/sessionLog.model.js): `apps/server/src/shared/models/sessionLog.model.js`
- [Notification records](https://github.com/gamothalaman090-jpg/jptl/blob/prod/apps/server/src/shared/models/notification.model.js): `apps/server/src/shared/models/notification.model.js`

### Other components

- **Landlord**
- **Tenant**
- **Superadmin**

## Connections

- Landlord → Client router: uses
- Tenant → Client router: uses
- Superadmin → Admin portal: uses
- Client router → Landlord dashboard: routes
- Client router → Tenant portal: routes
- Landlord dashboard → Client API: requests
- Tenant portal → Client API: requests
- Admin portal → Admin API client: requests
- Client API → API application: calls
- Admin API client → API application: calls
- API application → Authentication: mounts
- API application → Portfolio onboarding: mounts
- API application → Properties and units: mounts
- API application → Rent roll: mounts
- API application → Maintenance tickets: mounts
- API application → Landlord documents: mounts
- API application → Announcements: mounts
- API application → Tenant payments: mounts
- API application → Lease services: mounts
- API application → Tenant tickets: mounts
- API application → Tenant documents: mounts
- API application → Tenant announcements: mounts
- API application → Platform controls: mounts
- API application → Notifications: mounts
- Authentication → User records: reads and writes
- Authentication → Session monitoring: records login
- Session monitoring → Session records: stores sessions
- Platform controls → Session monitoring: streams sessions
- Notifications → Notification records: reads and writes
