# richardherold32/rentbridge architecture

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

- Interactive diagram: https://gitdiagram.com/richardherold32/rentbridge
- Repository: https://github.com/richardherold32/rentbridge

## Overview

RentBridge is a rental-property management application for owners and tenants. Its central workflow is managing properties and leases, then handling rent payments, maintenance, inspections and tenant verification. The source tree also shows property inquiries, messaging, notifications, tax/expense tools and AI rent recommendations. The README is only a generic Next.js starter README, so it does not document product workflows. Relationships below are limited to imports and calls visible in sampled routes or SOURCE INDEX references; unsampled UI-to-API connections are not asserted.

Main entry points: [`src/app/api/leases/route.ts`](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/leases/route.ts) (Lease management), [`src/lib/auth.ts`](https://github.com/richardherold32/rentbridge/blob/main/src/lib/auth.ts) (Session authentication), [`src/models/Property.ts`](https://github.com/richardherold32/rentbridge/blob/main/src/models/Property.ts) (Property records), [`src/app/api/maintenance/route.ts`](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/maintenance/route.ts) (Maintenance tickets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_dashboards["Role dashboards"]
  node_authpages["Sign-in pages<br/>[page.tsx]"]
end

subgraph group_property["Property lifecycle"]
  node_properties["Property management<br/>[route.ts]"]
  node_inquiries["Rental inquiries<br/>[route.ts]"]
  node_rentai["Rent estimator<br/>[route.ts]"]
  node_propertystore[("Property records<br/>[Property.ts]")]
  node_inquirystore[("Inquiry records<br/>[PropertyInquiry.ts]")]
end

subgraph group_tenancy["Tenancy operations"]
  node_leases["Lease management<br/>[route.ts]"]
  node_payments["Rent payments<br/>[route.ts]"]
  node_expenses["Expenses and tax<br/>[route.ts]"]
  node_leasestore[("Lease records<br/>[Lease.ts]")]
  node_paymentstore[("Payment records<br/>[Payment.ts]")]
  node_expensestore[("Expense records<br/>[Expense.ts]")]
end

subgraph group_support["Tenant services"]
  node_maintenance["Maintenance tickets<br/>[route.ts]"]
  node_inspections["Property inspections<br/>[route.ts]"]
  node_kyc["Tenant verification<br/>[route.ts]"]
  node_chat["Tenant messaging<br/>[route.ts]"]
  node_notifications["Notifications<br/>[route.ts]"]
  node_maintenancestore[("Ticket records")]
  node_inspectionstore[("Inspection records")]
  node_kycstore[("Verification records")]
  node_conversationstore[("Conversation records<br/>[Conversation.ts]")]
  node_messagestore[("Message records<br/>[Message.ts]")]
  node_notificationstore[("Notification records<br/>[Notification.ts]")]
end

subgraph group_platform["Shared platform"]
  node_auth["Session authentication<br/>[auth.ts]"]
  node_validation["Request validation<br/>[validations.ts]"]
  node_mongo["Database connection<br/>[mongodb.ts]"]
  node_userstore[("User records<br/>[User.ts]")]
end

node_owners(("Owners"))
node_tenants(("Tenants"))

node_owners -.->|"use"| node_dashboards
node_tenants -.->|"use"| node_dashboards
node_owners -.->|"sign in"| node_authpages
node_tenants -.->|"sign in"| node_authpages
node_properties -->|"reads and writes"| node_propertystore
node_inquiries -->|"reads and writes"| node_inquirystore
node_inquiries -->|"reads property"| node_propertystore
node_rentai -->|"checks session"| node_auth
node_leases -->|"reads and writes"| node_leasestore
node_leases -->|"reads and updates"| node_propertystore
node_leases -->|"finds tenant"| node_userstore
node_payments -->|"reads and writes"| node_paymentstore
node_payments -->|"reads property"| node_propertystore
node_expenses -->|"reads and writes"| node_expensestore
node_expenses -->|"reads property"| node_propertystore
node_maintenance -->|"reads and writes"| node_maintenancestore
node_maintenance -->|"reads property"| node_propertystore
node_inspections -->|"reads and writes"| node_inspectionstore
node_inspections -->|"reads lease"| node_leasestore
node_inspections -->|"creates notice"| node_notificationstore
node_kyc -->|"reads and writes"| node_kycstore
node_kyc -->|"reads leases"| node_leasestore
node_kyc -->|"reads users"| node_userstore
node_chat -->|"uses conversations"| node_conversationstore
node_chat -->|"reads and writes"| node_messagestore
node_notifications -->|"reads notices"| node_notificationstore
node_leases -->|"checks session"| node_auth
node_leases -->|"validates lease"| node_validation
node_maintenance -->|"checks session"| node_auth
node_maintenance -->|"validates ticket"| node_validation
node_inspections -->|"checks session"| node_auth
node_kyc -->|"checks session"| node_auth
node_chat -->|"checks session"| node_auth
node_notifications -->|"checks session"| node_auth
node_leases -->|"connects database"| node_mongo
node_maintenance -->|"connects database"| node_mongo
node_inspections -->|"connects database"| node_mongo
node_kyc -->|"connects database"| node_mongo
node_chat -->|"connects database"| node_mongo
node_notifications -->|"connects database"| node_mongo

click node_dashboards "https://github.com/richardherold32/rentbridge/tree/main/src/app/dashboard"
click node_authpages "https://github.com/richardherold32/rentbridge/blob/main/src/app/login/page.tsx"
click node_properties "https://github.com/richardherold32/rentbridge/blob/main/src/app/api/properties/route.ts"
click node_inquiries "https://github.com/richardherold32/rentbridge/blob/main/src/app/api/inquiries/route.ts"
click node_rentai "https://github.com/richardherold32/rentbridge/blob/main/src/app/api/ai/rent-recommend/route.ts"
click node_leases "https://github.com/richardherold32/rentbridge/blob/main/src/app/api/leases/route.ts"
click node_payments "https://github.com/richardherold32/rentbridge/blob/main/src/app/api/payments/route.ts"
click node_expenses "https://github.com/richardherold32/rentbridge/blob/main/src/app/api/expenses/route.ts"
click node_maintenance "https://github.com/richardherold32/rentbridge/blob/main/src/app/api/maintenance/route.ts"
click node_inspections "https://github.com/richardherold32/rentbridge/blob/main/src/app/api/inspections/route.ts"
click node_kyc "https://github.com/richardherold32/rentbridge/blob/main/src/app/api/kyc/route.ts"
click node_chat "https://github.com/richardherold32/rentbridge/blob/main/src/app/api/chat/messages/route.ts"
click node_notifications "https://github.com/richardherold32/rentbridge/blob/main/src/app/api/notifications/route.ts"
click node_auth "https://github.com/richardherold32/rentbridge/blob/main/src/lib/auth.ts"
click node_validation "https://github.com/richardherold32/rentbridge/blob/main/src/lib/validations.ts"
click node_mongo "https://github.com/richardherold32/rentbridge/blob/main/src/lib/mongodb.ts"
click node_userstore "https://github.com/richardherold32/rentbridge/blob/main/src/models/User.ts"
click node_propertystore "https://github.com/richardherold32/rentbridge/blob/main/src/models/Property.ts"
click node_inquirystore "https://github.com/richardherold32/rentbridge/blob/main/src/models/PropertyInquiry.ts"
click node_leasestore "https://github.com/richardherold32/rentbridge/blob/main/src/models/Lease.ts"
click node_paymentstore "https://github.com/richardherold32/rentbridge/blob/main/src/models/Payment.ts"
click node_expensestore "https://github.com/richardherold32/rentbridge/blob/main/src/models/Expense.ts"
click node_maintenancestore "https://github.com/richardherold32/rentbridge/blob/main/src/models/MaintenanceTicket.ts"
click node_inspectionstore "https://github.com/richardherold32/rentbridge/blob/main/src/models/PropertyInspection.ts"
click node_kycstore "https://github.com/richardherold32/rentbridge/blob/main/src/models/TenantVerification.ts"
click node_conversationstore "https://github.com/richardherold32/rentbridge/blob/main/src/models/Conversation.ts"
click node_messagestore "https://github.com/richardherold32/rentbridge/blob/main/src/models/Message.ts"
click node_notificationstore "https://github.com/richardherold32/rentbridge/blob/main/src/models/Notification.ts"

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_dashboards,node_authpages toneBlue
class node_properties,node_inquiries,node_rentai,node_propertystore,node_inquirystore toneAmber
class node_leases,node_payments,node_expenses,node_leasestore,node_paymentstore,node_expensestore toneMint
class node_maintenance,node_inspections,node_kyc,node_chat,node_notifications,node_maintenancestore,node_inspectionstore,node_kycstore,node_conversationstore,node_messagestore,node_notificationstore toneRose
class node_auth,node_validation,node_mongo,node_userstore,node_owners,node_tenants toneIndigo
```

## Components

### User experience

- [Role dashboards](https://github.com/richardherold32/rentbridge/tree/main/src/app/dashboard): `src/app/dashboard`
- [Sign-in pages](https://github.com/richardherold32/rentbridge/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`

### Property lifecycle

- [Property management](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/properties/route.ts): `src/app/api/properties/route.ts`
- [Rental inquiries](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/inquiries/route.ts): `src/app/api/inquiries/route.ts`
- [Rent estimator](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/ai/rent-recommend/route.ts): `src/app/api/ai/rent-recommend/route.ts`
- [Property records](https://github.com/richardherold32/rentbridge/blob/main/src/models/Property.ts): `src/models/Property.ts`
- [Inquiry records](https://github.com/richardherold32/rentbridge/blob/main/src/models/PropertyInquiry.ts): `src/models/PropertyInquiry.ts`

### Tenancy operations

- [Lease management](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/leases/route.ts): `src/app/api/leases/route.ts`
- [Rent payments](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/payments/route.ts): `src/app/api/payments/route.ts`
- [Expenses and tax](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/expenses/route.ts): `src/app/api/expenses/route.ts`
- [Lease records](https://github.com/richardherold32/rentbridge/blob/main/src/models/Lease.ts): `src/models/Lease.ts`
- [Payment records](https://github.com/richardherold32/rentbridge/blob/main/src/models/Payment.ts): `src/models/Payment.ts`
- [Expense records](https://github.com/richardherold32/rentbridge/blob/main/src/models/Expense.ts): `src/models/Expense.ts`

### Tenant services

- [Maintenance tickets](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/maintenance/route.ts): `src/app/api/maintenance/route.ts`
- [Property inspections](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/inspections/route.ts): `src/app/api/inspections/route.ts`
- [Tenant verification](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/kyc/route.ts): `src/app/api/kyc/route.ts`
- [Tenant messaging](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/chat/messages/route.ts): `src/app/api/chat/messages/route.ts`
- [Notifications](https://github.com/richardherold32/rentbridge/blob/main/src/app/api/notifications/route.ts): `src/app/api/notifications/route.ts`
- [Ticket records](https://github.com/richardherold32/rentbridge/blob/main/src/models/MaintenanceTicket.ts): `src/models/MaintenanceTicket.ts`
- [Inspection records](https://github.com/richardherold32/rentbridge/blob/main/src/models/PropertyInspection.ts): `src/models/PropertyInspection.ts`
- [Verification records](https://github.com/richardherold32/rentbridge/blob/main/src/models/TenantVerification.ts): `src/models/TenantVerification.ts`
- [Conversation records](https://github.com/richardherold32/rentbridge/blob/main/src/models/Conversation.ts): `src/models/Conversation.ts`
- [Message records](https://github.com/richardherold32/rentbridge/blob/main/src/models/Message.ts): `src/models/Message.ts`
- [Notification records](https://github.com/richardherold32/rentbridge/blob/main/src/models/Notification.ts): `src/models/Notification.ts`

### Shared platform

- [Session authentication](https://github.com/richardherold32/rentbridge/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Request validation](https://github.com/richardherold32/rentbridge/blob/main/src/lib/validations.ts): `src/lib/validations.ts`
- [Database connection](https://github.com/richardherold32/rentbridge/blob/main/src/lib/mongodb.ts): `src/lib/mongodb.ts`
- [User records](https://github.com/richardherold32/rentbridge/blob/main/src/models/User.ts): `src/models/User.ts`

### Other components

- **Owners**
- **Tenants**

## Connections

- Owners → Role dashboards: use
- Tenants → Role dashboards: use
- Owners → Sign-in pages: sign in
- Tenants → Sign-in pages: sign in
- Property management → Property records: reads and writes (evidence: `src/app/api/properties/route.ts`)
- Rental inquiries → Inquiry records: reads and writes (evidence: `src/app/api/inquiries/route.ts`)
- Rental inquiries → Property records: reads property (evidence: `src/app/api/inquiries/route.ts`)
- Rent estimator → Session authentication: checks session (evidence: `src/app/api/ai/rent-recommend/route.ts`)
- Lease management → Lease records: reads and writes (evidence: `src/app/api/leases/route.ts`)
- Lease management → Property records: reads and updates (evidence: `src/app/api/leases/route.ts`)
- Lease management → User records: finds tenant (evidence: `src/app/api/leases/route.ts`)
- Rent payments → Payment records: reads and writes (evidence: `src/app/api/payments/route.ts`)
- Rent payments → Property records: reads property (evidence: `src/app/api/payments/route.ts`)
- Expenses and tax → Expense records: reads and writes (evidence: `src/app/api/expenses/route.ts`)
- Expenses and tax → Property records: reads property (evidence: `src/app/api/expenses/route.ts`)
- Maintenance tickets → Ticket records: reads and writes (evidence: `src/app/api/maintenance/route.ts`)
- Maintenance tickets → Property records: reads property (evidence: `src/app/api/maintenance/route.ts`)
- Property inspections → Inspection records: reads and writes (evidence: `src/app/api/inspections/route.ts`)
- Property inspections → Lease records: reads lease (evidence: `src/app/api/inspections/route.ts`)
- Property inspections → Notification records: creates notice (evidence: `src/app/api/inspections/route.ts`)
- Tenant verification → Verification records: reads and writes (evidence: `src/app/api/kyc/route.ts`)
- Tenant verification → Lease records: reads leases (evidence: `src/app/api/kyc/route.ts`)
- Tenant verification → User records: reads users (evidence: `src/app/api/kyc/route.ts`)
- Tenant messaging → Conversation records: uses conversations (evidence: `src/app/api/chat/messages/route.ts`)
- Tenant messaging → Message records: reads and writes (evidence: `src/app/api/chat/messages/route.ts`)
- Notifications → Notification records: reads notices (evidence: `src/app/api/notifications/route.ts`)
- Lease management → Session authentication: checks session (evidence: `src/app/api/leases/route.ts`)
- Lease management → Request validation: validates lease (evidence: `src/app/api/leases/route.ts`)
- Maintenance tickets → Session authentication: checks session (evidence: `src/app/api/maintenance/route.ts`)
- Maintenance tickets → Request validation: validates ticket (evidence: `src/app/api/maintenance/route.ts`)
- Property inspections → Session authentication: checks session (evidence: `src/app/api/inspections/route.ts`)
- Tenant verification → Session authentication: checks session (evidence: `src/app/api/kyc/route.ts`)
- Tenant messaging → Session authentication: checks session (evidence: `src/app/api/chat/messages/route.ts`)
- Notifications → Session authentication: checks session (evidence: `src/app/api/notifications/route.ts`)
- Lease management → Database connection: connects database (evidence: `src/app/api/leases/route.ts`)
- Maintenance tickets → Database connection: connects database (evidence: `src/app/api/maintenance/route.ts`)
- Property inspections → Database connection: connects database (evidence: `src/app/api/inspections/route.ts`)
- Tenant verification → Database connection: connects database (evidence: `src/app/api/kyc/route.ts`)
- Tenant messaging → Database connection: connects database (evidence: `src/app/api/chat/messages/route.ts`)
- Notifications → Database connection: connects database (evidence: `src/app/api/notifications/route.ts`)
