run-aspnetcore-microservices is a reference implementation of microservices architecture on .NET platforms that demonstrates real-world e-commerce patterns using ASP.NET Core, Docker, RabbitMQ, gRPC, and multiple database technologies.
The project solves the problem of understanding how to build production-grade microservices by providing a complete working example across four core services: Catalog, Basket, Discount, and Ordering. The Catalog service uses Vertical Slice Architecture with MediatR for CQRS and Marten as a transactional document database on PostgreSQL. The Basket service implements Redis as a distributed cache with gRPC synchronous calls to the Discount service for price calculation. The Discount service exposes a gRPC server using Protobuf messages with SQLite persistence. The Ordering service demonstrates Domain-Driven Design, CQRS, and Clean Architecture patterns with SQL Server. Services communicate synchronously via gRPC and asynchronously through RabbitMQ event-driven messaging using MassTransit as an abstraction layer.
This project suits developers learning microservices patterns or building e-commerce systems who want to see how .NET 8 and C# 12 features integrate with architectural patterns like DDD, CQRS, and Vertical Slice Architecture. It demonstrates both NoSQL and relational database usage, distributed caching, and inter-service communication strategies. The repository is paired with a Udemy course that provides step-by-step guidance through the implementation.
The project maintains active development with implementations across multiple architectural patterns and database technologies. The codebase incorporates cross-cutting concerns including logging, global exception handling, and health checks. The repository demonstrates current .NET platform capabilities through use of Minimal APIs, Entity Framework Core migrations, and containerization patterns with Docker.