# adityadas03/hotel-management-microservices architecture

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

- Interactive diagram: https://gitdiagram.com/adityadas03/hotel-management-microservices
- Repository: https://github.com/adityadas03/hotel-management-microservices

## Overview

This repository implements a hotel-management system split into Room, Booking, and Billing FastAPI services, each with a separate SQLite database. The user-facing flow starts with a booking request: Booking checks and updates a room, then requests billing; Billing retrieves booking and room details to calculate and store a bill. Room management, room availability and booking summaries, bill lookup, bill details, and payment-status updates are additional capabilities. The excerpts show service calls and room/billing persistence, but the booking endpoint excerpt does not show booking persistence or the internal booking lookup route; those links are omitted.

Main entry points: [`room-service/app/routers/rooms.py`](https://github.com/adityadas03/hotel-management-microservices/blob/main/room-service/app/routers/rooms.py) (Room API), [`booking-service/app/routers/bookings.py`](https://github.com/adityadas03/hotel-management-microservices/blob/main/booking-service/app/routers/bookings.py) (Booking API), [`billing-service/app/routers/billing.py`](https://github.com/adityadas03/hotel-management-microservices/blob/main/billing-service/app/routers/billing.py) (Billing API), [`room-service/app/database.py`](https://github.com/adityadas03/hotel-management-microservices/blob/main/room-service/app/database.py) (Room DB access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rooms["Room service"]
  node_room_api["Room API<br/>[rooms.py]"]
  node_room_model["Room model<br/>[models.py]"]
  node_room_db_config["Room DB access<br/>[database.py]"]
  node_room_store[("Room SQLite<br/>[room.db]")]
  node_room_app["Room app<br/>[main.py]"]
end

subgraph group_bookings["Booking service"]
  node_booking_api["Booking API<br/>[bookings.py]"]
  node_booking_model["Booking model<br/>[models.py]"]
  node_booking_db_config["Booking DB access<br/>[database.py]"]
  node_booking_store[("Booking SQLite<br/>[booking.db]")]
  node_booking_app["Booking app<br/>[main.py]"]
end

subgraph group_billing["Billing service"]
  node_billing_api["Billing API<br/>[billing.py]"]
  node_billing_model["Billing model<br/>[models.py]"]
  node_billing_db_config["Billing DB access<br/>[database.py]"]
  node_billing_store[("Billing SQLite")]
  node_billing_app["Billing app<br/>[main.py]"]
end

node_guest(("Guest or client"))

node_guest -.->|"uses room routes"| node_room_app
node_guest -.->|"submits booking"| node_booking_app
node_guest -.->|"requests billing"| node_billing_app
node_room_app -->|"registers router"| node_room_api
node_room_app -->|"creates tables"| node_room_db_config
node_room_db_config -->|"configures SQLite"| node_room_store
node_room_api -->|"queries rooms"| node_room_db_config
node_room_api -->|"uses model"| node_room_model
node_room_model -->|"inherits Base"| node_room_db_config
node_room_api -->|"requests active booking"| node_booking_api
node_booking_app -->|"registers router"| node_booking_api
node_booking_app -->|"creates tables"| node_booking_db_config
node_booking_db_config -->|"configures SQLite"| node_booking_store
node_booking_model -->|"inherits Base"| node_booking_db_config
node_booking_api -->|"checks room"| node_room_api
node_booking_api -->|"updates room"| node_room_api
node_booking_api -->|"requests bill"| node_billing_api
node_billing_app -->|"registers router"| node_billing_api
node_billing_app -->|"creates tables"| node_billing_db_config
node_billing_db_config -->|"configures SQLite"| node_billing_store
node_billing_api -->|"reads and writes"| node_billing_db_config
node_billing_model -->|"uses Base"| node_billing_db_config
node_billing_api -->|"fetches booking"| node_booking_api
node_billing_api -->|"fetches room"| node_room_api

click node_room_api "https://github.com/adityadas03/hotel-management-microservices/blob/main/room-service/app/routers/rooms.py"
click node_room_model "https://github.com/adityadas03/hotel-management-microservices/blob/main/room-service/app/models.py"
click node_room_db_config "https://github.com/adityadas03/hotel-management-microservices/blob/main/room-service/app/database.py"
click node_room_store "https://github.com/adityadas03/hotel-management-microservices/blob/main/room-service/data/room.db"
click node_room_app "https://github.com/adityadas03/hotel-management-microservices/blob/main/room-service/app/main.py"
click node_booking_api "https://github.com/adityadas03/hotel-management-microservices/blob/main/booking-service/app/routers/bookings.py"
click node_booking_model "https://github.com/adityadas03/hotel-management-microservices/blob/main/booking-service/app/models.py"
click node_booking_db_config "https://github.com/adityadas03/hotel-management-microservices/blob/main/booking-service/app/database.py"
click node_booking_store "https://github.com/adityadas03/hotel-management-microservices/blob/main/booking-service/data/booking.db"
click node_booking_app "https://github.com/adityadas03/hotel-management-microservices/blob/main/booking-service/app/main.py"
click node_billing_api "https://github.com/adityadas03/hotel-management-microservices/blob/main/billing-service/app/routers/billing.py"
click node_billing_model "https://github.com/adityadas03/hotel-management-microservices/blob/main/billing-service/app/models.py"
click node_billing_db_config "https://github.com/adityadas03/hotel-management-microservices/blob/main/billing-service/app/database.py"
click node_billing_app "https://github.com/adityadas03/hotel-management-microservices/blob/main/billing-service/app/main.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_room_api,node_room_model,node_room_db_config,node_room_store,node_room_app,node_guest toneBlue
class node_booking_api,node_booking_model,node_booking_db_config,node_booking_store,node_booking_app toneAmber
class node_billing_api,node_billing_model,node_billing_db_config,node_billing_store,node_billing_app toneMint
```

## Components

### Room service

- [Room API](https://github.com/adityadas03/hotel-management-microservices/blob/main/room-service/app/routers/rooms.py): `room-service/app/routers/rooms.py`
- [Room model](https://github.com/adityadas03/hotel-management-microservices/blob/main/room-service/app/models.py): `room-service/app/models.py`
- [Room DB access](https://github.com/adityadas03/hotel-management-microservices/blob/main/room-service/app/database.py): `room-service/app/database.py`
- [Room SQLite](https://github.com/adityadas03/hotel-management-microservices/blob/main/room-service/data/room.db): `room-service/data/room.db`
- [Room app](https://github.com/adityadas03/hotel-management-microservices/blob/main/room-service/app/main.py): `room-service/app/main.py`

### Booking service

- [Booking API](https://github.com/adityadas03/hotel-management-microservices/blob/main/booking-service/app/routers/bookings.py): `booking-service/app/routers/bookings.py`
- [Booking model](https://github.com/adityadas03/hotel-management-microservices/blob/main/booking-service/app/models.py): `booking-service/app/models.py`
- [Booking DB access](https://github.com/adityadas03/hotel-management-microservices/blob/main/booking-service/app/database.py): `booking-service/app/database.py`
- [Booking SQLite](https://github.com/adityadas03/hotel-management-microservices/blob/main/booking-service/data/booking.db): `booking-service/data/booking.db`
- [Booking app](https://github.com/adityadas03/hotel-management-microservices/blob/main/booking-service/app/main.py): `booking-service/app/main.py`

### Billing service

- [Billing API](https://github.com/adityadas03/hotel-management-microservices/blob/main/billing-service/app/routers/billing.py): `billing-service/app/routers/billing.py`
- [Billing model](https://github.com/adityadas03/hotel-management-microservices/blob/main/billing-service/app/models.py): `billing-service/app/models.py`
- [Billing DB access](https://github.com/adityadas03/hotel-management-microservices/blob/main/billing-service/app/database.py): `billing-service/app/database.py`
- **Billing SQLite**
- [Billing app](https://github.com/adityadas03/hotel-management-microservices/blob/main/billing-service/app/main.py): `billing-service/app/main.py`

### Other components

- **Guest or client**

## Connections

- Guest or client → Room app: uses room routes
- Guest or client → Booking app: submits booking
- Guest or client → Billing app: requests billing
- Room app → Room API: registers router (evidence: `room-service/app/main.py`)
- Room app → Room DB access: creates tables (evidence: `room-service/app/main.py`)
- Room DB access → Room SQLite: configures SQLite (evidence: `room-service/app/database.py`)
- Room API → Room DB access: queries rooms (evidence: `room-service/app/routers/rooms.py`)
- Room API → Room model: uses model (evidence: `room-service/app/routers/rooms.py`)
- Room model → Room DB access: inherits Base (evidence: `room-service/app/models.py`)
- Room API → Booking API: requests active booking (evidence: `room-service/app/routers/rooms.py`)
- Booking app → Booking API: registers router (evidence: `booking-service/app/main.py`)
- Booking app → Booking DB access: creates tables (evidence: `booking-service/app/main.py`)
- Booking DB access → Booking SQLite: configures SQLite (evidence: `booking-service/app/database.py`)
- Booking model → Booking DB access: inherits Base (evidence: `booking-service/app/models.py`)
- Booking API → Room API: checks room (evidence: `booking-service/app/routers/bookings.py`)
- Booking API → Room API: updates room (evidence: `booking-service/app/routers/bookings.py`)
- Booking API → Billing API: requests bill (evidence: `booking-service/app/routers/bookings.py`)
- Billing app → Billing API: registers router (evidence: `billing-service/app/main.py`)
- Billing app → Billing DB access: creates tables (evidence: `billing-service/app/main.py`)
- Billing DB access → Billing SQLite: configures SQLite (evidence: `billing-service/app/database.py`)
- Billing API → Billing DB access: reads and writes (evidence: `billing-service/app/routers/billing.py`)
- Billing model → Billing DB access: uses Base (evidence: `billing-service/app/models.py`)
- Billing API → Booking API: fetches booking (evidence: `billing-service/app/routers/billing.py`)
- Billing API → Room API: fetches room (evidence: `billing-service/app/routers/billing.py`)
