# lendons765/nestfind_system architecture

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

- Interactive diagram: https://gitdiagram.com/lendons765/nestfind_system
- Repository: https://github.com/lendons765/nestfind_system

## Overview

NestFind is a rental marketplace for browsing listings, contacting owners, applying to rent, and managing listings, inquiries, and leases. The user-facing workflow runs through a routed React app; pages call client API modules, while the Express server mounts domain routes that query a PostgreSQL-backed pool. Authentication and email verification support tenant and owner workflows. The map includes major frontend and backend domains from the source index; some client-to-server links are omitted because the excerpts do not show their HTTP endpoint wiring.

Main entry points: [`src/index.ts`](https://github.com/lendons765/nestfind_system/blob/main/src/index.ts) (HTTP application), [`web/src/App.tsx`](https://github.com/lendons765/nestfind_system/blob/main/web/src/App.tsx) (App routing), [`src/routes/auth.ts`](https://github.com/lendons765/nestfind_system/blob/main/src/routes/auth.ts) (Account routes), [`web/src/pages/HomePage.tsx`](https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/HomePage.tsx) (Home browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Marketplace interface"]
  node_app["App routing<br/>[App.tsx]"]
  node_home["Home browsing<br/>[HomePage.tsx]"]
  node_browse["Listing search"]
  node_listingdetail["Listing details"]
  node_newlisting["Create listing<br/>[NewListingPage.tsx]"]
  node_ownerpages["Owner workspace"]
  node_tenantpages["Tenant portal"]
  node_leasepages["Lease workspace<br/>[LeasesPage.tsx]"]
  node_authpages["Login and verify<br/>[LoginPage.tsx]"]
  node_browseui["Browse section<br/>[BrowseSection.tsx]"]
end

subgraph group_clientdata["Client data and session"]
  node_authstate["Session context<br/>[AuthContext.tsx]"]
  node_listingapi["Listing client<br/>[listings.ts]"]
  node_ownerapi["Owner client<br/>[owner.ts]"]
  node_leasingapi["Leasing client<br/>[leasing.ts]"]
  node_tenantapi["Tenant client<br/>[tenant.ts]"]
  node_dashboardapi["Dashboard client<br/>[dashboard.ts]"]
end

subgraph group_server["Marketplace API"]
  node_server["HTTP application<br/>[index.ts]"]
  node_listingroutes["Listing routes<br/>[listings.ts]"]
  node_editingroutes["Listing editing<br/>[listingEditing.ts]"]
  node_leaseroutes["Applications and leases<br/>[leasing.ts]"]
  node_inquiryroutes["Inquiries<br/>[inquiries.ts]"]
  node_ownerroutes["Owner operations<br/>[owner.ts]"]
  node_ownerextras["Owner extras<br/>[ownerExtras.ts]"]
  node_tenantroutes["Tenant operations<br/>[tenant.ts]"]
  node_tenantextras["Tenant extras<br/>[tenantExtras.ts]"]
  node_dashboardroutes["Dashboard data<br/>[dashboard.ts]"]
  node_locationroutes["Locations<br/>[locations.ts]"]
  node_mediaroutes["Listing media<br/>[listingMedia.ts]"]
end

subgraph group_identity["Identity and email"]
  node_authroutes["Account routes<br/>[auth.ts]"]
  node_coderoutes["Verification codes<br/>[codes.ts]"]
  node_authcore["Token authorization<br/>[auth.ts]"]
  node_codes["Email code service<br/>[emailCodes.ts]"]
  node_mailer["Email delivery<br/>[mailer.ts]"]
end

subgraph group_storage["Persistence"]
end

node_renter(("Renters and owners"))

node_renter -.->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_browse
node_app -->|"routes to"| node_listingdetail
node_app -->|"routes to"| node_newlisting
node_app -->|"routes to"| node_ownerpages
node_app -->|"routes to"| node_tenantpages
node_app -->|"routes to"| node_leasepages
node_app -->|"routes to"| node_authpages
node_app -->|"provides session"| node_authstate
node_home -->|"renders"| node_browseui
node_browse -->|"queries"| node_listingapi
node_browseui -->|"queries"| node_listingapi
node_authstate -->|"supports"| node_authpages
node_authstate -->|"uses"| node_ownerapi
node_newlisting -->|"submits listing"| node_ownerapi
node_tenantpages -->|"loads leases"| node_leasingapi
node_tenantpages -->|"loads tenant data"| node_tenantapi
node_home -->|"loads dashboard"| node_dashboardapi
node_server -->|"mounts"| node_listingroutes
node_server -->|"mounts"| node_inquiryroutes
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_ownerroutes
node_server -->|"mounts"| node_locationroutes
node_server -->|"mounts"| node_editingroutes
node_server -->|"mounts"| node_mediaroutes
node_server -->|"mounts"| node_leaseroutes
node_server -->|"mounts"| node_tenantroutes
node_server -->|"mounts"| node_dashboardroutes
node_server -->|"mounts"| node_tenantextras
node_server -->|"mounts"| node_ownerextras
node_server -->|"mounts"| node_coderoutes
node_authroutes -->|"checks identity"| node_authcore
node_authroutes -->|"creates codes"| node_codes
node_authroutes -->|"sends email"| node_mailer
node_coderoutes -->|"uses codes"| node_codes
node_coderoutes -->|"sends email"| node_mailer
node_leaseroutes -->|"authorizes"| node_authcore

click node_app "https://github.com/lendons765/nestfind_system/blob/main/web/src/App.tsx"
click node_home "https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/HomePage.tsx"
click node_browse "https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/ListingSearchPage.tsx"
click node_listingdetail "https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/ListingDetailPage.tsx"
click node_newlisting "https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/NewListingPage.tsx"
click node_ownerpages "https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/OwnerDashboardPage.tsx"
click node_tenantpages "https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/TenantPortalPage.tsx"
click node_leasepages "https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/LeasesPage.tsx"
click node_authpages "https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/LoginPage.tsx"
click node_browseui "https://github.com/lendons765/nestfind_system/blob/main/web/src/components/BrowseSection.tsx"
click node_authstate "https://github.com/lendons765/nestfind_system/blob/main/web/src/auth/AuthContext.tsx"
click node_listingapi "https://github.com/lendons765/nestfind_system/blob/main/web/src/api/listings.ts"
click node_ownerapi "https://github.com/lendons765/nestfind_system/blob/main/web/src/api/owner.ts"
click node_leasingapi "https://github.com/lendons765/nestfind_system/blob/main/web/src/api/leasing.ts"
click node_tenantapi "https://github.com/lendons765/nestfind_system/blob/main/web/src/api/tenant.ts"
click node_dashboardapi "https://github.com/lendons765/nestfind_system/blob/main/web/src/api/dashboard.ts"
click node_server "https://github.com/lendons765/nestfind_system/blob/main/src/index.ts"
click node_listingroutes "https://github.com/lendons765/nestfind_system/blob/main/src/routes/listings.ts"
click node_editingroutes "https://github.com/lendons765/nestfind_system/blob/main/src/routes/listingEditing.ts"
click node_leaseroutes "https://github.com/lendons765/nestfind_system/blob/main/src/routes/leasing.ts"
click node_inquiryroutes "https://github.com/lendons765/nestfind_system/blob/main/src/routes/inquiries.ts"
click node_ownerroutes "https://github.com/lendons765/nestfind_system/blob/main/src/routes/owner.ts"
click node_ownerextras "https://github.com/lendons765/nestfind_system/blob/main/src/routes/ownerExtras.ts"
click node_tenantroutes "https://github.com/lendons765/nestfind_system/blob/main/src/routes/tenant.ts"
click node_tenantextras "https://github.com/lendons765/nestfind_system/blob/main/src/routes/tenantExtras.ts"
click node_dashboardroutes "https://github.com/lendons765/nestfind_system/blob/main/src/routes/dashboard.ts"
click node_locationroutes "https://github.com/lendons765/nestfind_system/blob/main/src/routes/locations.ts"
click node_mediaroutes "https://github.com/lendons765/nestfind_system/blob/main/src/routes/listingMedia.ts"
click node_authroutes "https://github.com/lendons765/nestfind_system/blob/main/src/routes/auth.ts"
click node_coderoutes "https://github.com/lendons765/nestfind_system/blob/main/src/routes/codes.ts"
click node_authcore "https://github.com/lendons765/nestfind_system/blob/main/src/auth.ts"
click node_codes "https://github.com/lendons765/nestfind_system/blob/main/src/emailCodes.ts"
click node_mailer "https://github.com/lendons765/nestfind_system/blob/main/src/mailer.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_app,node_home,node_browse,node_listingdetail,node_newlisting,node_ownerpages,node_tenantpages,node_leasepages,node_authpages,node_browseui toneBlue
class node_authstate,node_listingapi,node_ownerapi,node_leasingapi,node_tenantapi,node_dashboardapi toneAmber
class node_server,node_listingroutes,node_editingroutes,node_leaseroutes,node_inquiryroutes,node_ownerroutes,node_ownerextras,node_tenantroutes,node_tenantextras,node_dashboardroutes,node_locationroutes,node_mediaroutes toneMint
class node_authroutes,node_coderoutes,node_authcore,node_codes,node_mailer toneRose
class node_renter toneIndigo
```

## Components

### Marketplace interface

- [App routing](https://github.com/lendons765/nestfind_system/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Home browsing](https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/HomePage.tsx): `web/src/pages/HomePage.tsx`
- [Listing search](https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/ListingSearchPage.tsx): `web/src/pages/ListingSearchPage.tsx`
- [Listing details](https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/ListingDetailPage.tsx): `web/src/pages/ListingDetailPage.tsx`
- [Create listing](https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/NewListingPage.tsx): `web/src/pages/NewListingPage.tsx`
- [Owner workspace](https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/OwnerDashboardPage.tsx): `web/src/pages/OwnerDashboardPage.tsx`
- [Tenant portal](https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/TenantPortalPage.tsx): `web/src/pages/TenantPortalPage.tsx`
- [Lease workspace](https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/LeasesPage.tsx): `web/src/pages/LeasesPage.tsx`
- [Login and verify](https://github.com/lendons765/nestfind_system/blob/main/web/src/pages/LoginPage.tsx): `web/src/pages/LoginPage.tsx`
- [Browse section](https://github.com/lendons765/nestfind_system/blob/main/web/src/components/BrowseSection.tsx): `web/src/components/BrowseSection.tsx`

### Client data and session

- [Session context](https://github.com/lendons765/nestfind_system/blob/main/web/src/auth/AuthContext.tsx): `web/src/auth/AuthContext.tsx`
- [Listing client](https://github.com/lendons765/nestfind_system/blob/main/web/src/api/listings.ts): `web/src/api/listings.ts`
- [Owner client](https://github.com/lendons765/nestfind_system/blob/main/web/src/api/owner.ts): `web/src/api/owner.ts`
- [Leasing client](https://github.com/lendons765/nestfind_system/blob/main/web/src/api/leasing.ts): `web/src/api/leasing.ts`
- [Tenant client](https://github.com/lendons765/nestfind_system/blob/main/web/src/api/tenant.ts): `web/src/api/tenant.ts`
- [Dashboard client](https://github.com/lendons765/nestfind_system/blob/main/web/src/api/dashboard.ts): `web/src/api/dashboard.ts`

### Marketplace API

- [HTTP application](https://github.com/lendons765/nestfind_system/blob/main/src/index.ts): `src/index.ts`
- [Listing routes](https://github.com/lendons765/nestfind_system/blob/main/src/routes/listings.ts): `src/routes/listings.ts`
- [Listing editing](https://github.com/lendons765/nestfind_system/blob/main/src/routes/listingEditing.ts): `src/routes/listingEditing.ts`
- [Applications and leases](https://github.com/lendons765/nestfind_system/blob/main/src/routes/leasing.ts): `src/routes/leasing.ts`
- [Inquiries](https://github.com/lendons765/nestfind_system/blob/main/src/routes/inquiries.ts): `src/routes/inquiries.ts`
- [Owner operations](https://github.com/lendons765/nestfind_system/blob/main/src/routes/owner.ts): `src/routes/owner.ts`
- [Owner extras](https://github.com/lendons765/nestfind_system/blob/main/src/routes/ownerExtras.ts): `src/routes/ownerExtras.ts`
- [Tenant operations](https://github.com/lendons765/nestfind_system/blob/main/src/routes/tenant.ts): `src/routes/tenant.ts`
- [Tenant extras](https://github.com/lendons765/nestfind_system/blob/main/src/routes/tenantExtras.ts): `src/routes/tenantExtras.ts`
- [Dashboard data](https://github.com/lendons765/nestfind_system/blob/main/src/routes/dashboard.ts): `src/routes/dashboard.ts`
- [Locations](https://github.com/lendons765/nestfind_system/blob/main/src/routes/locations.ts): `src/routes/locations.ts`
- [Listing media](https://github.com/lendons765/nestfind_system/blob/main/src/routes/listingMedia.ts): `src/routes/listingMedia.ts`

### Identity and email

- [Account routes](https://github.com/lendons765/nestfind_system/blob/main/src/routes/auth.ts): `src/routes/auth.ts`
- [Verification codes](https://github.com/lendons765/nestfind_system/blob/main/src/routes/codes.ts): `src/routes/codes.ts`
- [Token authorization](https://github.com/lendons765/nestfind_system/blob/main/src/auth.ts): `src/auth.ts`
- [Email code service](https://github.com/lendons765/nestfind_system/blob/main/src/emailCodes.ts): `src/emailCodes.ts`
- [Email delivery](https://github.com/lendons765/nestfind_system/blob/main/src/mailer.ts): `src/mailer.ts`

### Other components

- **Renters and owners**

## Connections

- Renters and owners → App routing: uses
- App routing → Home browsing: routes to (evidence: `web/src/App.tsx`)
- App routing → Listing search: routes to (evidence: `web/src/App.tsx`)
- App routing → Listing details: routes to (evidence: `web/src/App.tsx`)
- App routing → Create listing: routes to (evidence: `web/src/App.tsx`)
- App routing → Owner workspace: routes to (evidence: `web/src/App.tsx`)
- App routing → Tenant portal: routes to (evidence: `web/src/App.tsx`)
- App routing → Lease workspace: routes to (evidence: `web/src/App.tsx`)
- App routing → Login and verify: routes to (evidence: `web/src/App.tsx`)
- App routing → Session context: provides session (evidence: `web/src/App.tsx`)
- Home browsing → Browse section: renders (evidence: `web/src/pages/HomePage.tsx`)
- Listing search → Listing client: queries (evidence: `web/src/pages/ListingSearchPage.tsx`)
- Browse section → Listing client: queries (evidence: `web/src/components/BrowseSection.tsx`)
- Session context → Login and verify: supports (evidence: `web/src/pages/LoginPage.tsx`)
- Session context → Owner client: uses (evidence: `web/src/pages/NewListingPage.tsx`)
- Create listing → Owner client: submits listing (evidence: `web/src/pages/NewListingPage.tsx`)
- Tenant portal → Leasing client: loads leases (evidence: `web/src/pages/TenantPortalPage.tsx`)
- Tenant portal → Tenant client: loads tenant data (evidence: `web/src/pages/TenantPortalPage.tsx`)
- Home browsing → Dashboard client: loads dashboard (evidence: `web/src/pages/HomePage.tsx`)
- HTTP application → Listing routes: mounts (evidence: `src/index.ts`)
- HTTP application → Inquiries: mounts (evidence: `src/index.ts`)
- HTTP application → Account routes: mounts (evidence: `src/index.ts`)
- HTTP application → Owner operations: mounts (evidence: `src/index.ts`)
- HTTP application → Locations: mounts (evidence: `src/index.ts`)
- HTTP application → Listing editing: mounts (evidence: `src/index.ts`)
- HTTP application → Listing media: mounts (evidence: `src/index.ts`)
- HTTP application → Applications and leases: mounts (evidence: `src/index.ts`)
- HTTP application → Tenant operations: mounts (evidence: `src/index.ts`)
- HTTP application → Dashboard data: mounts (evidence: `src/index.ts`)
- HTTP application → Tenant extras: mounts (evidence: `src/index.ts`)
- HTTP application → Owner extras: mounts (evidence: `src/index.ts`)
- HTTP application → Verification codes: mounts (evidence: `src/index.ts`)
- Account routes → Token authorization: checks identity (evidence: `src/routes/auth.ts`)
- Account routes → Email code service: creates codes (evidence: `src/routes/auth.ts`)
- Account routes → Email delivery: sends email (evidence: `src/routes/auth.ts`)
- Verification codes → Email code service: uses codes (evidence: `src/routes/codes.ts`)
- Verification codes → Email delivery: sends email (evidence: `src/routes/codes.ts`)
- Applications and leases → Token authorization: authorizes (evidence: `src/routes/leasing.ts`)
