How qwazsx/dotnet-webapi-starter-kit works
Core Components and Layers
• API/Host Layer:
• Represented by the “src/Host” directory.
• Contains controllers (e.g., Catalog, Identity, Dashboard) and configuration files.
• Acts as the HTTP entry point, handling routing, requests, and response logic.
• Application Layer (Core Application):
• Found in “src/Core/Application.”
• Contains business logic, use case implementations (such as Catalog, Identity, Multitenancy, Auditing), MediatR pipelines, CQRS commands and queries.
• Includes validation, caching, event notifications, and request/response DTOs.
• Domain Layer:
• In “src/Core/Domain.”
• Represents the domain entities, business rules, domain events, and aggregates—the heart of the business model.
• Infrastructure Layer:
• Located in “src/Infrastructure.”
• Provides implementations for persistence (EF Core, Dapper, repositories), external integrations (file storage, caching, mailing, logging), authentication services, middleware (e.g., error handling, logging), and even background job processing via Hangfire.
• Integration & Migration:
• “src/Migrators” contains different database migration projects for various database providers.
• DevOps and Deployment:
• Docker-compose files for container orchestration (in “docker-compose”) and Terraform scripts for AWS deployment (in “terraform”).
• The Makefile and CI/CD configuration (under .github/workflows) show how the project is built and deployed.
• Additional Tools:
• The “fsh-cli” tool is used to scaffold and update projects.
• Code snippets and example Postman collections illustrate API testing and developer support utilities.
Relationships and Data Flow
• The Application Layer communicates with the Domain Layer where all the business entities and rules reside, so indicate this “dependency inward.”
• That the persistence mechanisms (EF Core and Dapper in the Infrastructure/Persistence folder) interact with one or more relational databases (MSSQL, MySQL, Oracle, PostgreSQL) used in multi-tenancy.
Architectural Patterns and Design Principles
• Clearly demarcate the separation between the layers (Host, Application, Domain, Infrastructure).
• That this is an example of Clean Architecture (Onion Architecture) where dependencies point inward.
• Use of CQRS/MediatR for command/query separation and the repository pattern in the persistence layer.
• Multi-tenancy aspects by showing a “Tenant Management” component in both the Application and Infrastructure layers.
Detail Technologies, Frameworks, and External Tools
• .NET 7 and associated Clean Architecture implementations.
• Entity Framework Core for ORM plus Dapper for performance optimization.
• Hangfire for background job processing.
• MediatR for CQRS.
• Mapster for mapping between DTOs and domain entities.
• Serilog for logging.
• Integration with containerization (Docker) and infrastructure-as-code (Terraform for AWS ECS deployment).