# shashwatmishra23/hotel-website architecture

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

- Interactive diagram: https://gitdiagram.com/shashwatmishra23/hotel-website
- Repository: https://github.com/shashwatmishra23/hotel-website

## Overview

This repository is a minimal Hotel Booking API starter, not yet a booking workflow: its implemented user-facing behavior is a basic health check and a database connectivity check. The database layer loads configuration and supplies SQLAlchemy sessions; the API uses one to issue a connectivity query. PostgreSQL is provided separately, and Alembic currently has only an empty baseline migration. The map reflects the sampled runtime files and documented migration behavior; no booking, hotel, or reservation features are present.

Main entry points: [`app/main.py`](https://github.com/shashwatmishra23/hotel-website/blob/main/app/main.py) (FastAPI endpoints), [`compose.yaml`](https://github.com/shashwatmishra23/hotel-website/blob/main/compose.yaml) (PostgreSQL), [`app/database.py`](https://github.com/shashwatmishra23/hotel-website/blob/main/app/database.py) (Session and engine), [`alembic/versions/0001_initial.py`](https://github.com/shashwatmishra23/hotel-website/blob/main/alembic/versions/0001_initial.py) (Empty baseline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_http_api["FastAPI endpoints<br/>[main.py]"]
end

subgraph group_data["Database Access"]
  node_db_access["Session and engine<br/>[database.py]"]
  node_postgres[("PostgreSQL<br/>[compose.yaml]")]
end

subgraph group_migrations["Schema Migrations"]
  node_baseline["Empty baseline<br/>[0001_initial.py]"]
end

node_caller(("API caller"))

node_caller -->|"requests health"| node_http_api
node_http_api -->|"gets session"| node_db_access
node_http_api -->|"checks connection"| node_postgres
node_db_access -->|"opens connection"| node_postgres
node_baseline -->|"tracks revision"| node_postgres

click node_http_api "https://github.com/shashwatmishra23/hotel-website/blob/main/app/main.py"
click node_db_access "https://github.com/shashwatmishra23/hotel-website/blob/main/app/database.py"
click node_postgres "https://github.com/shashwatmishra23/hotel-website/blob/main/compose.yaml"
click node_baseline "https://github.com/shashwatmishra23/hotel-website/blob/main/alembic/versions/0001_initial.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_http_api toneBlue
class node_db_access,node_postgres toneAmber
class node_baseline,node_caller toneMint
```

## Components

### HTTP API

- [FastAPI endpoints](https://github.com/shashwatmishra23/hotel-website/blob/main/app/main.py): `app/main.py`

### Database Access

- [Session and engine](https://github.com/shashwatmishra23/hotel-website/blob/main/app/database.py): `app/database.py`
- [PostgreSQL](https://github.com/shashwatmishra23/hotel-website/blob/main/compose.yaml): `compose.yaml`

### Schema Migrations

- [Empty baseline](https://github.com/shashwatmishra23/hotel-website/blob/main/alembic/versions/0001_initial.py): `alembic/versions/0001_initial.py`

### Other components

- **API caller**

## Connections

- API caller → FastAPI endpoints: requests health (evidence: `README.md`)
- FastAPI endpoints → Session and engine: gets session (evidence: `app/main.py`)
- FastAPI endpoints → PostgreSQL: checks connection (evidence: `app/main.py`)
- Session and engine → PostgreSQL: opens connection (evidence: `app/database.py`)
- Empty baseline → PostgreSQL: tracks revision (evidence: `README.md`)
