# srpatel07/smartstay architecture

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

- Interactive diagram: https://gitdiagram.com/srpatel07/smartstay
- Repository: https://github.com/srpatel07/smartstay

## Overview

SmartStay is a hotel-booking application with an Angular client and an ASP.NET Core API backed by SQL Server through Dapper and stored procedures. The user-facing journey is browsing hotels and rooms, then creating and managing bookings; authentication and profile management support protected actions. The API also exposes hotel administration, reviews, offers, packages, and dashboard capabilities. The excerpts establish several controller-to-repository calls and frontend route mappings; links for unsampled feature implementations and most client-to-API calls are omitted rather than inferred.

Main entry points: [`frontend/smartstay-ui/src/app/app.routes.ts`](https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/app.routes.ts) (Route dispatch), [`backend/SmartStay.API/Repositories/Implementations`](https://github.com/srpatel07/smartstay/tree/main/backend/SmartStay.API/Repositories/Implementations) (Other repositories), [`frontend/smartstay-ui/src/app/services/auth.service.ts`](https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/services/auth.service.ts) (Authentication UI), [`backend/SmartStay.API/Controllers/AuthController.cs`](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/AuthController.cs) (Identity and profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_routes["Route dispatch<br/>[app.routes.ts]"]
  node_auth_ui["Authentication UI<br/>[auth.service.ts]"]
  node_hotel_ui["Hotel browsing<br/>[hotels.ts]"]
  node_room_ui["Room selection<br/>[rooms.ts]"]
  node_booking_ui["Booking journey<br/>[booking.ts]"]
  node_my_bookings["My bookings<br/>[my-bookings.ts]"]
  node_admin_ui["Admin dashboard<br/>[admin.ts]"]
end

subgraph group_api["ASP.NET API"]
  node_auth_api["Identity and profile<br/>[AuthController.cs]"]
  node_hotel_api["Hotel catalog<br/>[HotelController.cs]"]
  node_room_api["Room catalog<br/>[RoomController.cs]"]
  node_booking_api["Booking management"]
  node_review_api["Reviews"]
  node_dashboard_api["Dashboard data"]
  node_offer_api["Offers<br/>[OfferController.cs]"]
  node_package_api["Packages"]
end

subgraph group_data["Persistence layer"]
  node_auth_repo["Identity repository<br/>[AuthRepository.cs]"]
  node_hotel_repo["Hotel repository<br/>[HotelRepository.cs]"]
  node_room_repo["Room repository<br/>[RoomRepository.cs]"]
  node_booking_repo["Booking repository"]
  node_reviews_repo["Review repository"]
  node_other_repos["Other repositories<br/>[Implementations]"]
end

subgraph group_features["Booking features"]
end

node_traveler(("Traveler"))
node_sqlserver[("SQL Server")]

node_traveler -->|"uses"| node_routes
node_routes -->|"routes to"| node_hotel_ui
node_routes -->|"routes to"| node_room_ui
node_routes -->|"routes to"| node_booking_ui
node_routes -->|"routes to"| node_my_bookings
node_routes -->|"routes to"| node_admin_ui
node_routes -->|"guards with"| node_auth_ui
node_auth_ui -->|"requests profile"| node_auth_api
node_auth_api -->|"calls"| node_auth_repo
node_hotel_api -->|"calls"| node_hotel_repo
node_room_api -->|"calls"| node_room_repo
node_booking_api -->|"calls"| node_booking_repo
node_review_api -->|"calls"| node_reviews_repo
node_auth_repo -->|"executes procedures"| node_sqlserver
node_booking_repo -->|"executes procedures"| node_sqlserver
node_reviews_repo -->|"executes procedures"| node_sqlserver
node_room_repo -->|"queries"| node_sqlserver
node_hotel_repo -.->|"queries"| node_sqlserver
node_dashboard_api -.->|"uses"| node_other_repos
node_offer_api -.->|"uses"| node_other_repos
node_package_api -.->|"uses"| node_other_repos

click node_routes "https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/app.routes.ts"
click node_auth_ui "https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/services/auth.service.ts"
click node_hotel_ui "https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/pages/hotels/hotels.ts"
click node_room_ui "https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/pages/rooms/rooms.ts"
click node_booking_ui "https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/pages/booking/booking.ts"
click node_my_bookings "https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/pages/my-bookings/my-bookings.ts"
click node_admin_ui "https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/pages/admin/admin.ts"
click node_auth_api "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/AuthController.cs"
click node_hotel_api "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/HotelController.cs"
click node_room_api "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/RoomController.cs"
click node_booking_api "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/BookingController.cs"
click node_review_api "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/ReviewController.cs"
click node_dashboard_api "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/DashboardController.cs"
click node_offer_api "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/OfferController.cs"
click node_package_api "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/PackageController.cs"
click node_auth_repo "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Repositories/Implementations/AuthRepository.cs"
click node_hotel_repo "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Repositories/Implementations/HotelRepository.cs"
click node_room_repo "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Repositories/Implementations/RoomRepository.cs"
click node_booking_repo "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Repositories/Implementations/BookingRepository.cs"
click node_reviews_repo "https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Repositories/Implementations/ReviewRepository.cs"
click node_other_repos "https://github.com/srpatel07/smartstay/tree/main/backend/SmartStay.API/Repositories/Implementations"

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_routes,node_auth_ui,node_hotel_ui,node_room_ui,node_booking_ui,node_my_bookings,node_admin_ui toneBlue
class node_auth_api,node_hotel_api,node_room_api,node_booking_api,node_review_api,node_dashboard_api,node_offer_api,node_package_api,node_sqlserver toneAmber
class node_auth_repo,node_hotel_repo,node_room_repo,node_booking_repo,node_reviews_repo,node_other_repos toneMint
class node_traveler toneIndigo
```

## Components

### Angular client

- [Route dispatch](https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/app.routes.ts): `frontend/smartstay-ui/src/app/app.routes.ts`
- [Authentication UI](https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/services/auth.service.ts): `frontend/smartstay-ui/src/app/services/auth.service.ts`
- [Hotel browsing](https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/pages/hotels/hotels.ts): `frontend/smartstay-ui/src/app/pages/hotels/hotels.ts`
- [Room selection](https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/pages/rooms/rooms.ts): `frontend/smartstay-ui/src/app/pages/rooms/rooms.ts`
- [Booking journey](https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/pages/booking/booking.ts): `frontend/smartstay-ui/src/app/pages/booking/booking.ts`
- [My bookings](https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/pages/my-bookings/my-bookings.ts): `frontend/smartstay-ui/src/app/pages/my-bookings/my-bookings.ts`
- [Admin dashboard](https://github.com/srpatel07/smartstay/blob/main/frontend/smartstay-ui/src/app/pages/admin/admin.ts): `frontend/smartstay-ui/src/app/pages/admin/admin.ts`

### ASP.NET API

- [Identity and profile](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/AuthController.cs): `backend/SmartStay.API/Controllers/AuthController.cs`
- [Hotel catalog](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/HotelController.cs): `backend/SmartStay.API/Controllers/HotelController.cs`
- [Room catalog](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/RoomController.cs): `backend/SmartStay.API/Controllers/RoomController.cs`
- [Booking management](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/BookingController.cs): `backend/SmartStay.API/Controllers/BookingController.cs`
- [Reviews](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/ReviewController.cs): `backend/SmartStay.API/Controllers/ReviewController.cs`
- [Dashboard data](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/DashboardController.cs): `backend/SmartStay.API/Controllers/DashboardController.cs`
- [Offers](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/OfferController.cs): `backend/SmartStay.API/Controllers/OfferController.cs`
- [Packages](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Controllers/PackageController.cs): `backend/SmartStay.API/Controllers/PackageController.cs`

### Persistence layer

- [Identity repository](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Repositories/Implementations/AuthRepository.cs): `backend/SmartStay.API/Repositories/Implementations/AuthRepository.cs`
- [Hotel repository](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Repositories/Implementations/HotelRepository.cs): `backend/SmartStay.API/Repositories/Implementations/HotelRepository.cs`
- [Room repository](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Repositories/Implementations/RoomRepository.cs): `backend/SmartStay.API/Repositories/Implementations/RoomRepository.cs`
- [Booking repository](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Repositories/Implementations/BookingRepository.cs): `backend/SmartStay.API/Repositories/Implementations/BookingRepository.cs`
- [Review repository](https://github.com/srpatel07/smartstay/blob/main/backend/SmartStay.API/Repositories/Implementations/ReviewRepository.cs): `backend/SmartStay.API/Repositories/Implementations/ReviewRepository.cs`
- [Other repositories](https://github.com/srpatel07/smartstay/tree/main/backend/SmartStay.API/Repositories/Implementations): `backend/SmartStay.API/Repositories/Implementations`

### Other components

- **Traveler**
- **SQL Server**

## Connections

- Traveler → Route dispatch: uses (evidence: `frontend/smartstay-ui/src/app/app.routes.ts`)
- Route dispatch → Hotel browsing: routes to (evidence: `frontend/smartstay-ui/src/app/app.routes.ts`)
- Route dispatch → Room selection: routes to (evidence: `frontend/smartstay-ui/src/app/app.routes.ts`)
- Route dispatch → Booking journey: routes to (evidence: `frontend/smartstay-ui/src/app/app.routes.ts`)
- Route dispatch → My bookings: routes to (evidence: `frontend/smartstay-ui/src/app/app.routes.ts`)
- Route dispatch → Admin dashboard: routes to (evidence: `frontend/smartstay-ui/src/app/app.routes.ts`)
- Route dispatch → Authentication UI: guards with (evidence: `frontend/smartstay-ui/src/app/app.routes.ts`)
- Authentication UI → Identity and profile: requests profile (evidence: `frontend/smartstay-ui/src/app/services/auth.service.ts`)
- Identity and profile → Identity repository: calls (evidence: `backend/SmartStay.API/Controllers/AuthController.cs`)
- Hotel catalog → Hotel repository: calls (evidence: `backend/SmartStay.API/Controllers/HotelController.cs`)
- Room catalog → Room repository: calls (evidence: `backend/SmartStay.API/Controllers/RoomController.cs`)
- Booking management → Booking repository: calls (evidence: `backend/SmartStay.API/Controllers/BookingController.cs`)
- Reviews → Review repository: calls (evidence: `backend/SmartStay.API/Controllers/ReviewController.cs`)
- Identity repository → SQL Server: executes procedures (evidence: `backend/SmartStay.API/Repositories/Implementations/AuthRepository.cs`)
- Booking repository → SQL Server: executes procedures (evidence: `backend/SmartStay.API/Repositories/Implementations/BookingRepository.cs`)
- Review repository → SQL Server: executes procedures (evidence: `backend/SmartStay.API/Repositories/Implementations/ReviewRepository.cs`)
- Room repository → SQL Server: queries (evidence: `backend/SmartStay.API/Repositories/Implementations/RoomRepository.cs`)
- Hotel repository → SQL Server: queries
- Dashboard data → Other repositories: uses
- Offers → Other repositories: uses
- Packages → Other repositories: uses
