# priyanshu655/hotel-booking-site architecture

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

- Interactive diagram: https://gitdiagram.com/priyanshu655/hotel-booking-site
- Repository: https://github.com/priyanshu655/hotel-booking-site

## Overview

Planora is a hotel-booking and travel-planning application. Users browse hotels, view details, book stays, and pay; hotel sellers can add listings and review analytics. A separate trip-planning workflow generates and saves itineraries. The frontend exposes these flows as pages and the Express backend routes requests to controllers and MongoDB models. The README gives no architectural detail, and several source excerpts are partial, so frontend-to-backend links are shown as unverified rather than asserted.

Main entry points: [`frontned/src/App.jsx`](https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/App.jsx) (Page router), [`backend/routes/hotelRoutes.js`](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/routes/hotelRoutes.js) (Hotel routes), [`backend/server.js`](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/server.js) (Express server), [`backend/controllers/tripController.js`](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/controllers/tripController.js) (Itinerary generation and trips)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_webapp["Page router<br/>[App.jsx]"]
  node_home["Hotel discovery<br/>[HomePage.jsx]"]
  node_detail["Hotel details<br/>[HotelDetail.jsx]"]
  node_bookings_ui["My bookings<br/>[MyBookings.jsx]"]
  node_auth_ui["Sign in<br/>[AuthPage.jsx]"]
  node_listing_ui["Add hotel<br/>[AddHotel.jsx]"]
  node_analytics_ui["Seller dashboard"]
  node_payment_ui["Payment demo<br/>[PaymentDemo.jsx]"]
  node_planner_ui["Trip planner<br/>[TripPlanner.jsx]"]
end

subgraph group_api["Backend API"]
  node_api_entry["Express server<br/>[server.js]"]
  node_auth_routes["Auth routes<br/>[authRoutes.js]"]
  node_auth_logic["Authentication<br/>[authController.js]"]
  node_auth_store[("User records<br/>[User.js]")]
end

subgraph group_stay["Stays and payments"]
  node_hotel_routes["Hotel routes<br/>[hotelRoutes.js]"]
  node_hotel_logic["Hotel catalog and seller ops<br/>[hotelController.js]"]
  node_hotel_store[("Hotel records<br/>[Hotel.js]")]
  node_booking_routes["Booking routes<br/>[bookingRoutes.js]"]
  node_booking_logic["Booking operations"]
  node_booking_store[("Booking records<br/>[Booking.js]")]
  node_payment_routes["Payment routes<br/>[paymentRoutes.js]"]
  node_payment_logic["Payment processing"]
  node_payment_store[("Payment records<br/>[Payment.js]")]
end

subgraph group_travel["Trip planning"]
  node_trip_routes["Trip routes<br/>[tripRoutes.js]"]
  node_trip_logic["Itinerary generation and trips<br/>[tripController.js]"]
  node_trip_store[("Saved trips<br/>[Trip.js]")]
  node_places[("Place catalog<br/>[placesDB.js]")]
end

node_traveler(("Traveler"))
node_seller(("Hotel seller"))
node_razorpay["Razorpay"]
node_osm["OpenStreetMap"]
node_bytez["Bytez AI"]

node_webapp -->|"routes to"| node_home
node_webapp -->|"routes to"| node_detail
node_webapp -->|"routes to"| node_bookings_ui
node_webapp -->|"routes to"| node_auth_ui
node_webapp -->|"routes to"| node_listing_ui
node_webapp -->|"routes to"| node_analytics_ui
node_webapp -->|"routes to"| node_payment_ui
node_webapp -->|"routes to"| node_planner_ui
node_traveler -.->|"browses"| node_home
node_traveler -.->|"signs in"| node_auth_ui
node_traveler -.->|"plans trips"| node_planner_ui
node_seller -.->|"manages listings"| node_listing_ui
node_seller -.->|"reviews metrics"| node_analytics_ui
node_home -.->|"requests catalog"| node_hotel_routes
node_detail -.->|"requests details"| node_hotel_routes
node_bookings_ui -.->|"manages bookings"| node_booking_routes
node_listing_ui -.->|"manages hotels"| node_hotel_routes
node_analytics_ui -.->|"requests analytics"| node_hotel_routes
node_payment_ui -.->|"requests payment"| node_payment_routes
node_planner_ui -.->|"requests itineraries"| node_trip_routes
node_api_entry -->|"mounts"| node_auth_routes
node_api_entry -->|"mounts"| node_hotel_routes
node_api_entry -->|"mounts"| node_booking_routes
node_api_entry -->|"mounts"| node_payment_routes
node_api_entry -->|"mounts"| node_trip_routes
node_auth_routes -->|"dispatches"| node_auth_logic
node_hotel_routes -->|"dispatches"| node_hotel_logic
node_booking_routes -->|"dispatches"| node_booking_logic
node_payment_routes -->|"dispatches"| node_payment_logic
node_trip_routes -->|"dispatches"| node_trip_logic
node_auth_logic -->|"reads and writes"| node_auth_store
node_hotel_logic -->|"reads and writes"| node_hotel_store
node_hotel_logic -->|"reads bookings"| node_booking_store
node_booking_logic -->|"reads and writes"| node_booking_store
node_booking_logic -->|"reads hotels"| node_hotel_store
node_payment_logic -->|"updates booking"| node_booking_store
node_payment_logic -->|"reads and writes"| node_payment_store
node_payment_logic -->|"creates orders and refunds"| node_razorpay
node_trip_logic -->|"reads and writes"| node_trip_store
node_trip_logic -->|"looks up places"| node_places
node_trip_logic -->|"geocodes and fetches POIs"| node_osm
node_trip_logic -->|"enhances itinerary"| node_bytez

click node_webapp "https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/App.jsx"
click node_home "https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/HomePage.jsx"
click node_detail "https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/HotelDetail.jsx"
click node_bookings_ui "https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/MyBookings.jsx"
click node_auth_ui "https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/AuthPage.jsx"
click node_listing_ui "https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/AddHotel.jsx"
click node_analytics_ui "https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/SellerDashboard.jsx"
click node_payment_ui "https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/PaymentDemo.jsx"
click node_planner_ui "https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/TripPlanner.jsx"
click node_api_entry "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/server.js"
click node_auth_routes "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/routes/authRoutes.js"
click node_auth_logic "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/controllers/authController.js"
click node_auth_store "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/models/User.js"
click node_hotel_routes "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/routes/hotelRoutes.js"
click node_hotel_logic "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/controllers/hotelController.js"
click node_hotel_store "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/models/Hotel.js"
click node_booking_routes "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/routes/bookingRoutes.js"
click node_booking_logic "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/controllers/bookingController.js"
click node_booking_store "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/models/Booking.js"
click node_payment_routes "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/routes/paymentRoutes.js"
click node_payment_logic "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/controllers/paymentController.js"
click node_payment_store "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/models/Payment.js"
click node_trip_routes "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/routes/tripRoutes.js"
click node_trip_logic "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/controllers/tripController.js"
click node_trip_store "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/models/Trip.js"
click node_places "https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/data/placesDB.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_webapp,node_home,node_detail,node_bookings_ui,node_auth_ui,node_listing_ui,node_analytics_ui,node_payment_ui,node_planner_ui toneBlue
class node_api_entry,node_auth_routes,node_auth_logic,node_auth_store toneAmber
class node_hotel_routes,node_hotel_logic,node_hotel_store,node_booking_routes,node_booking_logic,node_booking_store,node_payment_routes,node_payment_logic,node_payment_store toneMint
class node_trip_routes,node_trip_logic,node_trip_store,node_places toneRose
class node_traveler,node_seller,node_razorpay,node_osm,node_bytez toneIndigo
```

## Components

### Web experience

- [Page router](https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/App.jsx): `frontned/src/App.jsx`
- [Hotel discovery](https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/HomePage.jsx): `frontned/src/pages/HomePage.jsx`
- [Hotel details](https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/HotelDetail.jsx): `frontned/src/pages/HotelDetail.jsx`
- [My bookings](https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/MyBookings.jsx): `frontned/src/pages/MyBookings.jsx`
- [Sign in](https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/AuthPage.jsx): `frontned/src/pages/AuthPage.jsx`
- [Add hotel](https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/AddHotel.jsx): `frontned/src/pages/AddHotel.jsx`
- [Seller dashboard](https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/SellerDashboard.jsx): `frontned/src/pages/SellerDashboard.jsx`
- [Payment demo](https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/PaymentDemo.jsx): `frontned/src/pages/PaymentDemo.jsx`
- [Trip planner](https://github.com/priyanshu655/hotel-booking-site/blob/main/frontned/src/pages/TripPlanner.jsx): `frontned/src/pages/TripPlanner.jsx`

### Backend API

- [Express server](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/server.js): `backend/server.js`
- [Auth routes](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Authentication](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [User records](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/models/User.js): `backend/models/User.js`

### Stays and payments

- [Hotel routes](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/routes/hotelRoutes.js): `backend/routes/hotelRoutes.js`
- [Hotel catalog and seller ops](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/controllers/hotelController.js): `backend/controllers/hotelController.js`
- [Hotel records](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/models/Hotel.js): `backend/models/Hotel.js`
- [Booking routes](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/routes/bookingRoutes.js): `backend/routes/bookingRoutes.js`
- [Booking operations](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/controllers/bookingController.js): `backend/controllers/bookingController.js`
- [Booking records](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/models/Booking.js): `backend/models/Booking.js`
- [Payment routes](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/routes/paymentRoutes.js): `backend/routes/paymentRoutes.js`
- [Payment processing](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/controllers/paymentController.js): `backend/controllers/paymentController.js`
- [Payment records](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/models/Payment.js): `backend/models/Payment.js`

### Trip planning

- [Trip routes](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/routes/tripRoutes.js): `backend/routes/tripRoutes.js`
- [Itinerary generation and trips](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/controllers/tripController.js): `backend/controllers/tripController.js`
- [Saved trips](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/models/Trip.js): `backend/models/Trip.js`
- [Place catalog](https://github.com/priyanshu655/hotel-booking-site/blob/main/backend/data/placesDB.js): `backend/data/placesDB.js`

### Other components

- **Traveler**
- **Hotel seller**
- **Razorpay**
- **OpenStreetMap**
- **Bytez AI**

## Connections

- Page router → Hotel discovery: routes to (evidence: `frontned/src/App.jsx`)
- Page router → Hotel details: routes to (evidence: `frontned/src/App.jsx`)
- Page router → My bookings: routes to (evidence: `frontned/src/App.jsx`)
- Page router → Sign in: routes to (evidence: `frontned/src/App.jsx`)
- Page router → Add hotel: routes to (evidence: `frontned/src/App.jsx`)
- Page router → Seller dashboard: routes to (evidence: `frontned/src/App.jsx`)
- Page router → Payment demo: routes to (evidence: `frontned/src/App.jsx`)
- Page router → Trip planner: routes to (evidence: `frontned/src/App.jsx`)
- Traveler → Hotel discovery: browses
- Traveler → Sign in: signs in
- Traveler → Trip planner: plans trips
- Hotel seller → Add hotel: manages listings
- Hotel seller → Seller dashboard: reviews metrics
- Hotel discovery → Hotel routes: requests catalog
- Hotel details → Hotel routes: requests details
- My bookings → Booking routes: manages bookings
- Add hotel → Hotel routes: manages hotels
- Seller dashboard → Hotel routes: requests analytics
- Payment demo → Payment routes: requests payment
- Trip planner → Trip routes: requests itineraries
- Express server → Auth routes: mounts (evidence: `backend/server.js`)
- Express server → Hotel routes: mounts (evidence: `backend/server.js`)
- Express server → Booking routes: mounts (evidence: `backend/server.js`)
- Express server → Payment routes: mounts (evidence: `backend/server.js`)
- Express server → Trip routes: mounts (evidence: `backend/server.js`)
- Auth routes → Authentication: dispatches (evidence: `backend/routes/authRoutes.js`)
- Hotel routes → Hotel catalog and seller ops: dispatches (evidence: `backend/routes/hotelRoutes.js`)
- Booking routes → Booking operations: dispatches (evidence: `backend/routes/bookingRoutes.js`)
- Payment routes → Payment processing: dispatches (evidence: `backend/routes/paymentRoutes.js`)
- Trip routes → Itinerary generation and trips: dispatches (evidence: `backend/routes/tripRoutes.js`)
- Authentication → User records: reads and writes (evidence: `backend/controllers/authController.js`)
- Hotel catalog and seller ops → Hotel records: reads and writes (evidence: `backend/controllers/hotelController.js`)
- Hotel catalog and seller ops → Booking records: reads bookings (evidence: `backend/controllers/hotelController.js`)
- Booking operations → Booking records: reads and writes (evidence: `backend/controllers/bookingController.js`)
- Booking operations → Hotel records: reads hotels (evidence: `backend/controllers/bookingController.js`)
- Payment processing → Booking records: updates booking (evidence: `backend/controllers/paymentController.js`)
- Payment processing → Payment records: reads and writes (evidence: `backend/controllers/paymentController.js`)
- Payment processing → Razorpay: creates orders and refunds (evidence: `backend/controllers/paymentController.js`)
- Itinerary generation and trips → Saved trips: reads and writes (evidence: `backend/controllers/tripController.js`)
- Itinerary generation and trips → Place catalog: looks up places (evidence: `backend/controllers/tripController.js`)
- Itinerary generation and trips → OpenStreetMap: geocodes and fetches POIs (evidence: `backend/controllers/tripController.js`)
- Itinerary generation and trips → Bytez AI: enhances itinerary (evidence: `backend/controllers/tripController.js`)
