Microservices¶
Target Architecture — Final-State Design
The 16 microservices below are the planned ConnectSoft.Factory.Templates.* decomposition of the Template & Library Platform. Each follows the Clean Architecture layering defined in Naming Conventions (Api/Application/DomainModel/PersistenceModel.NHibernate/FlowModel.MassTransit/DatabaseModel.Migrations/Options) and communicates through the canonical event envelope.
The platform is decomposed into two cooperating domains — Templates and Libraries — plus the Scaffold Engine that bridges them into generation. All services are tenant-aware, emit canonical events, and expose REST + gRPC. The full inventory:
Service inventory¶
| Microservice | Responsibility | APIs | Events (emits) | Aggregate Roots | Store |
|---|---|---|---|---|---|
TemplateRegistryService |
Owns template identity & catalog; registration and discovery | POST /templates, GET /templates/{templateId} |
TemplateRegistered |
Template |
Azure SQL / PostgreSQL + Redis |
TemplateVersionService |
Semantic versioning & immutable version snapshots | POST /templates/{templateId}/versions |
TemplateVersionCreated |
TemplateVersion |
Azure SQL + Azure Blob |
TemplateParameterService |
Manages typed parameter schemas & value validation | (internal) parameter schema ops | TemplateParameterSchemaDefined |
TemplateParameterSchema |
Azure SQL |
TemplateCompatibilityService |
Evaluates template/library/runtime compatibility rules | POST /templates/{templateId}/compatibility/evaluate |
CompatibilityEvaluated |
TemplateCompatibilityRule |
Azure SQL + Redis |
ScaffoldEngineService |
Executes templates; produces traced scaffold output | POST /templates/{templateId}/execute |
TemplateExecuted, ScaffoldGenerated |
TemplateExecution, ScaffoldOutput |
Azure Blob + Git + Azure SQL |
TemplateValidationService |
Lints/verifies template versions structurally | POST /templates/{templateId}/validate |
TemplateValidated |
TemplateValidationResult |
Azure SQL |
TemplatePublishingService |
Promotes validated versions to Published | (internal) publish ops | TemplatePublished |
TemplatePublication |
Azure SQL + Git |
TemplateUpgradeService |
Computes upgrade plans across template versions | (internal) upgrade ops | TemplateUpgradePlanCreated |
TemplateUpgradePlan |
Azure SQL |
TemplateAnalyticsService |
Adoption/reuse telemetry for templates | (internal) analytics queries | TemplateUsageRecorded |
(read models) | Azure SQL + Redis |
LibraryRegistryService |
Owns library identity, capabilities & catalog | POST /libraries, GET /libraries/{libraryId}, POST /libraries/search |
LibraryRegistered |
LibraryPackage, LibraryCapability |
Azure SQL / PostgreSQL + Redis |
LibraryVersionService |
Library version releases & declared dependencies | (internal) version ops | LibraryVersionCreated |
LibraryVersion |
Azure SQL + Azure Artifacts |
DependencyAnalyzerService |
Builds dependency graph; transitive resolution | (internal) scan ops | DependencyScanned |
DependencyGraph |
Azure SQL + Redis |
CompatibilityMatrixService |
Computes/caches the compatibility matrix | POST /libraries/compatibility/evaluate |
CompatibilityEvaluated |
CompatibilityMatrix |
Azure SQL + Redis |
PackagePublisherService |
Publishes packages to Azure Artifacts (NuGet) | (internal) publish ops | LibraryPublished |
PackagePublication |
Azure Artifacts + Azure SQL |
PackageUpgradeAdvisorService |
Recommends safe library upgrade paths | (internal) advisory queries | PackageUpgradeAdvised |
(read models over DependencyGraph) |
Azure SQL + Redis |
ApiClientCatalogService |
Catalogs external API client libraries | (facet of POST /libraries/search) |
ApiClientCataloged |
LibraryPackage (client facet) |
Azure SQL |
API column
Only the 10 public endpoints are listed in APIs; services marked (internal) expose gRPC and event-driven operations consumed within the platform rather than public REST. ApiClientCatalogService contributes results to the public POST /libraries/search rather than owning a distinct public route.
Domain grouping¶
flowchart TB
subgraph Templates["Template Domain"]
TRS["TemplateRegistryService"]
TVS["TemplateVersionService"]
TPS["TemplateParameterService"]
TCS["TemplateCompatibilityService"]
TVAL["TemplateValidationService"]
TPUB["TemplatePublishingService"]
TUS["TemplateUpgradeService"]
TAS["TemplateAnalyticsService"]
end
subgraph Bridge["Generation"]
SES["ScaffoldEngineService"]
end
subgraph Libraries["Library Domain"]
LRS["LibraryRegistryService"]
LVS["LibraryVersionService"]
DAS["DependencyAnalyzerService"]
CMS["CompatibilityMatrixService"]
PPS["PackagePublisherService"]
PUA["PackageUpgradeAdvisorService"]
ACC["ApiClientCatalogService"]
end
Service interaction diagram¶
flowchart LR
Mesh["Agent Mesh"] -->|register / version| TRS["TemplateRegistryService"]
TRS --> TVS["TemplateVersionService"]
TVS --> TPS["TemplateParameterService"]
TVS --> TVAL["TemplateValidationService"]
TVAL --> TPUB["TemplatePublishingService"]
Mesh -->|execute| SES["ScaffoldEngineService"]
SES --> TPS
SES --> TCS["TemplateCompatibilityService"]
TCS --> CMS["CompatibilityMatrixService"]
CMS --> DAS["DependencyAnalyzerService"]
SES -->|scaffold output| DevOps["DevOps & GitOps"]
Mesh -->|register / search| LRS["LibraryRegistryService"]
LRS --> LVS["LibraryVersionService"]
LVS --> DAS
LVS --> PPS["PackagePublisherService"]
DAS --> PUA["PackageUpgradeAdvisorService"]
TPUB --> TUS["TemplateUpgradeService"]
PPS --> Marketplace["Marketplace"]
LRS --> ACC["ApiClientCatalogService"]
TPUB -.->|events| Knowledge["Knowledge Platform"]
PPS -.->|events| Knowledge
SES -.->|events| Observability["Observability & Feedback"]
TAS -.->|usage| Observability
Cross-cutting concerns¶
- Multi-tenancy — every service scopes catalog metadata, executions, and analytics by
tenantIdviaConnectSoft.Extensions.Saas.AspNetCore; cross-tenant reads are forbidden at the repository layer. - Messaging — services publish and consume on Azure Service Bus through
ConnectSoft.Extensions.MessagingModel.MassTransit(the primary stack);FlowModel.MassTransitprojects host the consumers. - Persistence — registry metadata uses NHibernate over Azure SQL / PostgreSQL; version payloads use Azure Blob; packages use Azure Artifacts; template sources use Git; hot catalog and matrix data are cached in Redis.
- Observability — Serilog + OpenTelemetry via
ConnectSoft.Extensions.Observability, withtraceId/correlationIdpropagated from the envelope. - Governance — publishing and version promotion are gated by validation and (where configured) human approval surfaced from the Governance, Security & Compliance platform.