Platform Template¶
The ConnectSoft Platform Template provides a ready-to-use solution for building multi-service SaaS platforms with shared infrastructure, tenant management, and platform capabilities. This template generates a complete platform structure with multiple microservices, shared libraries, and infrastructure components.
Overview¶
The Platform Template generates a production-ready SaaS platform foundation that includes multiple microservices, shared infrastructure, tenant management, API gateway, and platform capabilities. It follows ConnectSoft's platform architecture principles and best practices for multi-tenant SaaS platforms.
When to Use This Template¶
Use the Platform Template when:
- Building multi-service SaaS platforms
- Creating platforms with shared infrastructure
- Developing platforms with tenant management
- Building platforms with platform capabilities
- Creating platforms that need horizontal scaling
- Building platforms with microservices architecture
Key Features¶
Multi-Service Architecture¶
- Microservices: Multiple independent services
- API Gateway: Centralized API management
- Shared Libraries: Reusable components
- Infrastructure: Shared infrastructure components
Tenant Management¶
- Multi-Tenancy: Tenant isolation and management
- Tenant Provisioning: Automated tenant setup
- Tenant Configuration: Per-tenant configuration
- Tenant Isolation: Data and resource isolation
Platform Capabilities¶
- Identity Platform: Authentication and authorization
- Audit Platform: Audit logging and compliance
- Config Platform: Configuration management
- Billing Platform: Subscription and billing
- Notification Platform: Messaging and notifications
Infrastructure¶
- Cloud-Native: Azure and AWS cloud infrastructure support
- Infrastructure as Code: Pulumi (C#) for type-safe, multi-cloud infrastructure provisioning
- Azure Infrastructure Stack:
AzureInfrastructureStack.csfor Azure resources - AWS Infrastructure Stack:
AwsInfrastructureStack.csfor AWS resources - Pulumi Configuration: Stack-based configuration with environment-specific settings
- Resource Management: Service Bus, Key Vault, Cosmos DB, SQL Database, Redis, Storage Accounts, App Services, and more
- CI/CD Pipelines: Automated deployment with infrastructure provisioning
- Observability: Logging, metrics, tracing with OpenTelemetry support
Generated Structure¶
The template generates a complete platform structure:
YourPlatformName/
├── src/
│ ├── Services/
│ │ ├── Service1/
│ │ ├── Service2/
│ │ └── ...
│ ├── Libraries/
│ │ ├── Shared/
│ │ └── ...
│ └── Infrastructure/
│ ├── API Gateway/
│ └── ...
├── ConnectSoft.PlatformTemplate.InfrastructureModel/
│ ├── AzureInfrastructureStack.cs
│ ├── AwsInfrastructureStack.cs
│ ├── Pulumi.yaml
│ └── Pulumi.{env}.yaml
├── pipelines/
│ └── ...
└── docs/
Template Parameters¶
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
PlatformName |
string | Yes | Platform |
Name of the platform |
PlatformDescription |
string | Yes | Platform |
Platform description |
ServiceCount |
int | No | 3 |
Number of initial services |
IncludeApiGateway |
bool | No | true |
Include API Gateway |
IncludeIdentity |
bool | No | true |
Include Identity Platform |
Quick Start¶
Step 1: Create Platform¶
dotnet new connectsoft-platform \
--name MyPlatform \
--platform-description "My SaaS Platform" \
--service-count 5
Step 2: Configure Services¶
Configure each service with domain-specific logic.
Step 3: Deploy Infrastructure¶
Deploy infrastructure using Pulumi:
# Navigate to infrastructure project
cd ConnectSoft.PlatformTemplate.InfrastructureModel
# Set Pulumi stack (dev, staging, prod)
pulumi stack select dev
# Configure stack settings (Azure example)
pulumi config set resourceGroupName my-resource-group
pulumi config set location "East US"
pulumi config set sqlDatabaseServerName my-sql-server
pulumi config set sqlServerAdminLogin admin
pulumi config set --secret sqlServerAdminPassword "your-password"
pulumi config set sqlDatabaseName my-database
pulumi config set redisCacheName my-redis
pulumi config set appServicePlanName my-app-plan
pulumi config set webAppName my-web-app
pulumi config set appInsightsName my-app-insights
pulumi config set appConfigName my-app-config
pulumi config set serviceBusNamespaceName my-servicebus
pulumi config set keyVaultName my-keyvault
pulumi config set tenantId "your-tenant-id"
pulumi config set cosmosDbAccountName my-cosmos
pulumi config set cosmosDbDatabaseName my-cosmos-db
pulumi config set cosmosDbContainerName my-container
pulumi config set storageAccountName mystorageaccount
pulumi config set environment dev
# Preview infrastructure changes
pulumi preview
# Deploy infrastructure
pulumi up
Infrastructure Model Features:
- Multi-Cloud Support: Separate stack implementations for Azure (
AzureInfrastructureStack.cs) and AWS (AwsInfrastructureStack.cs) - Type-Safe Infrastructure: C#-based infrastructure definitions with IntelliSense and compile-time checking
- Stack Management: Environment-specific configurations via
Pulumi.{env}.yamlfiles - Secret Management: Secure handling of sensitive values using Pulumi secrets
- Resource Provisioning: Comprehensive Azure/AWS resources including:
- Compute: App Services, Function Apps, Container Instances
- Storage: Blob Storage, Cosmos DB, SQL Database
- Messaging: Service Bus, Event Hubs, SQS/SNS
- Security: Key Vault, Managed Identities, RBAC
- Observability: Application Insights, Log Analytics, monitoring
Step 4: Deploy Services¶
Deploy services using CI/CD pipelines.
Architecture¶
Platform Structure¶
graph TB
Gateway[API Gateway] --> Service1[Service 1]
Gateway --> Service2[Service 2]
Gateway --> Service3[Service 3]
Service1 --> Identity[Identity Platform]
Service2 --> Identity
Service3 --> Identity
Service1 --> Audit[Audit Platform]
Service2 --> Audit
Service3 --> Audit
Service1 --> Config[Config Platform]
Service2 --> Config
Service3 --> Config
style Gateway fill:#e3f2fd
style Identity fill:#e8f5e9
style Audit fill:#fff3e0
style Config fill:#f3e5f5
Design Principles¶
- Microservices: Independent, scalable services
- Multi-Tenancy: Tenant isolation and management
- Event-Driven: Event-driven communication
- Cloud-Native: Multi-cloud infrastructure (Azure and AWS) with Pulumi
- Observability: Comprehensive monitoring with OpenTelemetry
Integration with AI Factory¶
The Platform Template is used by:
- Platform Generator Agent: Generates platform projects
- Solution Architect Agent: Designs platform architecture
- Project Bootstrap: Creates new platform projects
Best Practices¶
Service Design¶
- Design services around business capabilities
- Maintain service independence
- Use event-driven communication
- Implement proper error handling
Tenant Management¶
- Ensure tenant isolation
- Implement tenant provisioning
- Manage tenant configuration
- Monitor tenant usage
Infrastructure¶
- Use Pulumi for Infrastructure as Code: Leverage type-safe C# infrastructure definitions
- Stack-Based Configuration: Use environment-specific Pulumi stacks (dev, staging, prod)
- Secret Management: Use Pulumi secrets for sensitive configuration values
- Multi-Cloud Support: Utilize separate stack implementations for Azure and AWS
- Automate Deployments: Integrate Pulumi deployments into CI/CD pipelines
- Monitor Infrastructure Health: Track resource provisioning and health status
- Optimize Resource Usage: Review and optimize infrastructure costs regularly
Related Documents¶
- SaaS Platform Foundations - Platform foundations
- Microservices Architecture - Microservices architecture
- API Gateway Strategy - API Gateway strategy
- Templates Overview - All templates overview