The goal of this project is implement a reusable .NET project template with a full set of functionality. You can treat it as a reference project to avoid doing repetitive work or for training purposes. Template is based on ports and adapters pattern.
The solution is divided into five parts:
-
API contains common set of packages with startup class that runs web service instance.
-
Application defines public contract for external applications. This is a gateway to an application core.
-
Core provides the business logic that is written in a plain language. It delivers domain specific logic and encapsulates the logic.
-
Infrastructure delivers the integration part like database, queue and other external providers.
-
Kitbag provides plugins as a shared library.
- Clone the repository and run the following commands:
- Install new template: dotnet new --install {REPO PATH} (root folder to this repo, more about dotnet new command here
- Create new solution: dotnet new tlj.paa -n {YOUR PROJECT NAME} -o {YOUR PROJECT NAME} (tlj.paa is a template short name defined in .template.config/template.json file)
- Database configuration:
- Provide database connection string in appsettings.json file in {YOUR PROJECT NAME}.API project
- Provide the same database connection string in {YOUR PROJECT NAME}.DatabaseMigration project
- Run {YOUR PROJECT NAME}.DatabaseMigration. Project applies necessary migrations to your database.
- Run {YOUR PROJECT NAME}.Api project.
- Open swagger page: http://localhost:{YOUR PORT}/index.html
-
Decorator Strategy 💱 By default solution is configured to use decorator strategy. README
-
CQRS : Implemented
ASYNC
-
Message Bus : Implemented
-
Idempotency : TBD
-
Outbox Pattern : 📥 Kitbag.Builder.Outbox and Kitbag.Builder.Outbox.EntityFramework (used EF as a event log) are libraries that provide Outbox Pattern functionality README
STORAGE:
-
Unit Of Work : Unit of Work with AuditLog is added
-
Database Migrations 📇 Kitbag provides a standardise approach to handling database changes. README
-
Audit Trail 📑 Kitbag provides audit trail mechanism that can track any database changes without making any unnecessary modification in existing code README
Observability: