# sanishpoudel/room-reservation architecture

> Architecture diagram of the GitHub repository sanishpoudel/room-reservation, 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/sanishpoudel/room-reservation
- Repository: https://github.com/sanishpoudel/room-reservation

## Overview

This is a small interactive hotel room-reservation application. A guest uses the command-line menu to search rooms, make or modify a reservation, view its summary, or check out; administrators can add rooms. HotelSystem coordinates room availability, date-overlap checks, guest bookings, and reservation operations. Room and reservation details are represented by domain models, while room data is read from and written to an Excel workbook. The excerpts show room-file access but do not fully establish booking persistence, so that storage flow is omitted.

Main entry points: [`models/hotel_system.py`](https://github.com/sanishpoudel/room-reservation/blob/main/models/hotel_system.py) (Hotel coordinator), [`main.py`](https://github.com/sanishpoudel/room-reservation/blob/main/main.py) (Menu and prompts), [`models/guest.py`](https://github.com/sanishpoudel/room-reservation/blob/main/models/guest.py) (Guest account), [`utils/file_operations.py`](https://github.com/sanishpoudel/room-reservation/blob/main/utils/file_operations.py) (Workbook access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_cli["Menu and prompts<br/>[main.py]"]
  node_admin_tools["Room administration<br/>[admin.py]"]
end

subgraph group_operations["Hotel operations"]
  node_hotel_system["Hotel coordinator<br/>[hotel_system.py]"]
  node_room_search["Room search and listing<br/>[hotel_system.py]"]
  node_availability["Availability checks<br/>[hotel_system.py]"]
  node_booking_ops["Booking operations<br/>[hotel_system.py]"]
end

subgraph group_domain["Reservation domain"]
  node_guest_account["Guest account<br/>[guest.py]"]
  node_user_base["User base<br/>[user.py]"]
  node_reservation["Reservation<br/>[reservation.py]"]
  node_room["Room<br/>[room.py]"]
end

subgraph group_storage["Room storage"]
  node_file_ops["Workbook access<br/>[file_operations.py]"]
  node_room_workbook[("Room workbook<br/>[rooms.xlsx]")]
end

node_guest_actor(("Guest"))
node_admin_actor(("Administrator"))

node_guest_actor -->|"chooses actions"| node_cli
node_admin_actor -->|"chooses administration"| node_cli
node_cli -->|"dispatches operations"| node_hotel_system
node_cli -->|"opens admin actions"| node_admin_tools
node_cli -->|"requests room search"| node_hotel_system
node_cli -->|"looks up reservations"| node_hotel_system
node_admin_tools -->|"adds rooms through"| node_hotel_system
node_hotel_system -->|"handles searches"| node_room_search
node_hotel_system -->|"checks date overlap"| node_availability
node_hotel_system -->|"runs booking actions"| node_booking_ops
node_hotel_system -->|"creates guest records"| node_guest_account
node_guest_account -->|"inherits from"| node_user_base
node_guest_account -->|"stores bookings"| node_reservation
node_reservation -->|"calculates room fees"| node_room
node_hotel_system -->|"creates room models"| node_room
node_hotel_system -->|"reads room data"| node_file_ops
node_room_search -->|"loads workbook"| node_file_ops
node_file_ops -->|"reads workbook"| node_room_workbook
node_hotel_system -->|"writes room updates"| node_room_workbook

click node_cli "https://github.com/sanishpoudel/room-reservation/blob/main/main.py"
click node_admin_tools "https://github.com/sanishpoudel/room-reservation/blob/main/models/admin.py"
click node_hotel_system "https://github.com/sanishpoudel/room-reservation/blob/main/models/hotel_system.py"
click node_room_search "https://github.com/sanishpoudel/room-reservation/blob/main/models/hotel_system.py"
click node_availability "https://github.com/sanishpoudel/room-reservation/blob/main/models/hotel_system.py"
click node_booking_ops "https://github.com/sanishpoudel/room-reservation/blob/main/models/hotel_system.py"
click node_guest_account "https://github.com/sanishpoudel/room-reservation/blob/main/models/guest.py"
click node_user_base "https://github.com/sanishpoudel/room-reservation/blob/main/models/user.py"
click node_reservation "https://github.com/sanishpoudel/room-reservation/blob/main/models/reservation.py"
click node_room "https://github.com/sanishpoudel/room-reservation/blob/main/models/room.py"
click node_file_ops "https://github.com/sanishpoudel/room-reservation/blob/main/utils/file_operations.py"
click node_room_workbook "https://github.com/sanishpoudel/room-reservation/blob/main/data/rooms.xlsx"

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_cli,node_admin_tools toneBlue
class node_hotel_system,node_room_search,node_availability,node_booking_ops toneAmber
class node_guest_account,node_user_base,node_reservation,node_room toneMint
class node_file_ops,node_room_workbook toneRose
class node_guest_actor,node_admin_actor toneIndigo
```

## Components

### User interface

- [Menu and prompts](https://github.com/sanishpoudel/room-reservation/blob/main/main.py): `main.py`
- [Room administration](https://github.com/sanishpoudel/room-reservation/blob/main/models/admin.py): `models/admin.py`

### Hotel operations

- [Hotel coordinator](https://github.com/sanishpoudel/room-reservation/blob/main/models/hotel_system.py): `models/hotel_system.py`
- [Room search and listing](https://github.com/sanishpoudel/room-reservation/blob/main/models/hotel_system.py): `models/hotel_system.py`
- [Availability checks](https://github.com/sanishpoudel/room-reservation/blob/main/models/hotel_system.py): `models/hotel_system.py`
- [Booking operations](https://github.com/sanishpoudel/room-reservation/blob/main/models/hotel_system.py): `models/hotel_system.py`

### Reservation domain

- [Guest account](https://github.com/sanishpoudel/room-reservation/blob/main/models/guest.py): `models/guest.py`
- [User base](https://github.com/sanishpoudel/room-reservation/blob/main/models/user.py): `models/user.py`
- [Reservation](https://github.com/sanishpoudel/room-reservation/blob/main/models/reservation.py): `models/reservation.py`
- [Room](https://github.com/sanishpoudel/room-reservation/blob/main/models/room.py): `models/room.py`

### Room storage

- [Workbook access](https://github.com/sanishpoudel/room-reservation/blob/main/utils/file_operations.py): `utils/file_operations.py`
- [Room workbook](https://github.com/sanishpoudel/room-reservation/blob/main/data/rooms.xlsx): `data/rooms.xlsx`

### Other components

- **Guest**
- **Administrator**

## Connections

- Guest → Menu and prompts: chooses actions (evidence: `main.py`)
- Administrator → Menu and prompts: chooses administration (evidence: `main.py`)
- Menu and prompts → Hotel coordinator: dispatches operations (evidence: `main.py`)
- Menu and prompts → Room administration: opens admin actions (evidence: `main.py`)
- Menu and prompts → Hotel coordinator: requests room search (evidence: `main.py`)
- Menu and prompts → Hotel coordinator: looks up reservations (evidence: `main.py`)
- Room administration → Hotel coordinator: adds rooms through (evidence: `models/admin.py`)
- Hotel coordinator → Room search and listing: handles searches (evidence: `models/hotel_system.py`)
- Hotel coordinator → Availability checks: checks date overlap (evidence: `models/hotel_system.py`)
- Hotel coordinator → Booking operations: runs booking actions (evidence: `models/hotel_system.py`)
- Hotel coordinator → Guest account: creates guest records (evidence: `models/hotel_system.py`)
- Guest account → User base: inherits from (evidence: `models/guest.py`)
- Guest account → Reservation: stores bookings (evidence: `models/guest.py`)
- Reservation → Room: calculates room fees (evidence: `models/reservation.py`)
- Hotel coordinator → Room: creates room models (evidence: `models/hotel_system.py`)
- Hotel coordinator → Workbook access: reads room data (evidence: `models/hotel_system.py`)
- Room search and listing → Workbook access: loads workbook (evidence: `models/hotel_system.py`)
- Workbook access → Room workbook: reads workbook (evidence: `utils/file_operations.py`)
- Hotel coordinator → Room workbook: writes room updates (evidence: `models/hotel_system.py`)
