How leancodepl/corelibrary works
Main Components
• Core Modules – Represent the primary building blocks:
▫ The “Core” projects (found in src/Core) which handle bootstrapping and composition (Autofac and Microsoft DI).
▫ The “Domain” projects (in src/Domain) that implement DDD models, aggregates, identifiers, value objects, and more.
▫ The “Infrastructure” projects (in src/Infrastructure) which include integrations (audit logs, Azure identity, Firebase, logging, etc.), external service connectors as well as utilities for migration and force updates.
▫ The “CQRS” submodule (found in src/CQRS) which contains libraries that enable the CQRS pattern (commands, queries, operations) with specific ASP.NET Core support, middleware, and even MassTransit-based relays.
▫ “Helpers” (in src/Helpers) – small utility projects (e.g., user ID extractors, URL helpers).
▫ “Tools” – build-time enhancement tools such as code analyzers and code fix providers.
▫ “Testing” – dedicated testing helpers and integration test support.
• Cross-Cutting Aspects:
▫ CI/CD and Build System – The GitHub workflows and .NET build scripts (Directory.Build.props, Directory.Packages.props) that centrally manage properties and dependency versions.
▫ Documentation and Integration Infrastructure – The “docs” folder and cloud-tests-infrastructure which help ensure code quality and documentation delivery.
Relationships and Interactions
• That the “Core” layer acts as the bootstrapper and configuration arena that wires up the Domain, Infrastructure, and CQRS modules.
• “Domain” layer as the heart of business logic and DDD—used by both Core and Infrastructure.
• That “CQRS” serves as an application pattern layer with its own subdivisions (annotations, ASP.NET Core integration, execution, MassTransit relay, remote HTTP client, etc.) and that it communicates with the Domain models.
• That “Infrastructure” is segmented into multiple integrations (e.g., Audit Logs, Firebase, Kratos, Localization, Logging, etc.) that are consumed by client applications and potentially injected via the Core configuration.
• Demonstrate test modules as the supporting layer that exercises each of these modules and are structured similarly to the source code.
• An “External Systems” node to show integrations with services such as external APIs, databases, messaging systems, and observability layers.
Architectural Patterns & Design Principles
• Use of CQRS: separate Command, Query, and Operation handlers land in the src/CQRS folder.
• Domain-Driven Design approach in the Domain projects, with aggregates, entities, value objects, and domain events.
• How the Infrastructure layer provides loosely coupled integrations (via dependency injection) to external services.
• Central configuration management using MSBuild’s central package management and shared build configuration files.
• Optionally, note that the testing structure mirrors the source code layout, maintaining separation of concerns.
Relevant Technologies and Frameworks
• .NET Core and ASP.NET Core (including DI containers like Autofac and Microsoft DI).
• Middleware-based processing (in CQRS and Infrastructure).
• Code analyzers and tooling built with Roslyn (as seen in the Tools directory).
• CI/CD tools (GitHub workflows, Docker, docker-compose for integration tests).
• External systems like MassTransit and Firebase, along with third-party libraries (SendGrid, ConfigCat, OpenTelemetry).
Essential Elements
• Clear labels: Each component (e.g., “Core – Bootstrapping”, “Domain – DDD Models”, “CQRS – Commands/Queries”, “Infrastructure – Audit Logs, Azure Identity, etc.”).
• Annotations for architectural patterns: For example, add a note near the CQRS modules to indicate “Middleware processing,” or near the Domain modules to highlight “Aggregate Roots, Domain Events.”