How amitpnk/clean-architecture-asp.net-core works
And Illustrate the Main Components
• Presentation Layer:
• CleanArch.Api: Contains the Web API with controllers (e.g., AccountController, CategoryController, EventsController) and middleware (e.g., exception handling, API versioning, Swagger).
• CleanArch.App: A Blazor-based UI (containing Pages, Shared components, CSS, etc.).
• Application Layer:
• CleanArch.Application: Holds the core business logic, CQRS implementation with Commands, Queries, Validators, and Handlers.
• Contains the service registration (e.g., ApplicationServiceRegistration) and exception definitions.
• Domain Layer:
• CleanArch.Domain: Contains the core business entities, value objects, enums, and domain services that represent the business rules.
• Infrastructure Layer:
• CleanArch.Infrastructure: Provides implementations for cross-cutting services such as Email service (MailKit), CSV file export, identity management, and utility functionalities.
• CleanArch.CrossCuttingConcerns: Contains shared middleware, identity interfaces, OS services, and other utilities.
• Persistence Layer:
• CleanArch.Persistence: Implements Entity Framework Core Code First details including DbContexts (ApplicationDbContext, AuditableContext, IdentityContext), migrations, seeding, and repositories that adhere to repository and unit-of-work patterns.
• Testing:
• Multiple test projects (Unit tests, Integration tests) cover Application features, Persistence interactions, and common mocks.
Establish Relationships and Data Flow
• The Presentation Layer (both API and UI) calls into the Application Layer.
• The Application Layer triggers business logic and communicates with the Domain for core business rules.
• The Application Layer then interacts with the Persistence Layer (via repositories) and Infrastructure (for services like email and file export).
• Cross-cutting concerns, such as authentication (JWT), logging (Serilog), exception handling, and middleware, interact with multiple layers.
• How testing projects relate to the corresponding layers to ensure quality and integration.
Architectural Patterns & Design Principles
• Clean Architecture: Emphasize the concentric layers with Domain at the core and Infrastructure as an outer layer.
• CQRS & Mediator: Indicate the separation of commands and queries within the Application layer.
• Repository and Unit of Work: Note how data access abstraction is implemented in Persistence.
• Optionally, represent cross-cutting utilities (e.g., Automapper, Fluent validation, and logging) as supporting blocks that interface with multiple components.
Relevant Technologies and Frameworks
• .NET Core, ASP.NET Core for backend RESTful API.
• Blazor for the UI.
• Entity Framework Core for database interactions.
• Azure for deployment (as indicated in the deploy scripts and CI/CD files).
• Testing frameworks such as NUnit.
• Continuous integration elements by referencing the CI/CD pipeline configuration files (CircleCI, GitHub workflows).
Detail and Clarity
• Every layer and its role are captured as per the clean architecture principles.
• Incorporate deployment guides where necessary (for Azure deployments) or CI/CD configurations to show how the software transitions from code commit to production.