# devag04/full-stack-estate-app architecture

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

- Interactive diagram: https://gitdiagram.com/devag04/full-stack-estate-app
- Repository: https://github.com/devag04/full-stack-estate-app

## Overview

This is a buyer/seller real-estate application. Users enter through role-specific static pages; buyers browse/search listings, manage favourites and message sellers, while sellers manage property listings. The Express API handles authentication and domain requests, with MongoDB for users/properties and PostgreSQL for chat history; Socket.IO provides live chat and Cloudinary handles listing images. The client-to-API wiring and several backend internals were not excerpted, so those relationships are omitted or marked unverified.

Main entry points: [`Server/routes/buyer.routes.js`](https://github.com/devag04/full-stack-estate-app/blob/main/Server/routes/buyer.routes.js) (Buyer routes), [`Server/routes/seller.routes.js`](https://github.com/devag04/full-stack-estate-app/blob/main/Server/routes/seller.routes.js) (Seller routes), [`Client/buyer`](https://github.com/devag04/full-stack-estate-app/tree/main/Client/buyer) (Buyer pages), [`Server/app.js`](https://github.com/devag04/full-stack-estate-app/blob/main/Server/app.js) (Express app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Static clients"]
  node_buyer["Buyer pages"]
  node_seller["Seller pages"]
  node_client_util["Client utilities"]
  node_client_api["API client config<br/>[api.js]"]
end

subgraph group_api["HTTP API"]
  node_http["Express app<br/>[app.js]"]
  node_buyer_routes["Buyer routes<br/>[buyer.routes.js]"]
  node_seller_routes["Seller routes<br/>[seller.routes.js]"]
  node_auth["Session guards<br/>[auth.js]"]
  node_validation["Request validation<br/>[validate.js]"]
end

subgraph group_domain["Domain services"]
  node_buyer_auth["Buyer accounts"]
  node_seller_auth["Seller accounts"]
  node_property["Property workflow"]
  node_messages["Message history API"]
end

subgraph group_persistence["Persistence and media"]
  node_buyer_model["Buyer records<br/>[buyer.model.js]"]
  node_seller_model["Seller records<br/>[seller.model.js]"]
  node_property_model["Property records<br/>[property.model.js]"]
  node_mongo[("MongoDB<br/>[mongo.js]")]
  node_postgres[("PostgreSQL<br/>[postgres.js]")]
  node_upload["Image upload<br/>[upload.js]"]
  node_cloudinary["Cloudinary<br/>[cloudinary.js]"]
end

subgraph group_realtime["Realtime chat"]
  node_socket["Socket.IO chat<br/>[index.js]"]
end

node_buyer_actor(("Buyer"))
node_seller_actor(("Seller"))

node_http -->|"mounts"| node_buyer_routes
node_http -->|"mounts"| node_seller_routes
node_http -->|"attaches"| node_socket
node_http -->|"connects at startup"| node_mongo
node_buyer_routes -->|"dispatches"| node_buyer_auth
node_buyer_routes -->|"dispatches"| node_property
node_buyer_routes -->|"dispatches"| node_messages
node_seller_routes -->|"dispatches"| node_seller_auth
node_seller_routes -->|"dispatches"| node_property
node_buyer_routes -->|"guards dashboard"| node_auth
node_seller_routes -->|"guards dashboard"| node_auth
node_buyer_routes -->|"validates signup/login"| node_validation
node_seller_routes -->|"validates signup/login"| node_validation
node_buyer_auth -->|"reads/writes"| node_buyer_model
node_seller_auth -->|"reads/writes"| node_seller_model
node_property -->|"queries listings"| node_property_model
node_property -->|"updates favourites"| node_buyer_model
node_buyer_model -->|"uses connection"| node_mongo
node_seller_model -->|"uses connection"| node_mongo
node_property_model -->|"uses connection"| node_mongo
node_seller_routes -->|"uploads listing images"| node_upload
node_upload -->|"stores images"| node_cloudinary
node_socket -->|"reads/writes chat"| node_postgres
node_messages -->|"queries history"| node_postgres
node_buyer_actor -->|"uses"| node_buyer
node_seller_actor -->|"uses"| node_seller
node_buyer -->|"uses chat/property helpers"| node_client_util
node_buyer -->|"uses chat helpers"| node_client_util
node_buyer -->|"uses property helper"| node_client_util
node_buyer -.->|"API wiring unverified"| node_client_api
node_seller -.->|"API wiring unverified"| node_client_api
node_client_api -.->|"HTTP requests unverified"| node_http

click node_buyer "https://github.com/devag04/full-stack-estate-app/tree/main/Client/buyer"
click node_seller "https://github.com/devag04/full-stack-estate-app/tree/main/Client/seller"
click node_client_util "https://github.com/devag04/full-stack-estate-app/tree/main/Client/utility"
click node_client_api "https://github.com/devag04/full-stack-estate-app/blob/main/Client/api.js"
click node_http "https://github.com/devag04/full-stack-estate-app/blob/main/Server/app.js"
click node_buyer_routes "https://github.com/devag04/full-stack-estate-app/blob/main/Server/routes/buyer.routes.js"
click node_seller_routes "https://github.com/devag04/full-stack-estate-app/blob/main/Server/routes/seller.routes.js"
click node_auth "https://github.com/devag04/full-stack-estate-app/blob/main/Server/middleware/auth.js"
click node_validation "https://github.com/devag04/full-stack-estate-app/blob/main/Server/middleware/validate.js"
click node_buyer_auth "https://github.com/devag04/full-stack-estate-app/blob/main/Server/controllers/buyer.controller.js"
click node_seller_auth "https://github.com/devag04/full-stack-estate-app/blob/main/Server/controllers/seller.controller.js"
click node_property "https://github.com/devag04/full-stack-estate-app/blob/main/Server/controllers/property.controller.js"
click node_messages "https://github.com/devag04/full-stack-estate-app/blob/main/Server/controllers/message.controller.js"
click node_buyer_model "https://github.com/devag04/full-stack-estate-app/blob/main/Server/models/buyer.model.js"
click node_seller_model "https://github.com/devag04/full-stack-estate-app/blob/main/Server/models/seller.model.js"
click node_property_model "https://github.com/devag04/full-stack-estate-app/blob/main/Server/models/property.model.js"
click node_mongo "https://github.com/devag04/full-stack-estate-app/blob/main/Server/db/mongo.js"
click node_postgres "https://github.com/devag04/full-stack-estate-app/blob/main/Server/db/postgres.js"
click node_upload "https://github.com/devag04/full-stack-estate-app/blob/main/Server/middleware/upload.js"
click node_cloudinary "https://github.com/devag04/full-stack-estate-app/blob/main/Server/config/cloudinary.js"
click node_socket "https://github.com/devag04/full-stack-estate-app/blob/main/Server/socket/index.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_buyer,node_seller,node_client_util,node_client_api toneBlue
class node_http,node_buyer_routes,node_seller_routes,node_auth,node_validation toneAmber
class node_buyer_auth,node_seller_auth,node_property,node_messages toneMint
class node_buyer_model,node_seller_model,node_property_model,node_mongo,node_postgres,node_upload,node_cloudinary toneRose
class node_socket,node_buyer_actor,node_seller_actor toneIndigo
```

## Components

### Static clients

- [Buyer pages](https://github.com/devag04/full-stack-estate-app/tree/main/Client/buyer): `Client/buyer`
- [Seller pages](https://github.com/devag04/full-stack-estate-app/tree/main/Client/seller): `Client/seller`
- [Client utilities](https://github.com/devag04/full-stack-estate-app/tree/main/Client/utility): `Client/utility`
- [API client config](https://github.com/devag04/full-stack-estate-app/blob/main/Client/api.js): `Client/api.js`

### HTTP API

- [Express app](https://github.com/devag04/full-stack-estate-app/blob/main/Server/app.js): `Server/app.js`
- [Buyer routes](https://github.com/devag04/full-stack-estate-app/blob/main/Server/routes/buyer.routes.js): `Server/routes/buyer.routes.js`
- [Seller routes](https://github.com/devag04/full-stack-estate-app/blob/main/Server/routes/seller.routes.js): `Server/routes/seller.routes.js`
- [Session guards](https://github.com/devag04/full-stack-estate-app/blob/main/Server/middleware/auth.js): `Server/middleware/auth.js`
- [Request validation](https://github.com/devag04/full-stack-estate-app/blob/main/Server/middleware/validate.js): `Server/middleware/validate.js`

### Domain services

- [Buyer accounts](https://github.com/devag04/full-stack-estate-app/blob/main/Server/controllers/buyer.controller.js): `Server/controllers/buyer.controller.js`
- [Seller accounts](https://github.com/devag04/full-stack-estate-app/blob/main/Server/controllers/seller.controller.js): `Server/controllers/seller.controller.js`
- [Property workflow](https://github.com/devag04/full-stack-estate-app/blob/main/Server/controllers/property.controller.js): `Server/controllers/property.controller.js`
- [Message history API](https://github.com/devag04/full-stack-estate-app/blob/main/Server/controllers/message.controller.js): `Server/controllers/message.controller.js`

### Persistence and media

- [Buyer records](https://github.com/devag04/full-stack-estate-app/blob/main/Server/models/buyer.model.js): `Server/models/buyer.model.js`
- [Seller records](https://github.com/devag04/full-stack-estate-app/blob/main/Server/models/seller.model.js): `Server/models/seller.model.js`
- [Property records](https://github.com/devag04/full-stack-estate-app/blob/main/Server/models/property.model.js): `Server/models/property.model.js`
- [MongoDB](https://github.com/devag04/full-stack-estate-app/blob/main/Server/db/mongo.js): `Server/db/mongo.js`
- [PostgreSQL](https://github.com/devag04/full-stack-estate-app/blob/main/Server/db/postgres.js): `Server/db/postgres.js`
- [Image upload](https://github.com/devag04/full-stack-estate-app/blob/main/Server/middleware/upload.js): `Server/middleware/upload.js`
- [Cloudinary](https://github.com/devag04/full-stack-estate-app/blob/main/Server/config/cloudinary.js): `Server/config/cloudinary.js`

### Realtime chat

- [Socket.IO chat](https://github.com/devag04/full-stack-estate-app/blob/main/Server/socket/index.js): `Server/socket/index.js`

### Other components

- **Buyer**
- **Seller**

## Connections

- Express app → Buyer routes: mounts (evidence: `Server/app.js`)
- Express app → Seller routes: mounts (evidence: `Server/app.js`)
- Express app → Socket.IO chat: attaches (evidence: `Server/app.js`)
- Express app → MongoDB: connects at startup (evidence: `Server/app.js`)
- Buyer routes → Buyer accounts: dispatches (evidence: `Server/routes/buyer.routes.js`)
- Buyer routes → Property workflow: dispatches (evidence: `Server/routes/buyer.routes.js`)
- Buyer routes → Message history API: dispatches (evidence: `Server/routes/buyer.routes.js`)
- Seller routes → Seller accounts: dispatches (evidence: `Server/routes/seller.routes.js`)
- Seller routes → Property workflow: dispatches (evidence: `Server/routes/seller.routes.js`)
- Buyer routes → Session guards: guards dashboard (evidence: `Server/routes/buyer.routes.js`)
- Seller routes → Session guards: guards dashboard (evidence: `Server/routes/seller.routes.js`)
- Buyer routes → Request validation: validates signup/login (evidence: `Server/routes/buyer.routes.js`)
- Seller routes → Request validation: validates signup/login (evidence: `Server/routes/seller.routes.js`)
- Buyer accounts → Buyer records: reads/writes (evidence: `Server/controllers/buyer.controller.js`)
- Seller accounts → Seller records: reads/writes (evidence: `Server/controllers/seller.controller.js`)
- Property workflow → Property records: queries listings (evidence: `Server/controllers/property.controller.js`)
- Property workflow → Buyer records: updates favourites (evidence: `Server/controllers/property.controller.js`)
- Buyer records → MongoDB: uses connection (evidence: `Server/models/buyer.model.js`)
- Seller records → MongoDB: uses connection (evidence: `Server/models/seller.model.js`)
- Property records → MongoDB: uses connection (evidence: `Server/models/property.model.js`)
- Seller routes → Image upload: uploads listing images (evidence: `Server/routes/seller.routes.js`)
- Image upload → Cloudinary: stores images (evidence: `Server/middleware/upload.js`)
- Socket.IO chat → PostgreSQL: reads/writes chat (evidence: `Server/socket/index.js`)
- Message history API → PostgreSQL: queries history (evidence: `Server/controllers/message.controller.js`)
- Buyer → Buyer pages: uses (evidence: `README.md`)
- Seller → Seller pages: uses (evidence: `README.md`)
- Buyer pages → Client utilities: uses chat/property helpers (evidence: `Client/buyer/dashboard.js`)
- Buyer pages → Client utilities: uses chat helpers (evidence: `Client/buyer/message.js`)
- Buyer pages → Client utilities: uses property helper (evidence: `Client/buyer/favourite.js`)
- Buyer pages → API client config: API wiring unverified
- Seller pages → API client config: API wiring unverified
- API client config → Express app: HTTP requests unverified
