# beto1821/hotel-management-app architecture

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

- Interactive diagram: https://gitdiagram.com/beto1821/hotel-management-app
- Repository: https://github.com/beto1821/hotel-management-app

## Overview

Plataforma Hotel is a hotel-management web application. Hotel staff use the Nuxt interface to authenticate and manage rooms, clients, and reservations, while the FastAPI backend serves those operations and dashboard metrics backed by SQLAlchemy/MySQL. Authentication, permissions, and audit logging are cross-cutting backend capabilities. The README documents the major product features; some route and frontend implementation details were not excerpted, so uncertain connections are omitted or marked unverified.

Main entry points: [`backend/api/api.py`](https://github.com/beto1821/hotel-management-app/blob/main/backend/api/api.py) (API router), [`frontend/services/apiClient.ts`](https://github.com/beto1821/hotel-management-app/blob/main/frontend/services/apiClient.ts) (API client), [`backend/api/endpoints/auth.py`](https://github.com/beto1821/hotel-management-app/blob/main/backend/api/endpoints/auth.py) (Authentication routes), [`backend/api/endpoints/clients.py`](https://github.com/beto1821/hotel-management-app/blob/main/backend/api/endpoints/clients.py) (Client routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Hotel interface"]
  node_app["Nuxt application<br/>[app.vue]"]
  node_login["Login and registration<br/>[login.vue]"]
  node_auth_state["Authentication state<br/>[useAuth.ts]"]
  node_auth_guard["Route guard<br/>[auth.ts]"]
  node_dashboard_ui["Dashboard view<br/>[index.vue]"]
  node_clients_ui["Client management<br/>[index.vue]"]
  node_rooms_ui["Room management<br/>[index.vue]"]
  node_reservations_ui["Reservation management<br/>[index.vue]"]
  node_http_client["API client<br/>[apiClient.ts]"]
end

subgraph group_api["API workflows"]
  node_api_entry["FastAPI application<br/>[main.py]"]
  node_router["API router<br/>[api.py]"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_client_routes["Client routes<br/>[clients.py]"]
  node_room_routes["Room routes<br/>[quartos.py]"]
  node_reservation_routes["Reservation routes<br/>[reservas.py]"]
  node_dashboard_routes["Dashboard routes<br/>[dashboard.py]"]
end

subgraph group_services["Business services"]
  node_client_service["Client service<br/>[client_service.py]"]
  node_room_service["Room service<br/>[quarto_service.py]"]
  node_reservation_service["Reservation service<br/>[reserva_service.py]"]
  node_dashboard_service["Dashboard metrics"]
end

subgraph group_foundation["Security and persistence"]
  node_auth_service["Authentication logic<br/>[auth_service.py]"]
  node_authorization["Identity and permissions<br/>[auth.py]"]
  node_audit["Audit logging<br/>[audit_service.py]"]
  node_database["Database sessions<br/>[database.py]"]
  node_hotel_data[("Hotel records<br/>[reserva.py]")]
  node_client_data[("Client records<br/>[client_model.py]")]
  node_room_data[("Room records<br/>[quarto.py]")]
  node_user_data[("User records<br/>[user_model.py]")]
end

node_staff(("Hotel staff"))

node_staff -->|"signs in"| node_login
node_staff -->|"views metrics"| node_dashboard_ui
node_staff -->|"manages clients"| node_clients_ui
node_staff -->|"manages rooms"| node_rooms_ui
node_staff -->|"manages stays"| node_reservations_ui
node_login -.->|"uses"| node_auth_state
node_auth_guard -->|"checks"| node_auth_state
node_dashboard_ui -.->|"requests data"| node_http_client
node_clients_ui -.->|"requests data"| node_http_client
node_rooms_ui -.->|"requests data"| node_http_client
node_reservations_ui -.->|"requests data"| node_http_client
node_http_client -.->|"sends API calls"| node_api_entry
node_app -.->|"uses API"| node_api_entry
node_api_entry -->|"creates tables"| node_database
node_api_entry -->|"mounts routes"| node_router
node_router -->|"registers"| node_auth_routes
node_router -->|"registers"| node_client_routes
node_router -->|"registers"| node_room_routes
node_router -->|"registers"| node_reservation_routes
node_router -->|"registers"| node_dashboard_routes
node_auth_routes -->|"opens sessions"| node_database
node_auth_routes -->|"uses security logic"| node_auth_service
node_auth_routes -->|"records events"| node_audit
node_client_routes -->|"delegates client work"| node_client_service
node_client_routes -->|"records changes"| node_audit
node_client_routes -->|"requires identity"| node_authorization
node_room_routes -->|"delegates room work"| node_room_service
node_reservation_routes -->|"delegates booking work"| node_reservation_service
node_dashboard_routes -->|"requests metrics"| node_dashboard_service
node_database -->|"creates schema"| node_hotel_data
node_reservation_service -->|"reads and writes"| node_hotel_data
node_reservation_service -->|"checks availability"| node_room_data
node_client_service -->|"reads and writes"| node_client_data
node_dashboard_service -->|"queries bookings"| node_hotel_data
node_dashboard_service -->|"queries clients"| node_client_data
node_dashboard_service -->|"queries rooms"| node_room_data
node_authorization -->|"loads identity"| node_user_data
node_database -->|"creates schema"| node_user_data

click node_app "https://github.com/beto1821/hotel-management-app/blob/main/frontend/app.vue"
click node_login "https://github.com/beto1821/hotel-management-app/blob/main/frontend/pages/login.vue"
click node_auth_state "https://github.com/beto1821/hotel-management-app/blob/main/frontend/composables/useAuth.ts"
click node_auth_guard "https://github.com/beto1821/hotel-management-app/blob/main/frontend/middleware/auth.ts"
click node_dashboard_ui "https://github.com/beto1821/hotel-management-app/blob/main/frontend/pages/index.vue"
click node_clients_ui "https://github.com/beto1821/hotel-management-app/blob/main/frontend/pages/clients/index.vue"
click node_rooms_ui "https://github.com/beto1821/hotel-management-app/blob/main/frontend/pages/quartos/index.vue"
click node_reservations_ui "https://github.com/beto1821/hotel-management-app/blob/main/frontend/pages/reservas/index.vue"
click node_http_client "https://github.com/beto1821/hotel-management-app/blob/main/frontend/services/apiClient.ts"
click node_api_entry "https://github.com/beto1821/hotel-management-app/blob/main/backend/main.py"
click node_router "https://github.com/beto1821/hotel-management-app/blob/main/backend/api/api.py"
click node_auth_routes "https://github.com/beto1821/hotel-management-app/blob/main/backend/api/endpoints/auth.py"
click node_client_routes "https://github.com/beto1821/hotel-management-app/blob/main/backend/api/endpoints/clients.py"
click node_room_routes "https://github.com/beto1821/hotel-management-app/blob/main/backend/api/endpoints/quartos.py"
click node_reservation_routes "https://github.com/beto1821/hotel-management-app/blob/main/backend/api/endpoints/reservas.py"
click node_dashboard_routes "https://github.com/beto1821/hotel-management-app/blob/main/backend/api/endpoints/dashboard.py"
click node_client_service "https://github.com/beto1821/hotel-management-app/blob/main/backend/services/client_service.py"
click node_room_service "https://github.com/beto1821/hotel-management-app/blob/main/backend/services/quarto_service.py"
click node_reservation_service "https://github.com/beto1821/hotel-management-app/blob/main/backend/services/reserva_service.py"
click node_dashboard_service "https://github.com/beto1821/hotel-management-app/blob/main/backend/services/dashboard_service.py"
click node_auth_service "https://github.com/beto1821/hotel-management-app/blob/main/backend/services/auth_service.py"
click node_authorization "https://github.com/beto1821/hotel-management-app/blob/main/backend/dependencies/auth.py"
click node_audit "https://github.com/beto1821/hotel-management-app/blob/main/backend/services/audit_service.py"
click node_database "https://github.com/beto1821/hotel-management-app/blob/main/backend/core/database.py"
click node_hotel_data "https://github.com/beto1821/hotel-management-app/blob/main/backend/models/reserva.py"
click node_client_data "https://github.com/beto1821/hotel-management-app/blob/main/backend/models/client_model.py"
click node_room_data "https://github.com/beto1821/hotel-management-app/blob/main/backend/models/quarto.py"
click node_user_data "https://github.com/beto1821/hotel-management-app/blob/main/backend/models/user_model.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_app,node_login,node_auth_state,node_auth_guard,node_dashboard_ui,node_clients_ui,node_rooms_ui,node_reservations_ui,node_http_client toneBlue
class node_api_entry,node_router,node_auth_routes,node_client_routes,node_room_routes,node_reservation_routes,node_dashboard_routes toneAmber
class node_client_service,node_room_service,node_reservation_service,node_dashboard_service toneMint
class node_auth_service,node_authorization,node_audit,node_database,node_hotel_data,node_client_data,node_room_data,node_user_data toneRose
class node_staff toneIndigo
```

## Components

### Hotel interface

- [Nuxt application](https://github.com/beto1821/hotel-management-app/blob/main/frontend/app.vue): `frontend/app.vue`
- [Login and registration](https://github.com/beto1821/hotel-management-app/blob/main/frontend/pages/login.vue): `frontend/pages/login.vue`
- [Authentication state](https://github.com/beto1821/hotel-management-app/blob/main/frontend/composables/useAuth.ts): `frontend/composables/useAuth.ts`
- [Route guard](https://github.com/beto1821/hotel-management-app/blob/main/frontend/middleware/auth.ts): `frontend/middleware/auth.ts`
- [Dashboard view](https://github.com/beto1821/hotel-management-app/blob/main/frontend/pages/index.vue): `frontend/pages/index.vue`
- [Client management](https://github.com/beto1821/hotel-management-app/blob/main/frontend/pages/clients/index.vue): `frontend/pages/clients/index.vue`
- [Room management](https://github.com/beto1821/hotel-management-app/blob/main/frontend/pages/quartos/index.vue): `frontend/pages/quartos/index.vue`
- [Reservation management](https://github.com/beto1821/hotel-management-app/blob/main/frontend/pages/reservas/index.vue): `frontend/pages/reservas/index.vue`
- [API client](https://github.com/beto1821/hotel-management-app/blob/main/frontend/services/apiClient.ts): `frontend/services/apiClient.ts`

### API workflows

- [FastAPI application](https://github.com/beto1821/hotel-management-app/blob/main/backend/main.py): `backend/main.py`
- [API router](https://github.com/beto1821/hotel-management-app/blob/main/backend/api/api.py): `backend/api/api.py`
- [Authentication routes](https://github.com/beto1821/hotel-management-app/blob/main/backend/api/endpoints/auth.py): `backend/api/endpoints/auth.py`
- [Client routes](https://github.com/beto1821/hotel-management-app/blob/main/backend/api/endpoints/clients.py): `backend/api/endpoints/clients.py`
- [Room routes](https://github.com/beto1821/hotel-management-app/blob/main/backend/api/endpoints/quartos.py): `backend/api/endpoints/quartos.py`
- [Reservation routes](https://github.com/beto1821/hotel-management-app/blob/main/backend/api/endpoints/reservas.py): `backend/api/endpoints/reservas.py`
- [Dashboard routes](https://github.com/beto1821/hotel-management-app/blob/main/backend/api/endpoints/dashboard.py): `backend/api/endpoints/dashboard.py`

### Business services

- [Client service](https://github.com/beto1821/hotel-management-app/blob/main/backend/services/client_service.py): `backend/services/client_service.py`
- [Room service](https://github.com/beto1821/hotel-management-app/blob/main/backend/services/quarto_service.py): `backend/services/quarto_service.py`
- [Reservation service](https://github.com/beto1821/hotel-management-app/blob/main/backend/services/reserva_service.py): `backend/services/reserva_service.py`
- [Dashboard metrics](https://github.com/beto1821/hotel-management-app/blob/main/backend/services/dashboard_service.py): `backend/services/dashboard_service.py`

### Security and persistence

- [Authentication logic](https://github.com/beto1821/hotel-management-app/blob/main/backend/services/auth_service.py): `backend/services/auth_service.py`
- [Identity and permissions](https://github.com/beto1821/hotel-management-app/blob/main/backend/dependencies/auth.py): `backend/dependencies/auth.py`
- [Audit logging](https://github.com/beto1821/hotel-management-app/blob/main/backend/services/audit_service.py): `backend/services/audit_service.py`
- [Database sessions](https://github.com/beto1821/hotel-management-app/blob/main/backend/core/database.py): `backend/core/database.py`
- [Hotel records](https://github.com/beto1821/hotel-management-app/blob/main/backend/models/reserva.py): `backend/models/reserva.py`
- [Client records](https://github.com/beto1821/hotel-management-app/blob/main/backend/models/client_model.py): `backend/models/client_model.py`
- [Room records](https://github.com/beto1821/hotel-management-app/blob/main/backend/models/quarto.py): `backend/models/quarto.py`
- [User records](https://github.com/beto1821/hotel-management-app/blob/main/backend/models/user_model.py): `backend/models/user_model.py`

### Other components

- **Hotel staff**

## Connections

- Hotel staff → Login and registration: signs in
- Hotel staff → Dashboard view: views metrics
- Hotel staff → Client management: manages clients
- Hotel staff → Room management: manages rooms
- Hotel staff → Reservation management: manages stays
- Login and registration → Authentication state: uses
- Route guard → Authentication state: checks (evidence: `frontend/middleware/auth.ts`)
- Dashboard view → API client: requests data
- Client management → API client: requests data
- Room management → API client: requests data
- Reservation management → API client: requests data
- API client → FastAPI application: sends API calls
- Nuxt application → FastAPI application: uses API
- FastAPI application → Database sessions: creates tables (evidence: `backend/main.py`)
- FastAPI application → API router: mounts routes (evidence: `backend/main.py`)
- API router → Authentication routes: registers (evidence: `backend/api/api.py`)
- API router → Client routes: registers (evidence: `backend/api/api.py`)
- API router → Room routes: registers (evidence: `backend/api/api.py`)
- API router → Reservation routes: registers (evidence: `backend/api/api.py`)
- API router → Dashboard routes: registers (evidence: `backend/api/api.py`)
- Authentication routes → Database sessions: opens sessions (evidence: `backend/api/endpoints/auth.py`)
- Authentication routes → Authentication logic: uses security logic (evidence: `backend/api/endpoints/auth.py`)
- Authentication routes → Audit logging: records events (evidence: `backend/api/endpoints/auth.py`)
- Client routes → Client service: delegates client work (evidence: `backend/api/endpoints/clients.py`)
- Client routes → Audit logging: records changes (evidence: `backend/api/endpoints/clients.py`)
- Client routes → Identity and permissions: requires identity (evidence: `backend/api/endpoints/clients.py`)
- Room routes → Room service: delegates room work
- Reservation routes → Reservation service: delegates booking work
- Dashboard routes → Dashboard metrics: requests metrics
- Database sessions → Hotel records: creates schema (evidence: `backend/core/database.py`)
- Reservation service → Hotel records: reads and writes (evidence: `backend/services/reserva_service.py`)
- Reservation service → Room records: checks availability (evidence: `backend/services/reserva_service.py`)
- Client service → Client records: reads and writes (evidence: `backend/services/client_service.py`)
- Dashboard metrics → Hotel records: queries bookings (evidence: `backend/services/dashboard_service.py`)
- Dashboard metrics → Client records: queries clients (evidence: `backend/services/dashboard_service.py`)
- Dashboard metrics → Room records: queries rooms (evidence: `backend/services/dashboard_service.py`)
- Identity and permissions → User records: loads identity (evidence: `backend/dependencies/auth.py`)
- Database sessions → User records: creates schema (evidence: `backend/core/database.py`)
