How rdcnaren/hotelwebapi works
This repository implements a hotel-management web application, an ASP.NET API, and shared DTOs. A user reaches the MVC home controller, which uses the hotel service; the API exposes hotel and amenity CRUD plus registration and login, with EF Core persistence and JWT generation for authentication. The source index supports the MVC service registration and controller dependencies, and the API persistence/auth links. The README is empty, and the sampled evidence does not establish the MVC service’s HTTP routing to the API, so that link is left dashed and unverified.
Main entry points: ApplicationDbContext.cs EF Core context · AuthService.cs Auth service · HotelsController.cs Hotel endpoints · HotelsAmenitiesController.cs Amenity endpoints
Components 16
Web application
- Home workflow
FirstWebApplication/Controllers/HomeController.cs - Hotel client service
FirstWebApplication/Services/HotelService.cs - Service interfaces
FirstWebApplication/Services/IServices/IHotelService.cs - MVC views
FirstWebApplication/Views/Home
API endpoints
- Hotel endpoints
FirstWeb_API/Controllers/HotelsController.cs - Amenity endpoints
FirstWeb_API/Controllers/HotelsAmenitiesController.cs
Identity
- Auth endpoints
FirstWeb_API/Controllers/AuthController.cs - Auth service
FirstWeb_API/Services/AuthService.cs - Auth interface
FirstWeb_API/Services/IAuthService.cs
Persistence and contracts
- EF Core context
FirstWeb_API/Data/ApplicationDbContext.cs - Hotel entity
FirstWeb_API/Models/Hotel.cs - Amenity entity
FirstWeb_API/Models/HotelAmenities.cs - User entity
FirstWeb_API/Models/User.cs - Shared DTOs
RoyalHotel.DTO - API response wrapper
RoyalHotel.DTO/ApiResponse.cs
Other components
- Web user
Connections 19
- Web user → Home workflow: requests pages
- Home workflow → Hotel client service: uses service
FirstWebApplication/Controllers/HomeController.cs - Home workflow → MVC views: renders
- Hotel client service → Hotel endpoints: calls API
- Hotel client service → Service interfaces: implements
FirstWebApplication/Services/HotelService.cs - Hotel endpoints → EF Core context: queries and saves
FirstWeb_API/Controllers/HotelsController.cs - Hotel endpoints → Shared DTOs: maps hotel data
FirstWeb_API/Controllers/HotelsController.cs - Hotel endpoints → API response wrapper: wraps results
FirstWeb_API/Controllers/HotelsController.cs - Amenity endpoints → EF Core context: queries and saves
FirstWeb_API/Controllers/HotelsAmenitiesController.cs - Amenity endpoints → Shared DTOs: maps amenity data
FirstWeb_API/Controllers/HotelsAmenitiesController.cs - Amenity endpoints → API response wrapper: wraps results
FirstWeb_API/Controllers/HotelsAmenitiesController.cs - Auth endpoints → Auth service: delegates auth
FirstWeb_API/Controllers/AuthController.cs - Auth service → Auth interface: implements
FirstWeb_API/Services/AuthService.cs - Auth service → EF Core context: reads and writes
FirstWeb_API/Services/AuthService.cs - Auth service → User entity: creates users
FirstWeb_API/Services/AuthService.cs - Auth service → Shared DTOs: maps auth data
FirstWeb_API/Services/AuthService.cs - EF Core context → Hotel entity: stores hotels
FirstWeb_API/Data/ApplicationDbContext.cs - EF Core context → Amenity entity: stores amenities
FirstWeb_API/Data/ApplicationDbContext.cs - EF Core context → User entity: stores users
FirstWeb_API/Data/ApplicationDbContext.cs