Templates & Libraries Overview¶
This document provides an overview of ConnectSoft's templates and libraries catalog. It is written for architects and engineers understanding what templates and libraries are available and how they're used by the Factory and in manual development.
ConnectSoft maintains a catalog of templates and libraries that form the building blocks for generated systems. Templates define standard structures and patterns, while libraries provide reusable functionality. Together, they ensure consistency, speed, reduced boilerplate, and encoded best practices across all ConnectSoft-generated systems.
Note
Templates are opinionated and follow ConnectSoft's architectural principles. They ensure consistency across all generated systems and make agent generation predictable. For detailed specifications, see Microservice Template and Libraries Catalog.
Why Templates & Libraries Matter¶
Templates and libraries are foundational to ConnectSoft's value proposition:
- Consistency - Every generated system follows the same architectural patterns
- Speed - Reduce boilerplate and repetitive code generation
- Quality - Encode best practices (Clean Architecture, DDD, event-driven, observability)
- Maintainability - Standardized structure makes codebases easier to understand and maintain
- Agent Safety - Well-defined templates make agent generation predictable and safe
Without templates and libraries, the Factory would generate inconsistent, ad-hoc code. With them, every generation follows proven patterns.
Template Types¶
ConnectSoft maintains several types of templates:
Microservice Template¶
Purpose: Standard structure for all microservices generated by the Factory
Structure:
- Domain Layer (entities, value objects, domain services, domain events)
- Application Layer (use cases, workflows, DTOs)
- Infrastructure Layer (repositories, external services, messaging)
- API Layer (controllers, request/response models)
- Tests Layer (unit, integration, acceptance tests)
Features: Clean Architecture, DDD, event-driven, multi-tenant, observability built-in
Used By: Engineering agents when generating new microservices
Library Template¶
Purpose: Standard structure for reusable libraries
Structure:
- Core functionality
- Abstractions and interfaces
- Extension methods
- Tests
Features: Versioned, NuGet-packaged, reusable across projects
Used By: Engineering agents when generating shared libraries
Library Template¶
Purpose: Standard structure for reusable libraries
Structure:
- Core functionality
- Abstractions and interfaces
- Extension methods
- Tests
Features: Versioned, NuGet-packaged, reusable across projects
Used By: Engineering agents when generating shared libraries
See: Library Template for detailed specification
Infrastructure / DevOps Template¶
Purpose: Standard CI/CD pipelines and Infrastructure-as-Code
Structure:
- Azure DevOps YAML pipelines (build, test, deploy)
- Bicep templates for Azure resources
- Kubernetes manifests
- Deployment configurations
Features: Multi-environment support, observability integration, security best practices
Used By: DevOps agents when generating infrastructure
See: DevOps Templates for detailed specification
Frontend and CMS Templates¶
Purpose: Standard UI component structures and content management system integrations
Structure:
- Frontend application scaffolding (Angular, React, Blazor)
- CMS integration patterns
- UI component libraries
- State management patterns
Features: Modern frontend frameworks, headless CMS support, responsive design patterns
Used By: Frontend engineering agents when generating UI applications
See: Frontend and CMS Templates for detailed specification
Mobile App Templates¶
Purpose: Standard mobile application structures
Structure:
- Cross-platform mobile app scaffolding
- Native iOS/Android patterns
- Mobile-specific UI components
- Mobile API integration patterns
Features: Cross-platform support, native performance, mobile-specific best practices
Used By: Mobile engineering agents when generating mobile applications
See: Mobile App Templates for detailed specification
Observability Templates¶
Purpose: Standard observability and monitoring patterns
Structure:
- OpenTelemetry integration
- Logging patterns
- Metrics collection
- Tracing configuration
Features: Full observability stack, distributed tracing, metrics dashboards
Used By: Observability engineers and DevOps agents when setting up monitoring
See: Observability Templates for detailed specification
Security and Compliance Templates¶
Purpose: Standard security and compliance patterns
Structure:
- Authentication/authorization patterns
- Security best practices
- Compliance templates (GDPR, SOC2, etc.)
- Security scanning configurations
Features: Security-first design, compliance-ready patterns, security testing integration
Used By: Security engineers and architects when implementing security controls
See: Security and Compliance Templates for detailed specification
Library Families¶
ConnectSoft maintains several library families under the ConnectSoft.Extensions.* namespace:
| Library | Purpose | Typical Consumers |
|---|---|---|
| ConnectSoft.Extensions.Logging | Structured logging helpers, correlation IDs, OpenTelemetry integration | All microservices |
| ConnectSoft.Extensions.Http | HTTP client helpers, retry policies, circuit breakers | Services calling external APIs |
| ConnectSoft.Extensions.OAuth2 | OAuth2 client helpers, token management, OpenID Connect support | Services authenticating users |
| ConnectSoft.Extensions.OpenTelemetry | OpenTelemetry wiring, tracing configuration, metrics collection | All microservices |
| ConnectSoft.Extensions.Audit | Audit trail functionality, event capture | Services needing audit logging |
| ConnectSoft.Extensions.Identity | Identity and access helpers, tenant context | Multi-tenant services |
| ConnectSoft.Extensions.Config | Configuration management, feature flags | Services needing external config |
| ConnectSoft.Extensions.Messaging | Messaging abstractions, event publishing | Event-driven services |
| ConnectSoft.Extensions.Persistence | Persistence helpers, repository patterns | Services with data access |
| ConnectSoft.Extensions.Testing | Test utilities, BDD helpers, test data builders | All test projects |
All libraries follow ConnectSoft's architectural principles and are designed for multi-tenant SaaS applications.
How Templates and Libraries Are Used by the Factory¶
The Factory uses templates and libraries in a structured workflow:
- Architect Agents design bounded contexts and APIs
- Engineering Agents use microservice templates to scaffold services
- Engineering Agents reference libraries via NuGet packages
- DevOps Agents use infrastructure templates for CI/CD and IaC
- All Agents store patterns in knowledge system for future reuse
The diagram below shows how templates and libraries flow through the Factory:
flowchart TD
subgraph "Templates"
MT[Microservice<br/>Template]
LT[Library<br/>Template]
IT[Infrastructure<br/>Template]
end
subgraph "Libraries"
LIB1[ConnectSoft.Extensions.*<br/>NuGet Packages]
end
subgraph "Factory Agents"
AA[Architect Agent]
EA[Engineering Agent]
DA[DevOps Agent]
end
subgraph "Knowledge System"
KS[Pattern Storage<br/>Vector DB]
end
AA -->|Designs| EA
EA -->|Uses| MT
EA -->|Uses| LT
EA -->|References| LIB1
DA -->|Uses| IT
EA -->|Stores Patterns| KS
KS -->|Reuses| EA
EA -->|Generates| CODE[Generated Code<br/>Customer Repos]
style MT fill:#2563EB,color:#fff
style LIB1 fill:#4F46E5,color:#fff
style CODE fill:#10B981,color:#fff
Tip
Templates ensure consistency, while libraries provide reusable functionality. Together, they enable the Factory to generate production-ready code quickly and reliably. Every generation uses the same templates and libraries, ensuring architectural consistency across all customer projects.
How Engineers Should Use Them Manually¶
If you're not using the Factory, you can still benefit from templates and libraries:
Using Templates Manually¶
- Start from microservice template - Clone or fork the template repository
- Follow the structure - Use the same Domain/Application/Infrastructure/API/Tests layers
- Customize as needed - Adapt templates to your specific needs while maintaining structure
- Reference examples - Look at Factory-generated services as examples
Using Libraries Manually¶
- Install NuGet packages - Add
ConnectSoft.Extensions.*packages to your projects - Follow patterns - Use libraries as intended (see library documentation)
- Extend if needed - Create your own extensions following ConnectSoft patterns
- Stay updated - Keep libraries updated for bug fixes and new features
Benefits of Manual Use¶
- Consistency - Same patterns as Factory-generated code
- Best practices - Libraries encode proven patterns
- Community - Share patterns with Factory users
- Migration path - Easy to migrate to Factory later
Note
Templates and libraries are designed to work together. Using templates without libraries, or libraries without templates, reduces their effectiveness. For best results, use both following ConnectSoft's architectural principles.
Template Catalog¶
ConnectSoft maintains templates for all major system components:
- Microservice Template - Backend microservices with Clean Architecture and DDD
- Library Template - Reusable library structures
- Frontend and CMS Templates - Frontend applications and CMS integrations
- Mobile App Templates - Mobile application structures
- DevOps Templates - CI/CD pipelines and Infrastructure-as-Code
- Observability Templates - Monitoring and observability patterns
- Security and Compliance Templates - Security and compliance patterns
Template Architecture¶
ConnectSoft templates follow a three-layer architecture that eliminates duplication while maintaining flexibility:
- Template Architecture Overview - Business-oriented overview of the template architecture
- Template Layering Guide - Technical guide to the three-layer model, submodules, and overlays
- Extensibility Guide - How to extend base infrastructure with domain-specific functionality
Related Documents¶
- Microservice Template - Detailed microservice template specification
- Library Template - Library template specification
- Libraries Catalog - Complete library catalog with usage examples
- Technology Stack - Technologies and frameworks used
- Microservice Standard Blueprint - Factory blueprint for microservices
- Clean Architecture & DDD - Architectural principles templates follow