Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

run-aspnetcore-microservices

> 数据库
Open source

Microservices on .NET platforms used ASP.NET Web API, Docker, RabbitMQ, MassTransit, Grpc, Yarp API Gateway, PostgreSQL, Redis, SQLite, SqlServer, Marten, Entit

3.2K stars0 likes0 views
WebsiteGitHub

About

Microservices on .NET platforms used ASP.NET Web API, Docker, RabbitMQ, MassTransit, Grpc, Yarp API Gateway, PostgreSQL, Redis, SQLite, SqlServer, Marten, Entit

UDEMY COURSE WITH DISCOUNTED - Step by Step Development of this Repository -> https://www.udemy.com/course/microservices-architecture-and-implementation-on-dotnet/?couponCode=MARC26

See the overall picture of implementations on microservices with .net tools on real-world e-commerce microservices project;

There is a couple of microservices which implemented e-commerce modules over Catalog, Basket, Discount and Ordering microservices with NoSQL (DocumentDb, Redis) and Relational databases (PostgreSQL, Sql Server) with communicating over RabbitMQ Event Driven Communication and using Yarp API Gateway.

Check Explanation of this Repository on Medium

  • .NET 8 Microservices: DDD, CQRS, Vertical/Clean Architecture and Event-Driven Communication

Whats Including In This Repository

We have implemented below features over the run-aspnetcore-microservices repository.

Catalog microservice which includes;

  • ASP.NET Core Minimal APIs and latest features of .NET8 and C# 12
  • Vertical Slice Architecture implementation with Feature folders and single .cs file includes different classes in one file
  • CQRS implementation using MediatR library
  • CQRS Validation Pipeline Behaviors with MediatR and FluentValidation
  • Use Marten library for .NET Transactional Document DB on PostgreSQL
  • Use Carter for Minimal API endpoint definition
  • Cross-cutting concerns Logging, Global Exception Handling and Health Checks

Basket microservice which includes;

  • ASP.NET 8 Web API application, Following REST API principles, CRUD
  • Using Redis as a Distributed Cache over basketdb
  • Implements Proxy, Decorator and Cache-aside patterns
  • Consume Discount Grpc Service for inter-service sync communication to calculate product final price
  • Publish BasketCheckout Queue with using MassTransit and RabbitMQ

Discount microservice which includes;

  • ASP.NET Grpc Server application
  • Build a Highly Performant inter-service gRPC Communication with Basket Microservice
  • Exposing Grpc Services with creating Protobuf messages
  • Entity Framework Core ORM — SQLite Data Provider and Migrations to simplify data access and ensure high performance
  • SQLite database connection and containerization

Microservices Communication

  • Sync inter-service gRPC Communication
  • Async Microservices Communication with RabbitMQ Message-Broker Service
  • Using RabbitMQ Publish/Subscribe Topic Exchange Model
  • Using MassTransit for abstraction over RabbitMQ Message-Broker system
  • Publishing BasketCheckout event queue from Basket microservices and Subscribing this event from Ordering microservices
  • Create RabbitMQ EventBus.Messages library and add references Microservices

Ordering Microservice

  • Implementing DDD, CQRS, and Clean Architecture with using Best Practices
  • Developing CQRS with using MediatR, FluentValidation and Mapster packages
  • Consuming RabbitMQ BasketCheckout event queue with using MassTransit-RabbitMQ Configuration
  • SqlServer database connection and containerization
  • Using Entity Framework Core ORM and auto migrate to SqlServer when application startup

Yarp API Gateway Microservice

  • Develop API Gateways with Yarp Reverse Proxy applying Gateway Routing Pattern
  • Yarp Reverse Proxy Configuration; Route, Cluster, Path, Transform, Destinations
  • Rate Limiting with FixedWindowLimiter on Yarp Reverse Proxy Configuration

WebUI ShoppingApp Microservice

  • ASP.NET Core Web Application with Bootstrap 4 and Razor template
  • Call Yarp APIs with Refit HttpClientFactory

Docker Compose establishment with all microservices on docker;

  • Containerization of microservices
  • Containerization of databases
  • Override Environment variables

Run The Project

You will need the following tools:

  • Visual Studio 2022
  • .Net Core 8 or later
  • Docker Desktop

Installing

Follow these steps to get your development environment set up: (Before Run Start the Docker Desktop)

  1. Clone the repository
  2. Once Docker for Windows is installed, go to the Settings > Advanced option, from the Docker icon in the system tray, to configure the minimum amount of memory and CPU like so:
  • Memory: 4 GB
  • CPU: 2
  1. At the root directory of solution, select docker-compose and Set a startup project. Run docker-compose without debugging on visual studio. Or you can go to root directory which include docker-compose.yml files, run below command:
docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d
  1. Wait for docker compose all microservices. That’s it! (some microservices need extra time to work so please wait if not worked in first shut)

  2. Launch Shopping Web UI -> https://localhost:6065 in your browser to view index page. You can use Web project in order to call microservices over Yarp API Gateway. When you checkout the basket you can follow queue record on RabbitMQ dashboard.

Authors

  • Mehmet Ozkaya - Initial work - mehmetozkaya

See also the list of contributors who participated in this project. Check also gihtub page of repository.

GitHub Issues· 43 open

View all on GitHub
  • #102

    Order update Handler does not load or synchronize OrderItems

    Updated Jan 22, 2026
  • #101

    Docker can't run APIs catalog and ordering

    Updated Nov 23, 2025
  • #99

    docker compose cannot pull

    Updated May 25, 2025
  • #85

    Docker images: Unable to configure HTTPS endpoint

    Updated May 19, 2025
  • #98

    Basket checkout event handler error

    Updated Apr 21, 2025
  • #96

    Rename all files named Extentions.cs to Extensions.cs

    Updated Jan 20, 2025
  • #94

    Code repo for Design Microservices Architecture with Patterns & Principles points Here

    Updated Oct 22, 2024
  • #92

    Docker compose error 'failed to resolve reference: EOF'

    Updated Sep 8, 2024
  • #90

    Request stops in RabbitMq when zip code greater than 5

    Updated Jul 26, 2024
  • #83

    Cannot complete the docker compose on windows

    Updated Mar 5, 2024

Highlights

  • •.NET 8 Microservices: DDD, CQRS, Vertical/Clean Architecture and Event-Driven Communication
  • •ASP.NET Core Minimal APIs and latest features of .NET8 and C# 12
  • •Vertical Slice Architecture implementation with Feature folders and single .cs file includes different classes in one file
  • •CQRS implementation using MediatR library
  • •CQRS Validation Pipeline Behaviors with MediatR and FluentValidation
  • •Use Marten library for .NET Transactional Document DB on PostgreSQL
  • •Use Carter for Minimal API endpoint definition
  • •Cross-cutting concerns Logging, Global Exception Handling and Health Checks
  • •ASP.NET 8 Web API application, Following REST API principles, CRUD
  • •Using Redis as a Distributed Cache over basketdb

> Tags

C#api-gatewayaspnet-coreaspnet-web-apiaspnetcore-microservices

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库