How phanthethanh0209/projectwebapi_flightdocssystem works
• API Layer (Controllers): Represented by the Controllers folder (e.g., AuthController, FlightController, DocumentController, etc.). This is the entry point for client requests.
• Business/Service Layer: Captured in the Services folder. This layer encapsulates business logic such as managing flights, documents, users, and permissions.
• Data Access Layer: Comprised of the Repository folder (with GenericRepository and UnitOfWork implementations) along with the Data folder housing the DbContext (MyDBContext) and models.
• Domain Models and DTOs: The Data and DTO folders hold the domain models and data transfer objects respectively. These are critical for transferring data between the layers.
• Mapping Layer: The Mapper folder includes AutoMapper configuration which bridges the gap between DTOs and domain models.
• Authorization & Validation: Separate folders for Authorization (custom attributes and permission handlers) and Validation (using Fluent Validation) ensure security and integrity in data processing.
• Database: Highlight the use of Microsoft SQL Server as indicated in the appsettings.json and the Migrations folder (EF Core migrations).
• Configuration and Startup: The Program.cs file serves as the app’s bootstrap for configuration and dependency injection.
• Client Request → API Layer (Controllers): Mark how API controllers receive RESTful calls.
• Services → Repository: Illustrate the dependency whereby services use the repository pattern to fetch or persist data.
• Repository ↔ Database: Indicate the communication channel between repositories and the SQL Server database.
• AutoMapper/Mapping: Show how the mapping layer converts between DTOs and domain models on both incoming requests and outgoing responses.
Important Architectural Patterns and Principles
• Layered Architecture: Clearly separate presentation, business, and data access layers.
• Repository & Unit of Work: Emphasize the pattern used to abstract data operations.
• DTOs & AutoMapper: Show that data transformations are systematically handled by AutoMapper based mappers.
• JWT-Based Authentication: Indicate the use of JWT for securing endpoints.
• Code-First Entity Framework Core: Note that EF Core migrations are used to manage database versioning.
• File Upload Management: Represent the Upload folder which is used to store flight document files.
Technologies and Frameworks
• Microsoft SQL Server as the primary data storage.
• Use of Entity Framework Core for ORM, AutoMapper for object mapping, and Swagger for API documentation.
• Middleware (like JWT validation) used in the API pipeline.