How gururajkl/whitelagoon works
Main Components
• Domain Layer (WhiteLagoon.Domain): Contains the core business entities such as Amenity, Booking, Villa, VillaNumber, ApplicationUser, etc. This is the heart of the application’s business logic.
• Application Layer (WhiteLagoon.Application): Houses business logic, Data Transfer Objects (DTOs) like LineChartDTO, PieChartDTO, RadialBarChartDTO, service interfaces (e.g., IDashboardService), and concrete service implementations (e.g., DashboardService). This layer defines contracts (interfaces) for repositories and units of work.
• Infrastructure Layer (WhiteLagoon.Infrastructure): Implements data persistence logic including the ApplicationDbContext, repositories (e.g., AmenityRepository, VillaRepository), UnitOfWork, and database migrations for evolving the database schema (migrating Identity, adding properties, seeding data, etc.).
• Web Layer (WhiteLagoon.Web): Delivers the presentation/UI part of the MVC-based application with Controllers, Views, ViewModels, and static assets (CSS, JavaScript files including charting scripts, and libraries like Bootstrap and jQuery). It also contains Identity controllers (AccountController) and view configurations for login, registration, and error handling.
Relationships and Interactions
• The Web layer (UI/Controllers) interacts with the Application layer services and indirectly triggers business logic.
• The Application layer defines repository interfaces that are concretely implemented in the Infrastructure layer. This ensures a clear separation of concerns and encourages dependency inversion.
• The Infrastructure layer deals with data access including database context management and seeding, and it is decoupled from the UI by its use of interfaces from the Application layer.
• The Domain layer sits at the center, with all business entities and rules, ensuring that both Application and Infrastructure layers depend on the Domain rather than the other way around.
• ASP.NET Identity is integrated across layers (primarily via the Web and Infrastructure projects) to secure access, with corresponding entities and migrations as seen in the file tree.
Architectural Patterns and Design Principles
• Clean Architecture: The structure enforces separation of concerns with distinct layers for Domain, Application, Infrastructure, and Presentation (Web).
• Repository and Unit of Work Patterns: These are evident in the Infrastructure layer where repository interfaces and concrete implementations (including UnitOfWork) are used to manage data persistence.
• MVC Pattern: The presentation layer (Web) follows a Model-View-Controller design, as shown in the Controllers, Views, and ViewModels directories.
• Use of Data Transfer Objects (DTOs): The Application layer leverages DTOs to transfer data between layers, particularly for dashboard/chart functionalities, indicating a design geared toward decoupled communication among layers.
Relevant Technologies and Frameworks
• ASP.NET (most likely Core based on the file structure and project files)
• ASP.NET Identity for authentication and security.
• Entity Framework (evident from migrations and DbContext in the Infrastructure layer).
• JavaScript libraries for advanced charting (evident from ApexCharts files and custom dashboard JS scripts).
• Front-end libraries such as Bootstrap and jQuery for responsive design and enhanced UI functionality.