A modern, production-ready microservices template built with .NET Aspire 9.0. This template provides a robust foundation for building scalable, maintainable, and cloud-ready microservices applications.
- .NET Aspire Integration: Built on .NET 9.0 with full Aspire support for cloud-native development
- Microservices Architecture:
- Product Service
- Category Service
- API Gateway (YARP Proxy)
- Building Blocks:
- Domain-Driven Design (DDD) structure
- Clean Architecture implementation
- Shared infrastructure components
- Infrastructure Components:
- PostgreSQL database integration
- Redis caching
- RabbitMQ message broker
- Seq logging
- Keycloak authentication
- Development Features:
- Centralized package management
- Code analysis and quality tools
- Entity Framework Core with PostgreSQL
- MassTransit for message handling
- OpenTelemetry integration
source/
├── src/
│ ├── BuildingBlocks/ # Shared components and utilities
│ │ ├── Caching/ # Redis and base caching implementations
│ │ ├── Database/ # Database access and migrations
│ │ ├── Logging/ # Serilog implementation
│ │ ├── MessageBrokers/ # MassTransit and message broker implementations
│ │ └── OpenTelemetry/ # Telemetry and monitoring
│ ├── Services/ # Microservices
│ │ ├── ProductService/ # Product management service
│ │ ├── CategoryService/ # Category management service
│ │ └── ProxyService/ # YARP API Gateway
│ └── Host/ # Aspire host and configuration
└── tests/ # Test projects
- .NET 9.0 SDK
- Docker Desktop
- Visual Studio 2022 or later (recommended)
- Install the template:
dotnet new install SenRecep.Aspire
- Create a new project:
dotnet new aspire-microservice -n YourCompanyName
- Clone the repository
- Navigate to the solution directory
- Run the application:
cd source/src/Host/CompanyName.AppHost
dotnet run
The template uses .NET Aspire's orchestration to manage:
- PostgreSQL databases for each service
- Redis cache
- RabbitMQ message broker
- Seq for centralized logging
- Keycloak for authentication
This template follows Clean Architecture principles with a domain-driven design approach:
- Domain Layer: Core business logic and entities
- Application Layer: Use cases and business rules
- Infrastructure Layer: External concerns and implementations
- Presentation Layer: API endpoints and controllers
The template uses centralized package management through Directory.Packages.props
and shared build properties in Directory.Build.props
.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
CSharpEssentials is a comprehensive library that enhances C#'s functional programming capabilities. It provides a robust set of tools and utilities designed to make your C# applications more maintainable, testable, and aligned with functional programming principles.
Key features:
- Functional Programming Essentials (Maybe Monad, Result Pattern, Discriminated Unions)
- Domain Modeling Tools (Rule Engine, Error Types, Entity Base)
- ASP.NET Core Integration
- Entity Framework Core Integration
- Request/Response Logging
- Enhanced JSON capabilities
- Time Management utilities
This library complements the Aspire Microservice Starter by providing additional functional programming patterns and utilities that can be used to build more robust and maintainable microservices.