How noureddin94/restauranthotelads works
Project Type and Purpose
• This is a full-stack, multi-portal advertising platform.
• Backend is built on ASP.NET Core with a Clean Architecture (Core → Infrastructure → Application → API).
• Frontend consists of three separate Angular apps:
• hotel-portal (for hotel admins)
• restaurant-portal (for restaurant owners)
• room-display (for in-room TV/kiosk display)
• Purpose: allow restaurants to create/manage ads, assign them to hotel rooms, and enable hotels to display those ads on internal dashboards or room TVs.
File Structure Analysis
• Backend/
• Core: domain entities and interface contracts only
• Infrastructure: EF Core DbContext, repository implementations, migrations, seeding
• Application: DTOs, mapping profiles, business-rule services, interfaces → sits between Core & Infrastructure
• API: ASP.NET Core Web API controllers, JWT authentication, Swagger, appsettings
• Frontend/
• hotel-portal, restaurant-portal, room-display: each is a standalone Angular project with its own src/, angular.json, environments, etc.
• Solution file (RestaurantHotelAds.sln) ties all backend projects together.
Key Architectural Insights from README
• Layered Dependency:
Core ← Infrastructure ← Application ← API ← Frontend
• Clean separation of concerns: no infra/framework dependencies in Core, Application coordinates business logic, API handles HTTP.
• Three distinct user-facing portals share the same API.
Main Components
a. Backend Layers
1. Core Layer (Domain)
– Entities (Hotel, Restaurant, Room, Advertisement, AdRequest, ApplicationUser)
– Interfaces for repositories & UoW
2. Infrastructure Layer (Persistence)
– ApplicationDbContext (EF Core)
– Repository implementations
– Migrations & Seeder
3. Application Layer (Business Logic)
– Service classes (AdRequestService, HotelService, etc.)
– DTOs & MappingProfile
4. API Layer (Presentation)
– Controllers (HotelController, etc.)
– Authentication (JWT)
– Swagger/OpenAPI
b. Database
– SQL Server (via EF Core)
c. Frontend Portals
– Hotel Portal (Angular)
– Restaurant Portal (Angular)
– Room-Display Portal (Angular)
d. External/Infrastructure Services
– Identity/JWT Auth provider (could be internal or Azure AD)
– Logging/Monitoring (if present)
– CDN/Static hosting for Angular apps (optional)
Relationships and Data Flow
• Authentication flow: Angular apps obtain JWT from API’s AuthController → include JWT in API calls
• (Optional) Data seeding at startup: API → Infrastructure Seeder → Database
Architectural Patterns & Principles
• Clean (Hexagonal) Architecture: clear dependency inversion, domain at core, outward layers depend inward, business rules isolated.
• Repository + Unit of Work pattern in Infrastructure.
• DTO/Mapping pattern in Application for decoupling domain from API contracts.
• Modular Angular applications for separation of concerns.
Final Checklist
• [ ] Components labeled with project folder names and purposes
• [ ] Group boundaries for Backend vs Frontend
• [ ] Authentication/JWT flow path
• [ ] Database shown as a central persistence component