# hhari1234/househunt architecture

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

- Interactive diagram: https://gitdiagram.com/hhari1234/househunt
- Repository: https://github.com/hhari1234/househunt

## Overview

HouseHunt is a real-estate marketplace. Users browse and filter published homes, inspect listings, then sign in to save favorites, request bookings, manage listings and their account; administrators manage marketplace users, properties and bookings. The frontend routes those experiences to a versioned REST API, whose controllers delegate business operations to services and persistent MongoDB models. The README documents uploads and image storage as another capability. Some frontend page-to-API and route-to-controller wiring is not shown in the excerpts, so those links are omitted or marked unverified.

Main entry points: [`frontend/src/routes/AppRoutes.jsx`](https://github.com/hhari1234/househunt/blob/main/frontend/src/routes/AppRoutes.jsx) (Page routing), [`backend/routes/api.v1/index.v1.js`](https://github.com/hhari1234/househunt/blob/main/backend/routes/api.v1/index.v1.js) (Versioned routes), [`backend/controllers/admin.controller.js`](https://github.com/hhari1234/househunt/blob/main/backend/controllers/admin.controller.js) (Admin handlers), [`backend/services/property.service.js`](https://github.com/hhari1234/househunt/blob/main/backend/services/property.service.js) (Property search and lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Marketplace frontend"]
  node_app["React application<br/>[App.js]"]
  node_routing["Page routing<br/>[AppRoutes.jsx]"]
  node_discovery["Home and explore<br/>[ExplorePage.jsx]"]
  node_listing_detail["Listing details<br/>[ListingDetails.jsx]"]
  node_auth_ui["Sign-in and registration<br/>[useAuth.js]"]
  node_listing_create["Create listing<br/>[CreateListing.jsx]"]
  node_favorites_ui["Saved homes<br/>[FavoritesPage.jsx]"]
  node_bookings_ui["Bookings<br/>[BookingsPage.jsx]"]
  node_account_ui["Account<br/>[AccountPage.jsx]"]
  node_admin_ui["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["REST API"]
  node_api_server["API server<br/>[server.js]"]
  node_api_routes["Versioned routes<br/>[index.v1.js]"]
  node_auth_controller["Authentication handlers<br/>[auth.controller.js]"]
  node_admin_controller["Admin handlers"]
  node_property_controller["Property handlers"]
  node_booking_controller["Booking handlers"]
  node_favorites_controller["Favorites handlers"]
  node_users_controller["User handlers<br/>[user.controller.js]"]
end

subgraph group_domain["Marketplace services"]
  node_auth_service["Auth and profile<br/>[auth.service.js]"]
  node_property_service["Property search and lifecycle"]
  node_booking_service["Booking operations<br/>[booking.service.js]"]
  node_favorites_service["Favorite operations"]
  node_user_service["User administration<br/>[user.service.js]"]
end

subgraph group_persistence["Persistence and media"]
  node_mongo[("MongoDB<br/>[database.js]")]
  node_property_model[("Property records<br/>[Property.js]")]
  node_booking_model[("Booking records<br/>[Booking.js]")]
  node_favorite_model[("Favorite records<br/>[Favorite.js]")]
  node_user_model[("User records<br/>[User.js]")]
  node_image_store[("Uploaded listing photos<br/>[image.store.js]")]
end

node_visitor(("Visitor or member"))

node_visitor -->|"uses"| node_app
node_app -->|"renders"| node_routing
node_routing -->|"routes to"| node_discovery
node_routing -->|"routes to"| node_listing_detail
node_routing -->|"uses auth"| node_auth_ui
node_routing -->|"routes to"| node_listing_create
node_routing -->|"routes to"| node_favorites_ui
node_routing -->|"routes to"| node_bookings_ui
node_routing -->|"routes to"| node_account_ui
node_routing -->|"routes to"| node_admin_ui
node_auth_ui -->|"calls"| node_api_client
node_api_server -->|"connects"| node_mongo
node_api_server -->|"mounts"| node_api_routes
node_api_server -->|"reads images"| node_image_store
node_api_routes -->|"dispatches"| node_auth_controller
node_api_routes -.->|"dispatches"| node_property_controller
node_api_routes -.->|"dispatches"| node_booking_controller
node_api_routes -.->|"dispatches"| node_favorites_controller
node_api_routes -.->|"dispatches"| node_admin_controller
node_api_routes -.->|"dispatches"| node_users_controller
node_auth_controller -->|"delegates"| node_auth_service
node_admin_controller -->|"queries"| node_property_service
node_admin_controller -->|"queries"| node_booking_service
node_admin_controller -->|"queries"| node_user_service
node_property_controller -->|"delegates"| node_property_service
node_booking_controller -->|"delegates"| node_booking_service
node_favorites_controller -->|"delegates"| node_favorites_service
node_auth_service -->|"reads and writes"| node_user_model
node_property_service -->|"queries"| node_property_model
node_property_service -->|"cleans bookings"| node_booking_model
node_booking_service -->|"reads and writes"| node_booking_model
node_booking_service -->|"checks listing"| node_property_model
node_favorites_service -->|"reads listings"| node_property_model
node_favorites_service -->|"reads and writes"| node_favorite_model
node_user_service -.->|"manages users"| node_user_model
node_admin_controller -->|"updates status"| node_property_model
node_admin_controller -->|"updates status"| node_user_model

click node_app "https://github.com/hhari1234/househunt/blob/main/frontend/src/App.js"
click node_routing "https://github.com/hhari1234/househunt/blob/main/frontend/src/routes/AppRoutes.jsx"
click node_discovery "https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/ExplorePage.jsx"
click node_listing_detail "https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/ListingDetails.jsx"
click node_auth_ui "https://github.com/hhari1234/househunt/blob/main/frontend/src/hooks/useAuth.js"
click node_listing_create "https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/CreateListing.jsx"
click node_favorites_ui "https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/FavoritesPage.jsx"
click node_bookings_ui "https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/BookingsPage.jsx"
click node_account_ui "https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/AccountPage.jsx"
click node_admin_ui "https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/AdminDashboard.jsx"
click node_api_client "https://github.com/hhari1234/househunt/blob/main/frontend/src/services/api.js"
click node_api_server "https://github.com/hhari1234/househunt/blob/main/backend/server.js"
click node_api_routes "https://github.com/hhari1234/househunt/blob/main/backend/routes/api.v1/index.v1.js"
click node_auth_controller "https://github.com/hhari1234/househunt/blob/main/backend/controllers/auth.controller.js"
click node_admin_controller "https://github.com/hhari1234/househunt/blob/main/backend/controllers/admin.controller.js"
click node_property_controller "https://github.com/hhari1234/househunt/blob/main/backend/controllers/property.controller.js"
click node_booking_controller "https://github.com/hhari1234/househunt/blob/main/backend/controllers/booking.controller.js"
click node_favorites_controller "https://github.com/hhari1234/househunt/blob/main/backend/controllers/favorites.controller.js"
click node_users_controller "https://github.com/hhari1234/househunt/blob/main/backend/controllers/user.controller.js"
click node_auth_service "https://github.com/hhari1234/househunt/blob/main/backend/services/auth.service.js"
click node_property_service "https://github.com/hhari1234/househunt/blob/main/backend/services/property.service.js"
click node_booking_service "https://github.com/hhari1234/househunt/blob/main/backend/services/booking.service.js"
click node_favorites_service "https://github.com/hhari1234/househunt/blob/main/backend/services/favorites.service.js"
click node_user_service "https://github.com/hhari1234/househunt/blob/main/backend/services/user.service.js"
click node_mongo "https://github.com/hhari1234/househunt/blob/main/backend/config/database.js"
click node_property_model "https://github.com/hhari1234/househunt/blob/main/backend/models/Property.js"
click node_booking_model "https://github.com/hhari1234/househunt/blob/main/backend/models/Booking.js"
click node_favorite_model "https://github.com/hhari1234/househunt/blob/main/backend/models/Favorite.js"
click node_user_model "https://github.com/hhari1234/househunt/blob/main/backend/models/User.js"
click node_image_store "https://github.com/hhari1234/househunt/blob/main/backend/services/image.store.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_app,node_routing,node_discovery,node_listing_detail,node_auth_ui,node_listing_create,node_favorites_ui,node_bookings_ui,node_account_ui,node_admin_ui,node_api_client toneBlue
class node_api_server,node_api_routes,node_auth_controller,node_admin_controller,node_property_controller,node_booking_controller,node_favorites_controller,node_users_controller toneAmber
class node_auth_service,node_property_service,node_booking_service,node_favorites_service,node_user_service toneMint
class node_mongo,node_property_model,node_booking_model,node_favorite_model,node_user_model,node_image_store toneRose
class node_visitor toneIndigo
```

## Components

### Marketplace frontend

- [React application](https://github.com/hhari1234/househunt/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Page routing](https://github.com/hhari1234/househunt/blob/main/frontend/src/routes/AppRoutes.jsx): `frontend/src/routes/AppRoutes.jsx`
- [Home and explore](https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/ExplorePage.jsx): `frontend/src/pages/ExplorePage.jsx`
- [Listing details](https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/ListingDetails.jsx): `frontend/src/pages/ListingDetails.jsx`
- [Sign-in and registration](https://github.com/hhari1234/househunt/blob/main/frontend/src/hooks/useAuth.js): `frontend/src/hooks/useAuth.js`
- [Create listing](https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/CreateListing.jsx): `frontend/src/pages/CreateListing.jsx`
- [Saved homes](https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/FavoritesPage.jsx): `frontend/src/pages/FavoritesPage.jsx`
- [Bookings](https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/BookingsPage.jsx): `frontend/src/pages/BookingsPage.jsx`
- [Account](https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/AccountPage.jsx): `frontend/src/pages/AccountPage.jsx`
- [Admin dashboard](https://github.com/hhari1234/househunt/blob/main/frontend/src/pages/AdminDashboard.jsx): `frontend/src/pages/AdminDashboard.jsx`
- [API client](https://github.com/hhari1234/househunt/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### REST API

- [API server](https://github.com/hhari1234/househunt/blob/main/backend/server.js): `backend/server.js`
- [Versioned routes](https://github.com/hhari1234/househunt/blob/main/backend/routes/api.v1/index.v1.js): `backend/routes/api.v1/index.v1.js`
- [Authentication handlers](https://github.com/hhari1234/househunt/blob/main/backend/controllers/auth.controller.js): `backend/controllers/auth.controller.js`
- [Admin handlers](https://github.com/hhari1234/househunt/blob/main/backend/controllers/admin.controller.js): `backend/controllers/admin.controller.js`
- [Property handlers](https://github.com/hhari1234/househunt/blob/main/backend/controllers/property.controller.js): `backend/controllers/property.controller.js`
- [Booking handlers](https://github.com/hhari1234/househunt/blob/main/backend/controllers/booking.controller.js): `backend/controllers/booking.controller.js`
- [Favorites handlers](https://github.com/hhari1234/househunt/blob/main/backend/controllers/favorites.controller.js): `backend/controllers/favorites.controller.js`
- [User handlers](https://github.com/hhari1234/househunt/blob/main/backend/controllers/user.controller.js): `backend/controllers/user.controller.js`

### Marketplace services

- [Auth and profile](https://github.com/hhari1234/househunt/blob/main/backend/services/auth.service.js): `backend/services/auth.service.js`
- [Property search and lifecycle](https://github.com/hhari1234/househunt/blob/main/backend/services/property.service.js): `backend/services/property.service.js`
- [Booking operations](https://github.com/hhari1234/househunt/blob/main/backend/services/booking.service.js): `backend/services/booking.service.js`
- [Favorite operations](https://github.com/hhari1234/househunt/blob/main/backend/services/favorites.service.js): `backend/services/favorites.service.js`
- [User administration](https://github.com/hhari1234/househunt/blob/main/backend/services/user.service.js): `backend/services/user.service.js`

### Persistence and media

- [MongoDB](https://github.com/hhari1234/househunt/blob/main/backend/config/database.js): `backend/config/database.js`
- [Property records](https://github.com/hhari1234/househunt/blob/main/backend/models/Property.js): `backend/models/Property.js`
- [Booking records](https://github.com/hhari1234/househunt/blob/main/backend/models/Booking.js): `backend/models/Booking.js`
- [Favorite records](https://github.com/hhari1234/househunt/blob/main/backend/models/Favorite.js): `backend/models/Favorite.js`
- [User records](https://github.com/hhari1234/househunt/blob/main/backend/models/User.js): `backend/models/User.js`
- [Uploaded listing photos](https://github.com/hhari1234/househunt/blob/main/backend/services/image.store.js): `backend/services/image.store.js`

### Other components

- **Visitor or member**

## Connections

- Visitor or member → React application: uses (evidence: `README.md`)
- React application → Page routing: renders (evidence: `frontend/src/App.js`)
- Page routing → Home and explore: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routing → Listing details: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routing → Sign-in and registration: uses auth (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routing → Create listing: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routing → Saved homes: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routing → Bookings: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routing → Account: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routing → Admin dashboard: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Sign-in and registration → API client: calls (evidence: `frontend/src/hooks/useAuth.js`)
- API server → MongoDB: connects (evidence: `backend/server.js`)
- API server → Versioned routes: mounts (evidence: `backend/server.js`)
- API server → Uploaded listing photos: reads images (evidence: `backend/server.js`)
- Versioned routes → Authentication handlers: dispatches
- Versioned routes → Property handlers: dispatches
- Versioned routes → Booking handlers: dispatches
- Versioned routes → Favorites handlers: dispatches
- Versioned routes → Admin handlers: dispatches
- Versioned routes → User handlers: dispatches
- Authentication handlers → Auth and profile: delegates (evidence: `backend/controllers/auth.controller.js`)
- Admin handlers → Property search and lifecycle: queries (evidence: `backend/controllers/admin.controller.js`)
- Admin handlers → Booking operations: queries (evidence: `backend/controllers/admin.controller.js`)
- Admin handlers → User administration: queries (evidence: `backend/controllers/admin.controller.js`)
- Property handlers → Property search and lifecycle: delegates (evidence: `backend/controllers/property.controller.js`)
- Booking handlers → Booking operations: delegates (evidence: `backend/controllers/booking.controller.js`)
- Favorites handlers → Favorite operations: delegates (evidence: `backend/controllers/favorites.controller.js`)
- Auth and profile → User records: reads and writes (evidence: `backend/services/auth.service.js`)
- Property search and lifecycle → Property records: queries (evidence: `backend/services/property.service.js`)
- Property search and lifecycle → Booking records: cleans bookings (evidence: `backend/services/property.service.js`)
- Booking operations → Booking records: reads and writes (evidence: `backend/services/booking.service.js`)
- Booking operations → Property records: checks listing (evidence: `backend/services/booking.service.js`)
- Favorite operations → Property records: reads listings (evidence: `backend/services/favorites.service.js`)
- Favorite operations → Favorite records: reads and writes (evidence: `backend/services/favorites.service.js`)
- User administration → User records: manages users
- Admin handlers → Property records: updates status (evidence: `backend/controllers/admin.controller.js`)
- Admin handlers → User records: updates status (evidence: `backend/controllers/admin.controller.js`)
