# charankalicheti/hotel-room-booking-system architecture

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

- Interactive diagram: https://gitdiagram.com/charankalicheti/hotel-room-booking-system
- Repository: https://github.com/charankalicheti/hotel-room-booking-system

## Overview

This is a hotel-room booking system: customers find rooms, make reservations, and pay; staff administer rooms, bookings, walk-ins, payments, and reports. The frontend is a React client and the backend is a FastAPI application backed by an independently run RDS database. Sampled code confirms application startup and authentication/payment internals, but most routers and booking services were not sampled, so their internal call paths are not asserted.

Main entry points: [`Backend/app/main.py`](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/main.py) (FastAPI Startup), [`Frontend/src/api`](https://github.com/charankalicheti/hotel-room-booking-system/tree/main/Frontend/src/api) (Client API Calls), [`Frontend/src/pages`](https://github.com/charankalicheti/hotel-room-booking-system/tree/main/Frontend/src/pages) (Web Experience), [`Backend/app/services/payment_service.py`](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/services/payment_service.py) (Payment and Invoice Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer and Staff Client"]
  node_web["Web Experience"]
  node_routes["Client Routes<br/>[AppRoutes.jsx]"]
  node_authstate["Authentication State<br/>[AuthContext.jsx]"]
  node_clientapi["Client API Calls"]
end

subgraph group_api["HTTP Application"]
  node_app["FastAPI Startup<br/>[main.py]"]
  node_authrouter["Authentication Routes<br/>[auth.py]"]
  node_bookingrouter["Booking Routes<br/>[bookings.py]"]
  node_roomrouter["Room Routes<br/>[rooms.py]"]
  node_paymentrouter["Payment Routes<br/>[payments.py]"]
  node_opsrouters["Staff Operations Routes"]
end

subgraph group_domain["Booking and Operations"]
  node_authservice["Authentication Service<br/>[auth_service.py]"]
  node_bookingservice["Reservation Service<br/>[booking_service.py]"]
  node_roomservice["Room Availability Service<br/>[room_service.py]"]
  node_paymentservice["Payment and Invoice Service<br/>[payment_service.py]"]
  node_reportservice["Reports<br/>[report_service.py]"]
end

subgraph group_state["Persistence and Integrations"]
  node_models["Hotel Data Models"]
  node_database[("SQLAlchemy Database<br/>[database.py]")]
  node_paymentrepo["Payment Repository"]
end

node_customer(("Customer or Staff"))
node_rds[("RDS Database")]
node_gateway["Razorpay Gateway"]

node_customer -->|"uses"| node_web
node_web -.->|"navigates"| node_routes
node_routes -.->|"guards access"| node_authstate
node_authstate -->|"loads credentials"| node_clientapi
node_web -->|"requests rooms"| node_clientapi
node_clientapi -.->|"sends auth requests"| node_authrouter
node_clientapi -.->|"sends booking requests"| node_bookingrouter
node_clientapi -.->|"sends room requests"| node_roomrouter
node_clientapi -.->|"sends payment requests"| node_paymentrouter
node_app -->|"mounts router"| node_authrouter
node_app -->|"mounts router"| node_bookingrouter
node_app -->|"mounts router"| node_roomrouter
node_app -->|"mounts router"| node_paymentrouter
node_app -->|"mounts routers"| node_opsrouters
node_app -->|"creates tables"| node_database
node_app -->|"registers models"| node_models
node_authrouter -.->|"dispatches"| node_authservice
node_bookingrouter -.->|"dispatches"| node_bookingservice
node_roomrouter -.->|"dispatches"| node_roomservice
node_paymentrouter -.->|"dispatches"| node_paymentservice
node_paymentservice -->|"persists payments"| node_paymentrepo
node_paymentrepo -->|"queries payment model"| node_models
node_paymentservice -->|"creates gateway order"| node_gateway
node_database -.->|"connects"| node_rds
node_authservice -->|"creates customers"| node_models

click node_web "https://github.com/charankalicheti/hotel-room-booking-system/tree/main/Frontend/src/pages"
click node_routes "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Frontend/src/routes/AppRoutes.jsx"
click node_authstate "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Frontend/src/context/AuthContext.jsx"
click node_clientapi "https://github.com/charankalicheti/hotel-room-booking-system/tree/main/Frontend/src/api"
click node_app "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/main.py"
click node_authrouter "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/routers/auth.py"
click node_bookingrouter "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/routers/bookings.py"
click node_roomrouter "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/routers/rooms.py"
click node_paymentrouter "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/routers/payments.py"
click node_opsrouters "https://github.com/charankalicheti/hotel-room-booking-system/tree/main/Backend/app/routers"
click node_authservice "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/services/auth_service.py"
click node_bookingservice "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/services/booking_service.py"
click node_roomservice "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/services/room_service.py"
click node_paymentservice "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/services/payment_service.py"
click node_reportservice "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/services/report_service.py"
click node_models "https://github.com/charankalicheti/hotel-room-booking-system/tree/main/Backend/app/models"
click node_database "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/database.py"
click node_paymentrepo "https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/repositories/payment_repository.py"

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_web,node_routes,node_authstate,node_clientapi toneBlue
class node_app,node_authrouter,node_bookingrouter,node_roomrouter,node_paymentrouter,node_opsrouters,node_rds toneAmber
class node_authservice,node_bookingservice,node_roomservice,node_paymentservice,node_reportservice toneMint
class node_models,node_database,node_paymentrepo toneRose
class node_customer,node_gateway toneIndigo
```

## Components

### Customer and Staff Client

- [Web Experience](https://github.com/charankalicheti/hotel-room-booking-system/tree/main/Frontend/src/pages): `Frontend/src/pages`
- [Client Routes](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Frontend/src/routes/AppRoutes.jsx): `Frontend/src/routes/AppRoutes.jsx`
- [Authentication State](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Frontend/src/context/AuthContext.jsx): `Frontend/src/context/AuthContext.jsx`
- [Client API Calls](https://github.com/charankalicheti/hotel-room-booking-system/tree/main/Frontend/src/api): `Frontend/src/api`

### HTTP Application

- [FastAPI Startup](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/main.py): `Backend/app/main.py`
- [Authentication Routes](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/routers/auth.py): `Backend/app/routers/auth.py`
- [Booking Routes](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/routers/bookings.py): `Backend/app/routers/bookings.py`
- [Room Routes](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/routers/rooms.py): `Backend/app/routers/rooms.py`
- [Payment Routes](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/routers/payments.py): `Backend/app/routers/payments.py`
- [Staff Operations Routes](https://github.com/charankalicheti/hotel-room-booking-system/tree/main/Backend/app/routers): `Backend/app/routers`

### Booking and Operations

- [Authentication Service](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/services/auth_service.py): `Backend/app/services/auth_service.py`
- [Reservation Service](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/services/booking_service.py): `Backend/app/services/booking_service.py`
- [Room Availability Service](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/services/room_service.py): `Backend/app/services/room_service.py`
- [Payment and Invoice Service](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/services/payment_service.py): `Backend/app/services/payment_service.py`
- [Reports](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/services/report_service.py): `Backend/app/services/report_service.py`

### Persistence and Integrations

- [Hotel Data Models](https://github.com/charankalicheti/hotel-room-booking-system/tree/main/Backend/app/models): `Backend/app/models`
- [SQLAlchemy Database](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/database.py): `Backend/app/database.py`
- [Payment Repository](https://github.com/charankalicheti/hotel-room-booking-system/blob/main/Backend/app/repositories/payment_repository.py): `Backend/app/repositories/payment_repository.py`

### Other components

- **Customer or Staff**
- **RDS Database**
- **Razorpay Gateway**

## Connections

- Customer or Staff → Web Experience: uses
- Web Experience → Client Routes: navigates
- Client Routes → Authentication State: guards access
- Authentication State → Client API Calls: loads credentials (evidence: `Frontend/src/context/AuthContext.jsx`)
- Web Experience → Client API Calls: requests rooms (evidence: `Frontend/src/pages/Customer/SearchRooms.jsx`)
- Client API Calls → Authentication Routes: sends auth requests
- Client API Calls → Booking Routes: sends booking requests
- Client API Calls → Room Routes: sends room requests
- Client API Calls → Payment Routes: sends payment requests
- FastAPI Startup → Authentication Routes: mounts router (evidence: `Backend/app/main.py`)
- FastAPI Startup → Booking Routes: mounts router (evidence: `Backend/app/main.py`)
- FastAPI Startup → Room Routes: mounts router (evidence: `Backend/app/main.py`)
- FastAPI Startup → Payment Routes: mounts router (evidence: `Backend/app/main.py`)
- FastAPI Startup → Staff Operations Routes: mounts routers (evidence: `Backend/app/main.py`)
- FastAPI Startup → SQLAlchemy Database: creates tables (evidence: `Backend/app/main.py`)
- FastAPI Startup → Hotel Data Models: registers models (evidence: `Backend/app/main.py`)
- Authentication Routes → Authentication Service: dispatches
- Booking Routes → Reservation Service: dispatches
- Room Routes → Room Availability Service: dispatches
- Payment Routes → Payment and Invoice Service: dispatches
- Payment and Invoice Service → Payment Repository: persists payments (evidence: `Backend/app/services/payment_service.py`)
- Payment Repository → Hotel Data Models: queries payment model (evidence: `Backend/app/repositories/payment_repository.py`)
- Payment and Invoice Service → Razorpay Gateway: creates gateway order (evidence: `Backend/app/services/payment_service.py`)
- SQLAlchemy Database → RDS Database: connects
- Authentication Service → Hotel Data Models: creates customers (evidence: `Backend/app/services/auth_service.py`)
