# gbeto21/ultimate-asp.net-core-web-api-development-guide architecture

> Architecture diagram of the GitHub repository gbeto21/ultimate-asp.net-core-web-api-development-guide, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gbeto21/ultimate-asp.net-core-web-api-development-guide
- Repository: https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide

## Overview

HotelListingAPI is an ASP.NET Core API for account registration and token-based authentication, plus country and hotel listing management. The main workflows are HTTP requests dispatched to controllers, which delegate domain operations to repositories and return mapped API responses; repository operations read and write the EF Core database. Account operations use ASP.NET Identity to manage users, roles, and refresh tokens. The README offers no further product detail, and unsampled implementation is represented only where the tree or sampled wiring supports it.

Main entry points: [`HotelListingAPI/Program.cs`](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Program.cs) (Application Pipeline), [`HotelListingAPI/Controllers/CountriesController.cs`](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Controllers/CountriesController.cs) (Countries API), [`HotelListingAPI/Controllers/HotelsController.cs`](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Controllers/HotelsController.cs) (Hotels API), [`HotelListingAPI/Data/HotelListingDbContext.cs`](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Data/HotelListingDbContext.cs) (EF Core Context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_program["Application Pipeline<br/>[Program.cs]"]
  node_countries["Countries API"]
  node_hotels["Hotels API"]
  node_account["Account API"]
  node_weather["Weather API"]
  node_middleware["Exception Handling"]
end

subgraph group_domain["Listing Operations"]
  node_mapping["DTO Mapping<br/>[MapperConfig.cs]"]
  node_country_repo["Country Repository"]
  node_hotel_repo["Hotel Repository"]
  node_generic_repo["Generic Repository"]
  node_country_model["Country Records<br/>[Country.cs]"]
  node_hotel_model["Hotel Records<br/>[Hotel.cs]"]
end

subgraph group_auth["Identity and Auth"]
  node_auth_manager["Auth Manager<br/>[AuthManager.cs]"]
  node_identity["ASP.NET Identity"]
  node_user_model["API User<br/>[ApiUser.cs]"]
end

subgraph group_data["Persistence"]
  node_db_context["EF Core Context"]
  node_database[("Hotel Listing DB")]
end

node_client(("API Client"))
node_sql_server[("SQL Server")]

node_client -->|"sends requests"| node_program
node_program -->|"dispatches routes"| node_countries
node_program -->|"dispatches routes"| node_hotels
node_program -->|"dispatches routes"| node_account
node_program -->|"dispatches routes"| node_weather
node_program -->|"handles exceptions"| node_middleware
node_countries -->|"calls"| node_country_repo
node_countries -->|"maps DTOs"| node_mapping
node_hotels -->|"calls"| node_hotel_repo
node_hotels -->|"maps DTOs"| node_mapping
node_country_repo -->|"inherits operations"| node_generic_repo
node_hotel_repo -->|"inherits operations"| node_generic_repo
node_generic_repo -->|"queries and saves"| node_db_context
node_country_repo -->|"loads country details"| node_db_context
node_db_context -->|"reads and writes"| node_database
node_database -->|"hosted by"| node_sql_server
node_account -->|"calls"| node_auth_manager
node_auth_manager -->|"manages accounts and tokens"| node_identity
node_identity -->|"uses EF store"| node_db_context
node_identity -->|"manages users"| node_user_model
node_client -->|"receives API results"| node_countries
node_client -->|"receives API results"| node_hotels
node_client -->|"receives auth results"| node_account
node_client -->|"receives forecasts"| node_weather

click node_program "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Program.cs"
click node_countries "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Controllers/CountriesController.cs"
click node_hotels "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Controllers/HotelsController.cs"
click node_account "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Controllers/AccountController.cs"
click node_weather "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Controllers/WeatherForecastController.cs"
click node_mapping "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Configurations/MapperConfig.cs"
click node_country_repo "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Repository/CountriesRepository.cs"
click node_hotel_repo "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Repository/HotelsRepository.cs"
click node_generic_repo "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Repository/GenericRepository.cs"
click node_country_model "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Data/Country.cs"
click node_hotel_model "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Data/Hotel.cs"
click node_auth_manager "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Repository/AuthManager.cs"
click node_user_model "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Data/ApiUser.cs"
click node_middleware "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Middleware/ExceptionMiddleware.cs"
click node_db_context "https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Data/HotelListingDbContext.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_program,node_countries,node_hotels,node_account,node_weather,node_middleware,node_client toneBlue
class node_mapping,node_country_repo,node_hotel_repo,node_generic_repo,node_country_model,node_hotel_model,node_sql_server toneAmber
class node_auth_manager,node_identity,node_user_model toneMint
class node_db_context,node_database toneRose
```

## Components

### HTTP API

- [Application Pipeline](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Program.cs): `HotelListingAPI/Program.cs`
- [Countries API](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Controllers/CountriesController.cs): `HotelListingAPI/Controllers/CountriesController.cs`
- [Hotels API](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Controllers/HotelsController.cs): `HotelListingAPI/Controllers/HotelsController.cs`
- [Account API](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Controllers/AccountController.cs): `HotelListingAPI/Controllers/AccountController.cs`
- [Weather API](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Controllers/WeatherForecastController.cs): `HotelListingAPI/Controllers/WeatherForecastController.cs`
- [Exception Handling](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Middleware/ExceptionMiddleware.cs): `HotelListingAPI/Middleware/ExceptionMiddleware.cs`

### Listing Operations

- [DTO Mapping](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Configurations/MapperConfig.cs): `HotelListingAPI/Configurations/MapperConfig.cs`
- [Country Repository](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Repository/CountriesRepository.cs): `HotelListingAPI/Repository/CountriesRepository.cs`
- [Hotel Repository](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Repository/HotelsRepository.cs): `HotelListingAPI/Repository/HotelsRepository.cs`
- [Generic Repository](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Repository/GenericRepository.cs): `HotelListingAPI/Repository/GenericRepository.cs`
- [Country Records](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Data/Country.cs): `HotelListingAPI/Data/Country.cs`
- [Hotel Records](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Data/Hotel.cs): `HotelListingAPI/Data/Hotel.cs`

### Identity and Auth

- [Auth Manager](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Repository/AuthManager.cs): `HotelListingAPI/Repository/AuthManager.cs`
- **ASP.NET Identity**
- [API User](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Data/ApiUser.cs): `HotelListingAPI/Data/ApiUser.cs`

### Persistence

- [EF Core Context](https://github.com/gbeto21/ultimate-asp.net-core-web-api-development-guide/blob/master/HotelListingAPI/Data/HotelListingDbContext.cs): `HotelListingAPI/Data/HotelListingDbContext.cs`
- **Hotel Listing DB**

### Other components

- **API Client**
- **SQL Server**

## Connections

- API Client → Application Pipeline: sends requests
- Application Pipeline → Countries API: dispatches routes
- Application Pipeline → Hotels API: dispatches routes
- Application Pipeline → Account API: dispatches routes
- Application Pipeline → Weather API: dispatches routes
- Application Pipeline → Exception Handling: handles exceptions
- Countries API → Country Repository: calls
- Countries API → DTO Mapping: maps DTOs
- Hotels API → Hotel Repository: calls
- Hotels API → DTO Mapping: maps DTOs
- Country Repository → Generic Repository: inherits operations
- Hotel Repository → Generic Repository: inherits operations
- Generic Repository → EF Core Context: queries and saves
- Country Repository → EF Core Context: loads country details
- EF Core Context → Hotel Listing DB: reads and writes
- Hotel Listing DB → SQL Server: hosted by
- Account API → Auth Manager: calls
- Auth Manager → ASP.NET Identity: manages accounts and tokens
- ASP.NET Identity → EF Core Context: uses EF store
- ASP.NET Identity → API User: manages users
- API Client → Countries API: receives API results
- API Client → Hotels API: receives API results
- API Client → Account API: receives auth results
- API Client → Weather API: receives forecasts
