# roydhirj19/project architecture

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

- Interactive diagram: https://gitdiagram.com/roydhirj19/project
- Repository: https://github.com/roydhirj19/project

## Overview

Hotel Booking App serves guests browsing properties and making date-based reservations, while owners manage listings and confirm bookings. The main flow runs from listing routes and controllers through listing data and views, then into booking validation, availability checks, persistence, and reservation views. Reviews and account access are separate user-facing branches; listing maps provide a location view. The README documents OAuth, contact details, and other capabilities not fully represented in the sampled source, so those subsystem links are shown only where supported.

Main entry points: [`app.js`](https://github.com/roydhirj19/project/blob/main/app.js) (Express application), [`controller/booking.js`](https://github.com/roydhirj19/project/blob/main/controller/booking.js) (Booking controller), [`controller/listing.js`](https://github.com/roydhirj19/project/blob/main/controller/listing.js) (Listing controller), [`controller/reviews.js`](https://github.com/roydhirj19/project/blob/main/controller/reviews.js) (Review controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry and views"]
  node_app["Express application<br/>[app.js]"]
  node_listing_routes["Listing routes<br/>[listing.js]"]
  node_listing_views["Listing pages"]
  node_booking_routes["Booking routes<br/>[booking.js]"]
  node_booking_views["Booking pages"]
  node_user_routes["Account routes<br/>[user.js]"]
  node_user_views["Account pages"]
end

subgraph group_listings["Property listings"]
  node_listing_controller["Listing controller<br/>[listing.js]"]
  node_listing_model["Listing model<br/>[listing.js]"]
  node_map_client["Map client<br/>[map.js]"]
end

subgraph group_booking["Reservations"]
  node_booking_controller["Booking controller<br/>[booking.js]"]
  node_booking_model["Booking model<br/>[booking.js]"]
end

subgraph group_accounts["Accounts and reviews"]
  node_review_routes["Review routes<br/>[review.js]"]
  node_review_controller["Review controller<br/>[reviews.js]"]
  node_review_model["Review model<br/>[review.js]"]
  node_user_model["User model<br/>[user.js]"]
end

subgraph group_infra["Persistence and location"]
  node_session_store["Session store<br/>[app.js]"]
  node_mongo[("MongoDB")]
  node_maptiler["MapTiler"]
end

node_guest(("Guest or owner"))

node_guest -->|"sends requests"| node_app
node_app -->|"mounts routes"| node_listing_routes
node_app -->|"mounts routes"| node_booking_routes
node_app -->|"mounts routes"| node_user_routes
node_app -->|"mounts routes"| node_review_routes
node_listing_routes -->|"dispatches"| node_listing_controller
node_listing_controller -->|"reads and writes"| node_listing_model
node_listing_controller -->|"renders"| node_listing_views
node_listing_views -.->|"initializes map"| node_map_client
node_map_client -.->|"renders with"| node_maptiler
node_booking_routes -->|"dispatches"| node_booking_controller
node_booking_controller -->|"reads listing"| node_listing_model
node_booking_controller -->|"checks and saves"| node_booking_model
node_booking_controller -->|"renders"| node_booking_views
node_review_routes -->|"dispatches"| node_review_controller
node_review_controller -->|"updates listing"| node_listing_model
node_review_controller -->|"saves and deletes"| node_review_model
node_user_routes -->|"serves account pages"| node_user_views
node_app -->|"authenticates users"| node_user_model
node_app -->|"stores sessions"| node_session_store
node_app -->|"connects"| node_mongo
node_session_store -->|"persists sessions"| node_mongo
node_booking_controller -->|"populates customer"| node_user_model

click node_app "https://github.com/roydhirj19/project/blob/main/app.js"
click node_listing_routes "https://github.com/roydhirj19/project/blob/main/routes/listing.js"
click node_listing_views "https://github.com/roydhirj19/project/tree/main/views/listing"
click node_booking_routes "https://github.com/roydhirj19/project/blob/main/routes/booking.js"
click node_booking_views "https://github.com/roydhirj19/project/tree/main/views/booking"
click node_user_routes "https://github.com/roydhirj19/project/blob/main/routes/user.js"
click node_user_views "https://github.com/roydhirj19/project/tree/main/views/users"
click node_listing_controller "https://github.com/roydhirj19/project/blob/main/controller/listing.js"
click node_listing_model "https://github.com/roydhirj19/project/blob/main/models/listing.js"
click node_map_client "https://github.com/roydhirj19/project/blob/main/public/js/map.js"
click node_booking_controller "https://github.com/roydhirj19/project/blob/main/controller/booking.js"
click node_booking_model "https://github.com/roydhirj19/project/blob/main/models/booking.js"
click node_review_routes "https://github.com/roydhirj19/project/blob/main/routes/review.js"
click node_review_controller "https://github.com/roydhirj19/project/blob/main/controller/reviews.js"
click node_review_model "https://github.com/roydhirj19/project/blob/main/models/review.js"
click node_user_model "https://github.com/roydhirj19/project/blob/main/models/user.js"
click node_session_store "https://github.com/roydhirj19/project/blob/main/app.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_listing_routes,node_listing_views,node_booking_routes,node_booking_views,node_user_routes,node_user_views toneBlue
class node_listing_controller,node_listing_model,node_map_client toneAmber
class node_booking_controller,node_booking_model toneMint
class node_review_routes,node_review_controller,node_review_model,node_user_model toneRose
class node_session_store,node_mongo,node_maptiler,node_guest toneIndigo
```

## Components

### Web entry and views

- [Express application](https://github.com/roydhirj19/project/blob/main/app.js): `app.js`
- [Listing routes](https://github.com/roydhirj19/project/blob/main/routes/listing.js): `routes/listing.js`
- [Listing pages](https://github.com/roydhirj19/project/tree/main/views/listing): `views/listing`
- [Booking routes](https://github.com/roydhirj19/project/blob/main/routes/booking.js): `routes/booking.js`
- [Booking pages](https://github.com/roydhirj19/project/tree/main/views/booking): `views/booking`
- [Account routes](https://github.com/roydhirj19/project/blob/main/routes/user.js): `routes/user.js`
- [Account pages](https://github.com/roydhirj19/project/tree/main/views/users): `views/users`

### Property listings

- [Listing controller](https://github.com/roydhirj19/project/blob/main/controller/listing.js): `controller/listing.js`
- [Listing model](https://github.com/roydhirj19/project/blob/main/models/listing.js): `models/listing.js`
- [Map client](https://github.com/roydhirj19/project/blob/main/public/js/map.js): `public/js/map.js`

### Reservations

- [Booking controller](https://github.com/roydhirj19/project/blob/main/controller/booking.js): `controller/booking.js`
- [Booking model](https://github.com/roydhirj19/project/blob/main/models/booking.js): `models/booking.js`

### Accounts and reviews

- [Review routes](https://github.com/roydhirj19/project/blob/main/routes/review.js): `routes/review.js`
- [Review controller](https://github.com/roydhirj19/project/blob/main/controller/reviews.js): `controller/reviews.js`
- [Review model](https://github.com/roydhirj19/project/blob/main/models/review.js): `models/review.js`
- [User model](https://github.com/roydhirj19/project/blob/main/models/user.js): `models/user.js`

### Persistence and location

- [Session store](https://github.com/roydhirj19/project/blob/main/app.js): `app.js`
- **MongoDB**
- **MapTiler**

### Other components

- **Guest or owner**

## Connections

- Guest or owner → Express application: sends requests
- Express application → Listing routes: mounts routes
- Express application → Booking routes: mounts routes
- Express application → Account routes: mounts routes
- Express application → Review routes: mounts routes
- Listing routes → Listing controller: dispatches
- Listing controller → Listing model: reads and writes
- Listing controller → Listing pages: renders
- Listing pages → Map client: initializes map
- Map client → MapTiler: renders with
- Booking routes → Booking controller: dispatches
- Booking controller → Listing model: reads listing
- Booking controller → Booking model: checks and saves
- Booking controller → Booking pages: renders
- Review routes → Review controller: dispatches
- Review controller → Listing model: updates listing
- Review controller → Review model: saves and deletes
- Account routes → Account pages: serves account pages
- Express application → User model: authenticates users
- Express application → Session store: stores sessions
- Express application → MongoDB: connects
- Session store → MongoDB: persists sessions
- Booking controller → User model: populates customer
