# nhem-seyha/rental-property-management architecture

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

- Interactive diagram: https://gitdiagram.com/nhem-seyha/rental-property-management
- Repository: https://github.com/nhem-seyha/rental-property-management

## Overview

This repository implements a role-based rental-management backend as separate Express services behind an API gateway. Tenants and managers register or log in, then use authorized routes to manage properties and rooms, create and view rentals and payments, and perform manager-only updates. The gateway verifies JWTs and forwards tenant identity for rental and payment operations. The sampled route handlers show model operations; service entrypoints show MongoDB connections. No README was provided, so capabilities and relationships are based on the sampled source and SOURCE INDEX.

Main entry points: [`gateway/routes/gatewayRoutes.js`](https://github.com/nhem-seyha/rental-property-management/blob/main/gateway/routes/gatewayRoutes.js) (Gateway routing), [`property-room/routes/propertyRoutes.js`](https://github.com/nhem-seyha/rental-property-management/blob/main/property-room/routes/propertyRoutes.js) (Property management), [`rental-payment/routes/rentalRoutes.js`](https://github.com/nhem-seyha/rental-property-management/blob/main/rental-payment/routes/rentalRoutes.js) (Rental management), [`rental-payment/routes/paymentRoutes.js`](https://github.com/nhem-seyha/rental-property-management/blob/main/rental-payment/routes/paymentRoutes.js) (Payment management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and identity"]
  node_registration["User registration<br/>[userRoutes.js]"]
  node_registration_user["Registration user model<br/>[User.js]"]
  node_login["Login and tokens<br/>[authRoutes.js]"]
  node_login_user["Login user model<br/>[User.js]"]
end

subgraph group_gateway["API gateway"]
  node_gateway_routes["Gateway routing<br/>[gatewayRoutes.js]"]
  node_auth["JWT authorization<br/>[authMiddleware.js]"]
end

subgraph group_inventory["Property inventory"]
  node_property_routes["Property management<br/>[propertyRoutes.js]"]
  node_property_model["Property model<br/>[Property.js]"]
  node_room_routes["Room management<br/>[roomRoutes.js]"]
  node_room_model["Room model<br/>[Room.js]"]
end

subgraph group_leasing["Rentals and payments"]
  node_rental_routes["Rental management<br/>[rentalRoutes.js]"]
  node_rental_model["Rental model<br/>[Rental.js]"]
  node_payment_routes["Payment management<br/>[paymentRoutes.js]"]
  node_payment_model["Payment model<br/>[Payment.js]"]
end

node_clients(("API clients"))
node_mongodb[("MongoDB")]

node_clients -->|"send requests"| node_gateway_routes
node_gateway_routes -->|"verify and authorize"| node_auth
node_gateway_routes -->|"proxy registration"| node_registration
node_gateway_routes -->|"proxy login"| node_login
node_gateway_routes -->|"proxy property and room"| node_property_routes
node_gateway_routes -->|"proxy rentals"| node_rental_routes
node_gateway_routes -->|"proxy payments"| node_payment_routes
node_registration -->|"query and save"| node_registration_user
node_login -->|"find account"| node_login_user
node_property_routes -->|"query and save"| node_property_model
node_room_routes -->|"query and save"| node_room_model
node_rental_routes -->|"query and save"| node_rental_model
node_payment_routes -->|"query and save"| node_payment_model
node_property_routes -->|"persist through service"| node_mongodb
node_room_routes -->|"persist through service"| node_mongodb
node_rental_routes -->|"persist through service"| node_mongodb
node_payment_routes -->|"persist through service"| node_mongodb

click node_gateway_routes "https://github.com/nhem-seyha/rental-property-management/blob/main/gateway/routes/gatewayRoutes.js"
click node_auth "https://github.com/nhem-seyha/rental-property-management/blob/main/gateway/middleware/authMiddleware.js"
click node_registration "https://github.com/nhem-seyha/rental-property-management/blob/main/registration/routes/userRoutes.js"
click node_registration_user "https://github.com/nhem-seyha/rental-property-management/blob/main/registration/models/User.js"
click node_login "https://github.com/nhem-seyha/rental-property-management/blob/main/login/routes/authRoutes.js"
click node_login_user "https://github.com/nhem-seyha/rental-property-management/blob/main/login/models/User.js"
click node_property_routes "https://github.com/nhem-seyha/rental-property-management/blob/main/property-room/routes/propertyRoutes.js"
click node_property_model "https://github.com/nhem-seyha/rental-property-management/blob/main/property-room/models/Property.js"
click node_room_routes "https://github.com/nhem-seyha/rental-property-management/blob/main/property-room/routes/roomRoutes.js"
click node_room_model "https://github.com/nhem-seyha/rental-property-management/blob/main/property-room/models/Room.js"
click node_rental_routes "https://github.com/nhem-seyha/rental-property-management/blob/main/rental-payment/routes/rentalRoutes.js"
click node_rental_model "https://github.com/nhem-seyha/rental-property-management/blob/main/rental-payment/models/Rental.js"
click node_payment_routes "https://github.com/nhem-seyha/rental-property-management/blob/main/rental-payment/routes/paymentRoutes.js"
click node_payment_model "https://github.com/nhem-seyha/rental-property-management/blob/main/rental-payment/models/Payment.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_registration,node_registration_user,node_login,node_login_user,node_clients toneBlue
class node_gateway_routes,node_auth,node_mongodb toneAmber
class node_property_routes,node_property_model,node_room_routes,node_room_model toneMint
class node_rental_routes,node_rental_model,node_payment_routes,node_payment_model toneRose
```

## Components

### Access and identity

- [User registration](https://github.com/nhem-seyha/rental-property-management/blob/main/registration/routes/userRoutes.js): `registration/routes/userRoutes.js`
- [Registration user model](https://github.com/nhem-seyha/rental-property-management/blob/main/registration/models/User.js): `registration/models/User.js`
- [Login and tokens](https://github.com/nhem-seyha/rental-property-management/blob/main/login/routes/authRoutes.js): `login/routes/authRoutes.js`
- [Login user model](https://github.com/nhem-seyha/rental-property-management/blob/main/login/models/User.js): `login/models/User.js`

### API gateway

- [Gateway routing](https://github.com/nhem-seyha/rental-property-management/blob/main/gateway/routes/gatewayRoutes.js): `gateway/routes/gatewayRoutes.js`
- [JWT authorization](https://github.com/nhem-seyha/rental-property-management/blob/main/gateway/middleware/authMiddleware.js): `gateway/middleware/authMiddleware.js`

### Property inventory

- [Property management](https://github.com/nhem-seyha/rental-property-management/blob/main/property-room/routes/propertyRoutes.js): `property-room/routes/propertyRoutes.js`
- [Property model](https://github.com/nhem-seyha/rental-property-management/blob/main/property-room/models/Property.js): `property-room/models/Property.js`
- [Room management](https://github.com/nhem-seyha/rental-property-management/blob/main/property-room/routes/roomRoutes.js): `property-room/routes/roomRoutes.js`
- [Room model](https://github.com/nhem-seyha/rental-property-management/blob/main/property-room/models/Room.js): `property-room/models/Room.js`

### Rentals and payments

- [Rental management](https://github.com/nhem-seyha/rental-property-management/blob/main/rental-payment/routes/rentalRoutes.js): `rental-payment/routes/rentalRoutes.js`
- [Rental model](https://github.com/nhem-seyha/rental-property-management/blob/main/rental-payment/models/Rental.js): `rental-payment/models/Rental.js`
- [Payment management](https://github.com/nhem-seyha/rental-property-management/blob/main/rental-payment/routes/paymentRoutes.js): `rental-payment/routes/paymentRoutes.js`
- [Payment model](https://github.com/nhem-seyha/rental-property-management/blob/main/rental-payment/models/Payment.js): `rental-payment/models/Payment.js`

### Other components

- **API clients**
- **MongoDB**

## Connections

- API clients → Gateway routing: send requests (evidence: `gateway/routes/gatewayRoutes.js`)
- Gateway routing → JWT authorization: verify and authorize (evidence: `gateway/routes/gatewayRoutes.js`)
- Gateway routing → User registration: proxy registration (evidence: `gateway/routes/gatewayRoutes.js`)
- Gateway routing → Login and tokens: proxy login (evidence: `gateway/routes/gatewayRoutes.js`)
- Gateway routing → Property management: proxy property and room (evidence: `gateway/routes/gatewayRoutes.js`)
- Gateway routing → Rental management: proxy rentals (evidence: `gateway/routes/gatewayRoutes.js`)
- Gateway routing → Payment management: proxy payments (evidence: `gateway/routes/gatewayRoutes.js`)
- User registration → Registration user model: query and save (evidence: `registration/routes/userRoutes.js`)
- Login and tokens → Login user model: find account (evidence: `login/routes/authRoutes.js`)
- Property management → Property model: query and save (evidence: `property-room/routes/propertyRoutes.js`)
- Room management → Room model: query and save (evidence: `property-room/routes/roomRoutes.js`)
- Rental management → Rental model: query and save (evidence: `rental-payment/routes/rentalRoutes.js`)
- Payment management → Payment model: query and save (evidence: `rental-payment/routes/paymentRoutes.js`)
- Property management → MongoDB: persist through service
- Room management → MongoDB: persist through service
- Rental management → MongoDB: persist through service
- Payment management → MongoDB: persist through service
