# max-out-00/househive architecture

> Architecture diagram of the GitHub repository max-out-00/househive, 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/max-out-00/househive
- Repository: https://github.com/max-out-00/househive

## Overview

HouseHive is a rental marketplace: visitors browse properties, inspect details, and authenticated users can create listings or book stays; users can also view booking activity on a dashboard. The React client calls an Express API, whose route handlers use PostgreSQL for users, listings, images, and bookings. Image uploads are handled separately through Multer and stored under the uploads directory. The README documents overlap prevention and the reviews schema; review routes are not implemented. Edges reflect excerpts, SOURCE INDEX references, or README statements; unsampled internals are not inferred.

Main entry points: [`src/App.jsx`](https://github.com/max-out-00/househive/blob/main/src/App.jsx) (React router), [`src/api/axiosInstance.js`](https://github.com/max-out-00/househive/blob/main/src/api/axiosInstance.js) (API client), [`backend/db/pool.js`](https://github.com/max-out-00/househive/blob/main/backend/db/pool.js) (Postgres pool), [`backend/routes/propertyRoutes.js`](https://github.com/max-out-00/househive/blob/main/backend/routes/propertyRoutes.js) (Property routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["React router<br/>[App.jsx]"]
  node_home["Home browse<br/>[Home.jsx]"]
  node_listings["Property listings<br/>[Listings.jsx]"]
  node_details["Property details"]
  node_create["Create listing<br/>[CreateListing.jsx]"]
  node_dashboard["Bookings dashboard<br/>[Dashboard.jsx]"]
  node_propertycard["Property card<br/>[PropertyCard.jsx]"]
  node_http["API client<br/>[axiosInstance.js]"]
end

subgraph group_identity["Identity and access"]
  node_authstate["Auth state<br/>[AuthContext.jsx]"]
  node_authpages["Login and signup<br/>[Login.jsx]"]
  node_guard["Protected routes<br/>[ProtectedRoute.jsx]"]
  node_useroutes["User routes<br/>[userRoutes.js]"]
  node_userctrl["User registration<br/>[userController.js]"]
  node_loginctrl["Login and tokens<br/>[authController.js]"]
  node_encrypt["Password helper<br/>[encrpt.js]"]
  node_authmw["JWT verification<br/>[authMiddleware.js]"]
end

subgraph group_marketplace["Listings and bookings"]
  node_propertyroutes["Property routes<br/>[propertyRoutes.js]"]
  node_propertyctrl["Property operations"]
  node_upload["Image upload<br/>[upload.js]"]
  node_bookingroutes["Booking routes<br/>[bookingRoutes.js]"]
  node_bookingctrl["Booking operations"]
  node_images[("Uploaded images")]
end

subgraph group_service["API and persistence"]
  node_server["Express server<br/>[server.js]"]
  node_pool["Postgres pool<br/>[pool.js]"]
  node_database[("Rental data<br/>[schema.sql]")]
end

node_visitor(("Renter or host"))

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_listings
node_app -->|"routes to"| node_details
node_app -->|"guards and routes"| node_create
node_app -->|"guards and routes"| node_dashboard
node_listings -->|"renders"| node_propertycard
node_home -.->|"browses"| node_listings
node_app -->|"routes to"| node_authpages
node_app -->|"wraps"| node_guard
node_guard -->|"checks"| node_authstate
node_authpages -->|"updates"| node_authstate
node_authpages -->|"requests"| node_http
node_create -->|"requests"| node_http
node_listings -->|"requests"| node_http
node_details -->|"requests"| node_http
node_dashboard -->|"requests"| node_http
node_http -->|"calls API"| node_server
node_server -->|"mounts"| node_useroutes
node_server -->|"mounts"| node_propertyroutes
node_server -->|"mounts"| node_bookingroutes
node_useroutes -->|"dispatches"| node_userctrl
node_useroutes -->|"dispatches"| node_loginctrl
node_userctrl -->|"imports helper"| node_encrypt
node_userctrl -->|"queries"| node_pool
node_loginctrl -->|"queries"| node_pool
node_propertyroutes -->|"dispatches"| node_propertyctrl
node_propertyroutes -->|"protects"| node_authmw
node_propertyroutes -->|"processes files"| node_upload
node_propertyctrl -->|"queries"| node_pool
node_propertyctrl -->|"records file paths"| node_images
node_bookingroutes -->|"dispatches"| node_bookingctrl
node_bookingroutes -->|"protects"| node_authmw
node_bookingctrl -->|"checks and writes"| node_pool
node_pool -.->|"connects to"| node_database

click node_app "https://github.com/max-out-00/househive/blob/main/src/App.jsx"
click node_home "https://github.com/max-out-00/househive/blob/main/src/pages/Home.jsx"
click node_listings "https://github.com/max-out-00/househive/blob/main/src/pages/Listings.jsx"
click node_details "https://github.com/max-out-00/househive/blob/main/src/pages/PropertyDetails.jsx"
click node_create "https://github.com/max-out-00/househive/blob/main/src/pages/CreateListing.jsx"
click node_dashboard "https://github.com/max-out-00/househive/blob/main/src/pages/Dashboard.jsx"
click node_propertycard "https://github.com/max-out-00/househive/blob/main/src/components/PropertyCard.jsx"
click node_authstate "https://github.com/max-out-00/househive/blob/main/src/context/AuthContext.jsx"
click node_authpages "https://github.com/max-out-00/househive/blob/main/src/pages/Login.jsx"
click node_guard "https://github.com/max-out-00/househive/blob/main/src/components/ProtectedRoute.jsx"
click node_http "https://github.com/max-out-00/househive/blob/main/src/api/axiosInstance.js"
click node_server "https://github.com/max-out-00/househive/blob/main/backend/server.js"
click node_useroutes "https://github.com/max-out-00/househive/blob/main/backend/routes/userRoutes.js"
click node_userctrl "https://github.com/max-out-00/househive/blob/main/backend/controllers/userController.js"
click node_loginctrl "https://github.com/max-out-00/househive/blob/main/backend/controllers/authController.js"
click node_encrypt "https://github.com/max-out-00/househive/blob/main/backend/controllers/encrpt.js"
click node_authmw "https://github.com/max-out-00/househive/blob/main/backend/middleware/authMiddleware.js"
click node_propertyroutes "https://github.com/max-out-00/househive/blob/main/backend/routes/propertyRoutes.js"
click node_propertyctrl "https://github.com/max-out-00/househive/blob/main/backend/controllers/propertyController.js"
click node_upload "https://github.com/max-out-00/househive/blob/main/backend/middleware/upload.js"
click node_bookingroutes "https://github.com/max-out-00/househive/blob/main/backend/routes/bookingRoutes.js"
click node_bookingctrl "https://github.com/max-out-00/househive/blob/main/backend/controllers/bookingController.js"
click node_pool "https://github.com/max-out-00/househive/blob/main/backend/db/pool.js"
click node_database "https://github.com/max-out-00/househive/blob/main/backend/schema.sql"
click node_images "https://github.com/max-out-00/househive/tree/main/backend/uploads"

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_listings,node_details,node_create,node_dashboard,node_propertycard,node_http toneBlue
class node_authstate,node_authpages,node_guard,node_useroutes,node_userctrl,node_loginctrl,node_encrypt,node_authmw toneAmber
class node_propertyroutes,node_propertyctrl,node_upload,node_bookingroutes,node_bookingctrl,node_images toneMint
class node_server,node_pool,node_database toneRose
class node_visitor toneIndigo
```

## Components

### Web client

- [React router](https://github.com/max-out-00/househive/blob/main/src/App.jsx): `src/App.jsx`
- [Home browse](https://github.com/max-out-00/househive/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Property listings](https://github.com/max-out-00/househive/blob/main/src/pages/Listings.jsx): `src/pages/Listings.jsx`
- [Property details](https://github.com/max-out-00/househive/blob/main/src/pages/PropertyDetails.jsx): `src/pages/PropertyDetails.jsx`
- [Create listing](https://github.com/max-out-00/househive/blob/main/src/pages/CreateListing.jsx): `src/pages/CreateListing.jsx`
- [Bookings dashboard](https://github.com/max-out-00/househive/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Property card](https://github.com/max-out-00/househive/blob/main/src/components/PropertyCard.jsx): `src/components/PropertyCard.jsx`
- [API client](https://github.com/max-out-00/househive/blob/main/src/api/axiosInstance.js): `src/api/axiosInstance.js`

### Identity and access

- [Auth state](https://github.com/max-out-00/househive/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Login and signup](https://github.com/max-out-00/househive/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Protected routes](https://github.com/max-out-00/househive/blob/main/src/components/ProtectedRoute.jsx): `src/components/ProtectedRoute.jsx`
- [User routes](https://github.com/max-out-00/househive/blob/main/backend/routes/userRoutes.js): `backend/routes/userRoutes.js`
- [User registration](https://github.com/max-out-00/househive/blob/main/backend/controllers/userController.js): `backend/controllers/userController.js`
- [Login and tokens](https://github.com/max-out-00/househive/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Password helper](https://github.com/max-out-00/househive/blob/main/backend/controllers/encrpt.js): `backend/controllers/encrpt.js`
- [JWT verification](https://github.com/max-out-00/househive/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### Listings and bookings

- [Property routes](https://github.com/max-out-00/househive/blob/main/backend/routes/propertyRoutes.js): `backend/routes/propertyRoutes.js`
- [Property operations](https://github.com/max-out-00/househive/blob/main/backend/controllers/propertyController.js): `backend/controllers/propertyController.js`
- [Image upload](https://github.com/max-out-00/househive/blob/main/backend/middleware/upload.js): `backend/middleware/upload.js`
- [Booking routes](https://github.com/max-out-00/househive/blob/main/backend/routes/bookingRoutes.js): `backend/routes/bookingRoutes.js`
- [Booking operations](https://github.com/max-out-00/househive/blob/main/backend/controllers/bookingController.js): `backend/controllers/bookingController.js`
- [Uploaded images](https://github.com/max-out-00/househive/tree/main/backend/uploads): `backend/uploads`

### API and persistence

- [Express server](https://github.com/max-out-00/househive/blob/main/backend/server.js): `backend/server.js`
- [Postgres pool](https://github.com/max-out-00/househive/blob/main/backend/db/pool.js): `backend/db/pool.js`
- [Rental data](https://github.com/max-out-00/househive/blob/main/backend/schema.sql): `backend/schema.sql`

### Other components

- **Renter or host**

## Connections

- Renter or host → React router: uses (evidence: `src/App.jsx`)
- React router → Home browse: routes to (evidence: `src/App.jsx`)
- React router → Property listings: routes to (evidence: `src/App.jsx`)
- React router → Property details: routes to (evidence: `src/App.jsx`)
- React router → Create listing: guards and routes (evidence: `src/App.jsx`)
- React router → Bookings dashboard: guards and routes (evidence: `src/App.jsx`)
- Property listings → Property card: renders (evidence: `src/pages/Listings.jsx`)
- Home browse → Property listings: browses
- React router → Login and signup: routes to (evidence: `src/App.jsx`)
- React router → Protected routes: wraps (evidence: `src/App.jsx`)
- Protected routes → Auth state: checks (evidence: `src/components/ProtectedRoute.jsx`)
- Login and signup → Auth state: updates (evidence: `src/pages/Login.jsx`)
- Login and signup → API client: requests (evidence: `src/pages/Login.jsx`)
- Create listing → API client: requests (evidence: `src/pages/CreateListing.jsx`)
- Property listings → API client: requests (evidence: `src/pages/Listings.jsx`)
- Property details → API client: requests (evidence: `src/pages/PropertyDetails.jsx`)
- Bookings dashboard → API client: requests (evidence: `src/pages/Dashboard.jsx`)
- API client → Express server: calls API (evidence: `README.md`)
- Express server → User routes: mounts (evidence: `backend/server.js`)
- Express server → Property routes: mounts (evidence: `backend/server.js`)
- Express server → Booking routes: mounts (evidence: `backend/server.js`)
- User routes → User registration: dispatches (evidence: `backend/routes/userRoutes.js`)
- User routes → Login and tokens: dispatches (evidence: `backend/routes/userRoutes.js`)
- User registration → Password helper: imports helper (evidence: `backend/controllers/userController.js`)
- User registration → Postgres pool: queries (evidence: `backend/controllers/userController.js`)
- Login and tokens → Postgres pool: queries (evidence: `backend/controllers/authController.js`)
- Property routes → Property operations: dispatches (evidence: `backend/routes/propertyRoutes.js`)
- Property routes → JWT verification: protects (evidence: `backend/routes/propertyRoutes.js`)
- Property routes → Image upload: processes files (evidence: `backend/routes/propertyRoutes.js`)
- Property operations → Postgres pool: queries (evidence: `backend/controllers/propertyController.js`)
- Property operations → Uploaded images: records file paths (evidence: `backend/controllers/propertyController.js`)
- Booking routes → Booking operations: dispatches (evidence: `backend/routes/bookingRoutes.js`)
- Booking routes → JWT verification: protects (evidence: `backend/routes/bookingRoutes.js`)
- Booking operations → Postgres pool: checks and writes (evidence: `backend/controllers/bookingController.js`)
- Postgres pool → Rental data: connects to
