# amrsayed0/rental-system architecture

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

- Interactive diagram: https://gitdiagram.com/amrsayed0/rental-system
- Repository: https://github.com/amrsayed0/rental-system

## Overview

This is a rental listings and property-management application. Renters browse and filter geolocated listings, inspect a property, submit an application, and manage favorites and residences; managers create listings and review applications. Express routes dispatch to controllers, which persist domain records through Prisma. The README also documents authentication, geospatial search, and image storage. Frontend API wiring and several backend modules were not excerpted, so those links are shown only where documented or left unasserted.

Main entry points: [`server/src/index.ts`](https://github.com/amrsayed0/rental-system/blob/main/server/src/index.ts) (Express API), [`client/src/app/(nondashboard)/search/page.tsx`](https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/page.tsx) (Listing search), [`server/src/controllers/propertyControllers.ts`](https://github.com/amrsayed0/rental-system/blob/main/server/src/controllers/propertyControllers.ts) (Property operations), [`server/src/routes/propertyRoutes.ts`](https://github.com/amrsayed0/rental-system/blob/main/server/src/routes/propertyRoutes.ts) (Property routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Listing discovery"]
  node_landing["Landing page<br/>[page.tsx]"]
  node_search["Listing search<br/>[page.tsx]"]
  node_filters["Search filters<br/>[FiltersFull.tsx]"]
  node_map["Listing map<br/>[Map.tsx]"]
  node_results["Listing results<br/>[Listings.tsx]"]
  node_propertyview["Property details"]
  node_applicationmodal["Application form"]
end

subgraph group_clientdash["User dashboards"]
  node_tenantdash["Tenant dashboard<br/>[page.tsx]"]
  node_managerdash["Manager dashboard<br/>[page.tsx]"]
  node_auth["Authentication<br/>[authProvider.tsx]"]
end

subgraph group_api["Backend API"]
  node_apiroot["Express API<br/>[index.ts]"]
  node_authmw["Role authorization<br/>[authMiddleware.ts]"]
  node_propertyroutes["Property routes<br/>[propertyRoutes.ts]"]
  node_applicationroutes["Application routes"]
  node_tenantroutes["Tenant routes<br/>[tenantRoutes.ts]"]
  node_leaseroutes["Lease routes<br/>[leaseRoutes.ts]"]
end

subgraph group_domain["Rental domain"]
  node_propertyctl["Property operations"]
  node_applicationctl["Application operations"]
  node_tenantctl["Tenant operations"]
  node_managerctl["Manager operations"]
  node_leasectl["Lease operations"]
  node_database[("PostgreSQL/PostGIS")]
  node_s3[("AWS S3")]
  node_geocoder["Nominatim geocoder"]
end

node_renter(("Renter"))
node_manager(("Property manager"))

node_renter -->|"views"| node_landing
node_renter -.->|"searches"| node_search
node_manager -.->|"manages listings"| node_managerdash
node_search -->|"renders"| node_filters
node_search -->|"renders"| node_map
node_search -->|"renders"| node_results
node_results -.->|"opens details"| node_propertyview
node_propertyview -.->|"offers application"| node_applicationmodal
node_search -.->|"requests listings"| node_apiroot
node_applicationmodal -.->|"submits application"| node_apiroot
node_tenantdash -.->|"loads account data"| node_apiroot
node_managerdash -.->|"updates listings"| node_apiroot
node_apiroot -->|"mounts routes"| node_propertyroutes
node_apiroot -->|"mounts routes"| node_applicationroutes
node_apiroot -->|"mounts routes"| node_tenantroutes
node_apiroot -->|"mounts routes"| node_leaseroutes
node_propertyroutes -->|"guards creation"| node_authmw
node_applicationroutes -->|"guards endpoints"| node_authmw
node_leaseroutes -->|"guards endpoints"| node_authmw
node_propertyroutes -->|"dispatches"| node_propertyctl
node_applicationroutes -->|"dispatches"| node_applicationctl
node_tenantroutes -->|"dispatches"| node_tenantctl
node_leaseroutes -->|"dispatches"| node_leasectl
node_propertyctl -.->|"queries and writes"| node_database
node_applicationctl -.->|"reads and writes"| node_database
node_tenantctl -.->|"reads and writes"| node_database
node_managerctl -.->|"reads and writes"| node_database
node_leasectl -.->|"reads and writes"| node_database
node_propertyctl -->|"uploads photos"| node_s3
node_propertyctl -->|"geocodes address"| node_geocoder
node_propertyctl -.->|"manager listing capability"| node_managerctl

click node_landing "https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/landing/page.tsx"
click node_search "https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/page.tsx"
click node_filters "https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/FiltersFull.tsx"
click node_map "https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/Map.tsx"
click node_results "https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/Listings.tsx"
click node_propertyview "https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/%5Bid%5D/PropertyOverview.tsx"
click node_applicationmodal "https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/%5Bid%5D/ApplicationModal.tsx"
click node_tenantdash "https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(dashboard)/tenants/residences/page.tsx"
click node_managerdash "https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(dashboard)/managers/properties/page.tsx"
click node_auth "https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(auth)/authProvider.tsx"
click node_apiroot "https://github.com/amrsayed0/rental-system/blob/main/server/src/index.ts"
click node_authmw "https://github.com/amrsayed0/rental-system/blob/main/server/src/middleware/authMiddleware.ts"
click node_propertyroutes "https://github.com/amrsayed0/rental-system/blob/main/server/src/routes/propertyRoutes.ts"
click node_applicationroutes "https://github.com/amrsayed0/rental-system/blob/main/server/src/routes/applicationRoutes.ts"
click node_tenantroutes "https://github.com/amrsayed0/rental-system/blob/main/server/src/routes/tenantRoutes.ts"
click node_leaseroutes "https://github.com/amrsayed0/rental-system/blob/main/server/src/routes/leaseRoutes.ts"
click node_propertyctl "https://github.com/amrsayed0/rental-system/blob/main/server/src/controllers/propertyControllers.ts"
click node_applicationctl "https://github.com/amrsayed0/rental-system/blob/main/server/src/controllers/applicationControllers.ts"
click node_tenantctl "https://github.com/amrsayed0/rental-system/blob/main/server/src/controllers/tenantControllers.ts"
click node_managerctl "https://github.com/amrsayed0/rental-system/blob/main/server/src/controllers/managerControllers.ts"
click node_leasectl "https://github.com/amrsayed0/rental-system/blob/main/server/src/controllers/leaseControllers.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_landing,node_search,node_filters,node_map,node_results,node_propertyview,node_applicationmodal toneBlue
class node_tenantdash,node_managerdash,node_auth toneAmber
class node_apiroot,node_authmw,node_propertyroutes,node_applicationroutes,node_tenantroutes,node_leaseroutes toneMint
class node_propertyctl,node_applicationctl,node_tenantctl,node_managerctl,node_leasectl,node_database,node_s3,node_geocoder toneRose
class node_renter,node_manager toneIndigo
```

## Components

### Listing discovery

- [Landing page](https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/landing/page.tsx): `client/src/app/(nondashboard)/landing/page.tsx`
- [Listing search](https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/page.tsx): `client/src/app/(nondashboard)/search/page.tsx`
- [Search filters](https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/FiltersFull.tsx): `client/src/app/(nondashboard)/search/FiltersFull.tsx`
- [Listing map](https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/Map.tsx): `client/src/app/(nondashboard)/search/Map.tsx`
- [Listing results](https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/Listings.tsx): `client/src/app/(nondashboard)/search/Listings.tsx`
- [Property details](https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/%5Bid%5D/PropertyOverview.tsx): `client/src/app/(nondashboard)/search/[id]/PropertyOverview.tsx`
- [Application form](https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(nondashboard)/search/%5Bid%5D/ApplicationModal.tsx): `client/src/app/(nondashboard)/search/[id]/ApplicationModal.tsx`

### User dashboards

- [Tenant dashboard](https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(dashboard)/tenants/residences/page.tsx): `client/src/app/(dashboard)/tenants/residences/page.tsx`
- [Manager dashboard](https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(dashboard)/managers/properties/page.tsx): `client/src/app/(dashboard)/managers/properties/page.tsx`
- [Authentication](https://github.com/amrsayed0/rental-system/blob/main/client/src/app/(auth)/authProvider.tsx): `client/src/app/(auth)/authProvider.tsx`

### Backend API

- [Express API](https://github.com/amrsayed0/rental-system/blob/main/server/src/index.ts): `server/src/index.ts`
- [Role authorization](https://github.com/amrsayed0/rental-system/blob/main/server/src/middleware/authMiddleware.ts): `server/src/middleware/authMiddleware.ts`
- [Property routes](https://github.com/amrsayed0/rental-system/blob/main/server/src/routes/propertyRoutes.ts): `server/src/routes/propertyRoutes.ts`
- [Application routes](https://github.com/amrsayed0/rental-system/blob/main/server/src/routes/applicationRoutes.ts): `server/src/routes/applicationRoutes.ts`
- [Tenant routes](https://github.com/amrsayed0/rental-system/blob/main/server/src/routes/tenantRoutes.ts): `server/src/routes/tenantRoutes.ts`
- [Lease routes](https://github.com/amrsayed0/rental-system/blob/main/server/src/routes/leaseRoutes.ts): `server/src/routes/leaseRoutes.ts`

### Rental domain

- [Property operations](https://github.com/amrsayed0/rental-system/blob/main/server/src/controllers/propertyControllers.ts): `server/src/controllers/propertyControllers.ts`
- [Application operations](https://github.com/amrsayed0/rental-system/blob/main/server/src/controllers/applicationControllers.ts): `server/src/controllers/applicationControllers.ts`
- [Tenant operations](https://github.com/amrsayed0/rental-system/blob/main/server/src/controllers/tenantControllers.ts): `server/src/controllers/tenantControllers.ts`
- [Manager operations](https://github.com/amrsayed0/rental-system/blob/main/server/src/controllers/managerControllers.ts): `server/src/controllers/managerControllers.ts`
- [Lease operations](https://github.com/amrsayed0/rental-system/blob/main/server/src/controllers/leaseControllers.ts): `server/src/controllers/leaseControllers.ts`
- **PostgreSQL/PostGIS**
- **AWS S3**
- **Nominatim geocoder**

### Other components

- **Renter**
- **Property manager**

## Connections

- Renter → Landing page: views
- Renter → Listing search: searches (evidence: `README.md`)
- Property manager → Manager dashboard: manages listings (evidence: `README.md`)
- Listing search → Search filters: renders (evidence: `client/src/app/(nondashboard)/search/page.tsx`)
- Listing search → Listing map: renders (evidence: `client/src/app/(nondashboard)/search/page.tsx`)
- Listing search → Listing results: renders (evidence: `client/src/app/(nondashboard)/search/page.tsx`)
- Listing results → Property details: opens details
- Property details → Application form: offers application
- Listing search → Express API: requests listings (evidence: `README.md`)
- Application form → Express API: submits application (evidence: `README.md`)
- Tenant dashboard → Express API: loads account data
- Manager dashboard → Express API: updates listings
- Express API → Property routes: mounts routes (evidence: `server/src/index.ts`)
- Express API → Application routes: mounts routes (evidence: `server/src/index.ts`)
- Express API → Tenant routes: mounts routes (evidence: `server/src/index.ts`)
- Express API → Lease routes: mounts routes (evidence: `server/src/index.ts`)
- Property routes → Role authorization: guards creation (evidence: `server/src/routes/propertyRoutes.ts`)
- Application routes → Role authorization: guards endpoints (evidence: `server/src/routes/applicationRoutes.ts`)
- Lease routes → Role authorization: guards endpoints (evidence: `server/src/routes/leaseRoutes.ts`)
- Property routes → Property operations: dispatches (evidence: `server/src/routes/propertyRoutes.ts`)
- Application routes → Application operations: dispatches (evidence: `server/src/routes/applicationRoutes.ts`)
- Tenant routes → Tenant operations: dispatches (evidence: `server/src/routes/tenantRoutes.ts`)
- Lease routes → Lease operations: dispatches (evidence: `server/src/routes/leaseRoutes.ts`)
- Property operations → PostgreSQL/PostGIS: queries and writes
- Application operations → PostgreSQL/PostGIS: reads and writes
- Tenant operations → PostgreSQL/PostGIS: reads and writes
- Manager operations → PostgreSQL/PostGIS: reads and writes
- Lease operations → PostgreSQL/PostGIS: reads and writes
- Property operations → AWS S3: uploads photos (evidence: `server/src/controllers/propertyControllers.ts`)
- Property operations → Nominatim geocoder: geocodes address (evidence: `server/src/controllers/propertyControllers.ts`)
- Property operations → Manager operations: manager listing capability
