Skip to content

SaaS bounded contexts and ConnectSoft.Saas.*Template backend repositories

Each in-scope bounded context is delivered as one Git repository named ConnectSoft.Saas.<Context>Template. That repository:

  • Includes ConnectSoft.BaseTemplate as a Git submodule (not a separate “MicroserviceTemplate.Base” branding in SaaS naming).
  • Ships a dotnet new template pack producing a DDD-oriented solution (Application, Domain, EntityModel, persistence/messaging as needed).
  • Publishes ServiceModel / RestApi / Grpc projects for external consumers (aligned with EPIC-SAAS-SVC-SURFACE in saas-extensions-and-templates-epics.md).

Out of scope contexts

Audit & compliance, Notifications, and Configuration / feature-flag platforms are not part of this template program; they may adopt the same patterns later under other initiatives.

Context matrix

All five repositories live under C:\Git\ConnectSoft\SAAS\ and follow the one-aggregate-root-per-repo rule. Each ships its own .gitmodules pointing base-template/ at ConnectSoft.BaseTemplate.

Bounded context Template repository (backend) dotnet new short name Aggregate root Topic prefix
Tenants ConnectSoft.Saas.TenantsTemplate connectsoft-saas-tenants Tenant tenants.domain.v1
Products catalog ConnectSoft.Saas.ProductsCatalogTemplate connectsoft-saas-productscatalog Product catalog.domain.v1
Entitlements ConnectSoft.Saas.EntitlementsTemplate connectsoft-saas-entitlements Entitlement entitlements.v1
Billing ConnectSoft.Saas.BillingTemplate connectsoft-saas-billing Subscription billing.subscriptions.v1
Metering ConnectSoft.Saas.MeteringTemplate connectsoft-saas-metering UsageMeter metering.usage.v1

Related documents:

Technology defaults locked for every SaaS repo:

  • Messaging: MassTransit (built-in outbox; no custom outbox tables).
  • Actors / runtime: Orleans where applicable; grain keys tenant-scoped.
  • ServiceModel: REST + gRPC only.
  • Persistence: NHibernate only, multi-dialect (SQL Server / PostgreSQL / MySQL / Oracle / SQLite) via Persistence:Dialect option.
  • Scheduler: Hangfire.
  • Cache: Redis.
  • Telemetry: OpenTelemetry + Serilog; each repo ships a full observability stack (OTel Collector, Prometheus, Grafana, Loki, Tempo/Jaeger).

Company canonical model

Aggregate and entity names, relationships, and cross-context rules are defined in the ConnectSoft.CompanyDocumentation repository: docs/saas/framework/saas-platform-ddd-entities.md (published under SaaS & Solutions → SaaS Framework).

Optional generic scaffold

  • ConnectSoft.Saas.MicroserviceTemplate (optional) — parameterizable dotnet new template for a non–context-specific SaaS-flavored microservice (same submodule to ConnectSoft.BaseTemplate). Use when a team needs a generic SaaS backend before a dedicated context template exists.

Delivery waves (suggested)

  1. Core path: Tenants → Product catalog → Entitlements (enables catalog + access stories).
  2. Monetization path: Billing → Metering (depends on stable product/edition/feature identifiers from catalog).

Blazor alignment

  • Each context may have one or more MFE template repositories for admin or self-service UI; they consume ServiceModel packages and OIDC via the Authorization Server pattern.
  • ConnectSoft.Blazor.Shell.Saas hosts MFEs and shared navigation; see ConnectSoft Blazor Templates HLD and SaaS platform solution plan.

Reference implementation

  • ConnectSoft.Saas.ProductCatalogDemo — product-catalog–shaped prototype in the ConnectSoft Git project; useful for extracting Phase 2 library contracts—not a full multi-tenant platform by itself.