# prajyots60/hotelmanagement architecture

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

- Interactive diagram: https://gitdiagram.com/prajyots60/hotelmanagement
- Repository: https://github.com/prajyots60/hotelmanagement

## Overview

This repository is a set of hotel-management microservices: user authentication and administration, hotel inventory/operations, and guest reservations. The main workflow is an authenticated client managing hotel resources or guests, then creating a reservation after the reservation service checks guest records and queries room availability from the hotel service. The tree also contains ApiGateway and BillingService weather-forecast examples, but the available evidence does not show product workflows for them. The graph reflects sampled calls and registrations; unsampled subsystems are represented only where the tree supports them.

Main entry points: [`HotelManagementService/Services/Implementations`](https://github.com/prajyots60/hotelmanagement/tree/main/HotelManagementService/Services/Implementations) (Hotel operations logic), [`ReservationService/Services/Implementations/ReservationService.cs`](https://github.com/prajyots60/hotelmanagement/blob/main/ReservationService/Services/Implementations/ReservationService.cs) (Reservation and availability), [`UserService/Services/Implementations/UserService.cs`](https://github.com/prajyots60/hotelmanagement/blob/main/UserService/Services/Implementations/UserService.cs) (User management), [`HotelManagementService/Controllers/RoomsController.cs`](https://github.com/prajyots60/hotelmanagement/blob/main/HotelManagementService/Controllers/RoomsController.cs) (Rooms and rates APIs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["User identity"]
  node_users_api["User endpoints<br/>[UsersController.cs]"]
  node_users_logic["User management<br/>[UserService.cs]"]
  node_users_db["User repository<br/>[UserRepository.cs]"]
  node_users_store[("User database<br/>[UserDbContext.cs]")]
  node_token["JWT tokens<br/>[TokenService.cs]"]
end

subgraph group_hotel["Hotel operations"]
  node_hotel_departments["Departments API"]
  node_hotel_inventory["Inventory API"]
  node_hotel_rooms["Rooms and rates APIs<br/>[RoomsController.cs]"]
  node_hotel_staff["Staff API<br/>[StaffController.cs]"]
  node_hotel_services["Hotel operations logic"]
  node_hotel_repos["Hotel repositories"]
  node_hotel_store[("Hotel database<br/>[HotelDbContext.cs]")]
end

subgraph group_reservation["Reservations"]
  node_reservation_guests["Guest endpoints"]
  node_reservation_api["Reservation endpoints"]
  node_reservation_logic["Reservation and availability"]
  node_reservation_repos["Reservation repositories"]
  node_reservation_store[("Reservation database")]
end

node_client(("API client"))
node_hotel_service["Hotel Management Service"]

node_client -->|"sends requests"| node_users_api
node_users_api -->|"calls"| node_users_logic
node_users_logic -->|"uses"| node_users_db
node_users_db -.->|"persists users"| node_users_store
node_users_logic -->|"issues tokens"| node_token
node_client -->|"sends requests"| node_hotel_departments
node_client -->|"sends requests"| node_hotel_inventory
node_client -.->|"sends requests"| node_hotel_rooms
node_client -.->|"sends requests"| node_hotel_staff
node_hotel_departments -->|"calls"| node_hotel_services
node_hotel_inventory -->|"calls"| node_hotel_services
node_hotel_rooms -.->|"calls"| node_hotel_services
node_hotel_staff -.->|"calls"| node_hotel_services
node_hotel_services -.->|"uses"| node_hotel_repos
node_hotel_repos -.->|"reads and writes"| node_hotel_store
node_client -->|"sends requests"| node_reservation_guests
node_client -->|"sends requests"| node_reservation_api
node_reservation_guests -.->|"calls"| node_reservation_logic
node_reservation_api -->|"calls"| node_reservation_logic
node_reservation_logic -->|"uses"| node_reservation_repos
node_reservation_logic -->|"queries room"| node_hotel_service
node_reservation_repos -->|"reads and writes"| node_reservation_store
node_hotel_service -.->|"serves room query"| node_hotel_rooms

click node_users_api "https://github.com/prajyots60/hotelmanagement/blob/main/UserService/Controllers/UsersController.cs"
click node_users_logic "https://github.com/prajyots60/hotelmanagement/blob/main/UserService/Services/Implementations/UserService.cs"
click node_users_db "https://github.com/prajyots60/hotelmanagement/blob/main/UserService/Repositories/Implementations/UserRepository.cs"
click node_users_store "https://github.com/prajyots60/hotelmanagement/blob/main/UserService/Data/UserDbContext.cs"
click node_token "https://github.com/prajyots60/hotelmanagement/blob/main/UserService/Services/Implementations/TokenService.cs"
click node_hotel_departments "https://github.com/prajyots60/hotelmanagement/blob/main/HotelManagementService/Controllers/DepartmentsController.cs"
click node_hotel_inventory "https://github.com/prajyots60/hotelmanagement/blob/main/HotelManagementService/Controllers/InventoryController.cs"
click node_hotel_rooms "https://github.com/prajyots60/hotelmanagement/blob/main/HotelManagementService/Controllers/RoomsController.cs"
click node_hotel_staff "https://github.com/prajyots60/hotelmanagement/blob/main/HotelManagementService/Controllers/StaffController.cs"
click node_hotel_services "https://github.com/prajyots60/hotelmanagement/tree/main/HotelManagementService/Services/Implementations"
click node_hotel_repos "https://github.com/prajyots60/hotelmanagement/tree/main/HotelManagementService/Repositories/Implementations"
click node_hotel_store "https://github.com/prajyots60/hotelmanagement/blob/main/HotelManagementService/Data/HotelDbContext.cs"
click node_reservation_guests "https://github.com/prajyots60/hotelmanagement/blob/main/ReservationService/Controllers/GuestsController.cs"
click node_reservation_api "https://github.com/prajyots60/hotelmanagement/blob/main/ReservationService/Controllers/ReservationsController.cs"
click node_reservation_logic "https://github.com/prajyots60/hotelmanagement/blob/main/ReservationService/Services/Implementations/ReservationService.cs"
click node_reservation_repos "https://github.com/prajyots60/hotelmanagement/tree/main/ReservationService/Repositories/Implementations"
click node_reservation_store "https://github.com/prajyots60/hotelmanagement/blob/main/ReservationService/Data/ReservationDbContext.cs"

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_users_api,node_users_logic,node_users_db,node_users_store,node_token,node_client toneBlue
class node_hotel_departments,node_hotel_inventory,node_hotel_rooms,node_hotel_staff,node_hotel_services,node_hotel_repos,node_hotel_store toneAmber
class node_reservation_guests,node_reservation_api,node_reservation_logic,node_reservation_repos,node_reservation_store toneMint
class node_hotel_service toneIndigo
```

## Components

### User identity

- [User endpoints](https://github.com/prajyots60/hotelmanagement/blob/main/UserService/Controllers/UsersController.cs): `UserService/Controllers/UsersController.cs`
- [User management](https://github.com/prajyots60/hotelmanagement/blob/main/UserService/Services/Implementations/UserService.cs): `UserService/Services/Implementations/UserService.cs`
- [User repository](https://github.com/prajyots60/hotelmanagement/blob/main/UserService/Repositories/Implementations/UserRepository.cs): `UserService/Repositories/Implementations/UserRepository.cs`
- [User database](https://github.com/prajyots60/hotelmanagement/blob/main/UserService/Data/UserDbContext.cs): `UserService/Data/UserDbContext.cs`
- [JWT tokens](https://github.com/prajyots60/hotelmanagement/blob/main/UserService/Services/Implementations/TokenService.cs): `UserService/Services/Implementations/TokenService.cs`

### Hotel operations

- [Departments API](https://github.com/prajyots60/hotelmanagement/blob/main/HotelManagementService/Controllers/DepartmentsController.cs): `HotelManagementService/Controllers/DepartmentsController.cs`
- [Inventory API](https://github.com/prajyots60/hotelmanagement/blob/main/HotelManagementService/Controllers/InventoryController.cs): `HotelManagementService/Controllers/InventoryController.cs`
- [Rooms and rates APIs](https://github.com/prajyots60/hotelmanagement/blob/main/HotelManagementService/Controllers/RoomsController.cs): `HotelManagementService/Controllers/RoomsController.cs`
- [Staff API](https://github.com/prajyots60/hotelmanagement/blob/main/HotelManagementService/Controllers/StaffController.cs): `HotelManagementService/Controllers/StaffController.cs`
- [Hotel operations logic](https://github.com/prajyots60/hotelmanagement/tree/main/HotelManagementService/Services/Implementations): `HotelManagementService/Services/Implementations`
- [Hotel repositories](https://github.com/prajyots60/hotelmanagement/tree/main/HotelManagementService/Repositories/Implementations): `HotelManagementService/Repositories/Implementations`
- [Hotel database](https://github.com/prajyots60/hotelmanagement/blob/main/HotelManagementService/Data/HotelDbContext.cs): `HotelManagementService/Data/HotelDbContext.cs`

### Reservations

- [Guest endpoints](https://github.com/prajyots60/hotelmanagement/blob/main/ReservationService/Controllers/GuestsController.cs): `ReservationService/Controllers/GuestsController.cs`
- [Reservation endpoints](https://github.com/prajyots60/hotelmanagement/blob/main/ReservationService/Controllers/ReservationsController.cs): `ReservationService/Controllers/ReservationsController.cs`
- [Reservation and availability](https://github.com/prajyots60/hotelmanagement/blob/main/ReservationService/Services/Implementations/ReservationService.cs): `ReservationService/Services/Implementations/ReservationService.cs`
- [Reservation repositories](https://github.com/prajyots60/hotelmanagement/tree/main/ReservationService/Repositories/Implementations): `ReservationService/Repositories/Implementations`
- [Reservation database](https://github.com/prajyots60/hotelmanagement/blob/main/ReservationService/Data/ReservationDbContext.cs): `ReservationService/Data/ReservationDbContext.cs`

### Other components

- **API client**
- **Hotel Management Service**

## Connections

- API client → User endpoints: sends requests (evidence: `UserService/Controllers/UsersController.cs`)
- User endpoints → User management: calls (evidence: `UserService/Controllers/UsersController.cs`)
- User management → User repository: uses (evidence: `UserService/Services/Implementations/UserService.cs`)
- User repository → User database: persists users (evidence: `UserService/Repositories/Implementations/UserRepository.cs`)
- User management → JWT tokens: issues tokens (evidence: `UserService/Services/Implementations/UserService.cs`)
- API client → Departments API: sends requests (evidence: `HotelManagementService/Controllers/DepartmentsController.cs`)
- API client → Inventory API: sends requests (evidence: `HotelManagementService/Controllers/InventoryController.cs`)
- API client → Rooms and rates APIs: sends requests
- API client → Staff API: sends requests
- Departments API → Hotel operations logic: calls (evidence: `HotelManagementService/Controllers/DepartmentsController.cs`)
- Inventory API → Hotel operations logic: calls (evidence: `HotelManagementService/Controllers/InventoryController.cs`)
- Rooms and rates APIs → Hotel operations logic: calls
- Staff API → Hotel operations logic: calls
- Hotel operations logic → Hotel repositories: uses
- Hotel repositories → Hotel database: reads and writes (evidence: `HotelManagementService/Repositories/Implementations/StaffRepository.cs`)
- API client → Guest endpoints: sends requests (evidence: `ReservationService/Controllers/GuestsController.cs`)
- API client → Reservation endpoints: sends requests (evidence: `ReservationService/Controllers/ReservationsController.cs`)
- Guest endpoints → Reservation and availability: calls (evidence: `ReservationService/Controllers/GuestsController.cs`)
- Reservation endpoints → Reservation and availability: calls (evidence: `ReservationService/Controllers/ReservationsController.cs`)
- Reservation and availability → Reservation repositories: uses (evidence: `ReservationService/Services/Implementations/ReservationService.cs`)
- Reservation and availability → Hotel Management Service: queries room (evidence: `ReservationService/Services/Implementations/ReservationService.cs`)
- Reservation repositories → Reservation database: reads and writes (evidence: `ReservationService/Repositories/Implementations/ReservationRepository.cs`)
- Hotel Management Service → Rooms and rates APIs: serves room query
