|
1 | 1 | # TaskHub.Shared |
2 | | -**TaskHub.Shared** is the core foundation of the TaskHub ecosystem — a collection of lightweight, reusable building blocks that power all TaskHub microservices. |
3 | | -It provides shared primitives, abstractions, contracts, and infrastructure adapters designed around **Domain-Driven Design (DDD)** and **Clean Architecture** principles. |
| 2 | +TaskHub.Shared is a set of small, independent modules that act as the shared foundation for microservices. |
| 3 | +It provides shared primitives, abstractions, contracts, and infrastructure adapters designed around Domain-Driven Design (DDD) and Clean Architecture principles. |
4 | 4 |
|
5 | 5 |
|
6 | 6 | ## Overview |
7 | 7 | TaskHub.Shared contains the fundamental components and patterns used across all bounded contexts in TaskHub. |
8 | 8 |
|
9 | | - |
10 | 9 | ## Modules |
| 10 | +**TaskHub.Shared.Primitives** — Core value objects, identifiers, and base types shared across all domains. |
| 11 | +**TaskHub.Shared.Domain** — Base entities, aggregates, domain events, and helpers for implementing rich domain models. |
| 12 | +**TaskHub.Shared.Response** — Unified result system (`Result`, `ValueResult<T>`, `ResultFactory`) for consistent success/error handling. |
| 13 | + |
| 14 | +**TaskHub.Shared.Commands.Abstractions** — Abstractions for the command pipeline (interfaces for command handlers, behaviors, buses). |
| 15 | + |
| 16 | +**TaskHub.Shared.Commands.Bus** — Default in-process command bus implementation with behavior orchestration (behaviors pipeline, cross-cutting concerns). |
| 17 | + |
| 18 | +**TaskHub.Shared.Events.Abstractions** — Domain event abstractions for cross-service communication and eventual consistency patterns. |
| 19 | + |
| 20 | +**TaskHub.Shared.Persistence.Abstractions** — Interfaces for read/write repositories, unit of work, and persistence contracts. |
| 21 | +**TaskHub.Shared.Infrastructure.EfCore** — EF Core helpers, base configurations, and interceptors for database integration. |
11 | 22 |
|
12 | | -- **TaskHub.Shared.Primitives** — Core value objects, identifiers, and base types shared across all domains. |
13 | | -- **TaskHub.Shared.Response** — Unified result system (`Result`, `ValueResult<T>`, `ResultFactory`) for consistent success/error handling. |
14 | | -- **TaskHub.Shared.Commands.Abstractions** — Abstractions for the command pipeline (interfaces for command handlers, behaviors, buses). |
15 | | -- **TaskHub.Shared.Commands.Bus** — Default in-process command bus implementation with behavior orchestration. |
16 | | -- **TaskHub.Shared.Events.Abstractions** — Domain event abstractions for cross-service communication. |
17 | | -- **TaskHub.Shared.Persistence.Abstractions** — Interfaces for read/write repositories, unit of work, and persistence contracts. |
18 | | -- **TaskHub.Shared.Infrastructure.EfCore** — EF Core helpers, interceptors, and base configurations for database integration. |
19 | | -- **TaskHub.Shared.Redis** — Integration with Redis for caching and distributed state management. |
20 | | -- **TaskHub.Shared.OpenTelemetry** — Preconfigured telemetry setup for metrics, traces, and logs (Tempo, Prometheus, Loki). |
21 | | -- **TaskHub.Shared.Swagger** — Common Swagger and API documentation configuration for ASP.NET Core services. |
22 | | -- **TaskHub.Shared.GeoCoding.Abstractions** — Abstractions for geocoding providers. |
23 | | -- **TaskHub.Shared.GeoCoding.Nominatim** — Implementation of the geocoding service using the Nominatim API. |
24 | | -- **TaskHub.Shared.GeoCoding.Bootstraper** — Provides a lightweight entry-point that simplifies service startup and composition across TaskHub microservices.. |
| 23 | +**TaskHub.Shared.Redis** — Integration with Redis for caching and distributed state management. |
| 24 | +**TaskHub.Shared.RateLimiter** — Reusable rate-limiting primitives and policies for protecting APIs and internal pipelines. |
25 | 25 |
|
| 26 | +**TaskHub.Shared.Authorization.Abstractions** — Authorization contracts, roles/permissions abstractions, and policies shared across services. |
| 27 | +**TaskHub.Shared.Authorization.Identity** — Identity-related models and helpers used by TaskHub services (users, claims, roles). |
| 28 | + |
| 29 | +**TaskHub.Shared.Swagger** — Common Swagger / OpenAPI configuration for ASP.NET Core services (conventions, filters, defaults). |
| 30 | +**TaskHub.Shared.Versioning** — Shared conventions and helpers for API versioning across TaskHub microservices. |
| 31 | +**TaskHub.Shared.ConfigurationTools** — Utilities for configuration binding, validation, and environment-specific configuration setup. |
| 32 | +**TaskHub.Shared.Bootstraper** — Opinionated startup helpers to compose TaskHub modules into a microservice with minimal boilerplate. |
| 33 | + |
| 34 | +**TaskHub.Shared.GeoCoding.Abstractions** — Abstractions for geocoding providers. |
| 35 | +**TaskHub.Shared.GeoCoding.Nominatim** — Implementation of the geocoding service using the Nominatim API. |
| 36 | + |
| 37 | +**TaskHub.Observability.Metrics.Abstractions** — Abstractions and options for metrics collection (meters, counters, histograms) used across services. |
| 38 | +**TaskHub.Observability.Metrics.Implementation** — Default metrics implementation built on top of `IMeterFactory` and OpenTelemetry metrics. |
| 39 | +**TaskHub.Observability.Traces.Abstractions** — Tracing contracts and ActivitySource abstractions for instrumenting command and HTTP pipelines. |
| 40 | +**TaskHub.Observability.Traces** — Ready-to-use tracing helpers (e.g., factories, decorators, behaviors) for consistent span creation. |
| 41 | +**TaskHub.Observability.OpenTelemetry** — Preconfigured OpenTelemetry setup (resource, exporters, processors) for metrics, traces, and logs (Tempo, Prometheus, Loki). |
26 | 42 |
|
27 | 43 | ## Design Principles |
28 | | -- **DDD & Clean Architecture** — separation between abstractions and implementations. |
29 | | -- **Lightweight by Design** — each project compiles into a minimal, focused package. |
30 | | -- **Composability** — services import only the shared modules they depend on. |
31 | | -- **Cross-Service Consistency** — unified patterns for results, commands, events, and telemetry. |
| 44 | +**DDD & Clean Architecture** — Clear separation between abstractions and implementations. |
| 45 | +**Lightweight by Design** — Each project compiles into a minimal, focused package. |
| 46 | +**Composability** — Services import only the shared modules they actually depend on. |
| 47 | +**Cross-Service Consistency** — Unified patterns for results, commands, events, authorization, and observability (metrics, traces, logs). |
| 48 | + |
| 49 | +## About |
| 50 | +Author: [Andrey Serdyuk](https://www.linkedin.com/in/andrey-serdyuk) |
| 51 | +Docs: <https://taskhub-server.github.io/TaskHub.Shared/> |
| 52 | + |
| 53 | +## License |
| 54 | +[MIT](./LICENSE) |
0 commit comments