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

food-delivery-microservices

> 设计协作
Open source

A practical and cloud-native food delivery microservices, built with .Net Aspire, .Net 10, Wolverine, Domain-Driven Design, CQRS, Vertical Slice Architecture

1.0K stars0 likes1 views
WebsiteGitHub

About

A practical and cloud-native food delivery microservices, built with .Net Aspire, .Net 10, Wolverine, Domain-Driven Design, CQRS, Vertical Slice Architecture

Food Delivery Microservices

Food Delivery Microservices is a practical and cloud-native food delivery microservices built with .NET Aspire, .Net Core and different software architecture and technologies like Microservices Architecture, Vertical Slice Architecture , CQRS Pattern, Domain Driven Design (DDD), Event Driven Architecture. For communication between independent services, we use asynchronous messaging with RabbitMQ and Wolverine, and sometimes we use synchronous communication for real-time communications with REST and gRPC calls.

This application is not business oriented and my focus is mostly on technical part, I just want to implement a sample with using different technologies, software architecture design, principles and all the thing we need for creating a microservices app.

Warning This project is in progress. I add new features over the time. You can check the Release Notes.

This Application ported to modular monolith approach in food-delivery-modular-monolith repository, we can choose best fit architecture for our projects based on production needs.

Other versions of this project are available in these repositories, We can choose best fit architecture for our projects based on production needs:

  • https://github.com/mehdihadeli/food-delivery-modular-monolith
  • https://github.com/mehdihadeli/go-food-delivery-microservices

For your simplest .net core projects, you can use my vertical-slice-api-template project template:

  • https://github.com/mehdihadeli/vertical-slice-api-template

⭐ Support

Don't forget to star () this repo to find it easier later and Support.

Table of Contents

  • Food Delivery Microservices
    • ⭐ Support
    • Table of Contents
    • Features
    • Plan
    • Technologies - Libraries
    • The Domain And Bounded Context - Service Boundary
    • Application Architecture
    • Wolverine Transactional Messaging
      • What Wolverine Handles
      • Transaction Boundary
    • Application Structure
      • High Level Structure
    • Vertical Slice Flow
    • Prerequisites
    • Setup
      • Dev Certificate
      • Conventional Commit
      • Formatting
      • Analizers
    • How to Run
      • Using Docker-Compose
      • Using Kubernetes
        • Plain Kubernetes
          • Prerequisites
          • Installation
    • Contribution
    • Project References
    • License

Features

  • Using Microservices and Vertical Slice Architecture as a high level architecture
  • Using Event Driven Architecture on top of RabbitMQ Message Broker and Wolverine
  • Using Domain Driven Designin most of services like Customers, Catalogs, ...
  • Using Event Sourcing and EventStoreDB in Audit Based services like Orders, Payment
  • Using Data Centeric Architecture based on CRUD in Identity Service
  • Using CQRS Pattern on top of MediatR library and spliting read models and write models
  • Using OpenTelemetry Collector to receive, process, and export telemetry data to various backends, including Jaeger and Tempo for tracing, Loki and Kibana for logs, and Prometheus for metrics.
  • Using Wolverine durable messaging with PostgreSQL persistence for Outbox, Inbox, and durable local processing in a transactional boundary with EF Core
  • Using Wolverine durable inbox for handling Idempotency in receiver side and practical exactly-once processing semantics per message id
  • Using UnitTests and NSubstitute for mocking dependencies
  • Using Integration Tests and End To End Tests on top of testcontainers-dotnet library for cleanup our test enviroment through docker containers
  • Using Minimal APIs for handling requests
  • Using Fluent Validation and a Validation Pipeline Behaviour on top of MediatR
  • Using Postgres for write database as relational DB and MongoDB and Elasric Search for read database
  • Using docker and docker-compose for deployment
  • Using YARP reverse proxy as API Gateway
  • Using different type of tests like Unit Tests, Integration Tests, End-To-End Tests and testcontainers for testing in isolation
  • Using OpenTelemetry for collecting Metrics and Distributed Traces
  • Using .NET Aspire for cloud-native application orchestration and enhanced developer experience
  • Using Helm, Kubernetes and Kustomize for deployment
  • Using EventCatalog to document asynchronous messages, domains, and services — view live catalog

Plan

This project is in progress, new features will be added over time.

Feature Architecture Pattern Status CI-CD

Technologies - Libraries

  • ✔️ .NET 9 - .NET Framework and .NET Core, including ASP.NET and ASP.NET Core
  • ✔️ Wolverine - Message bus and transactional messaging framework for .NET
  • ✔️ StackExchange.Redis - General purpose redis client
  • ✔️ Npgsql Entity Framework Core Provider - Npgsql has an Entity Framework (EF) Core provider. It behaves like other EF Core providers (e.g. SQL Server), so the general EF Core docs apply here as well
  • ✔️ EventStore-Client-Dotnet - Dotnet Client SDK for the Event Store gRPC Client API written in C#
  • ✔️ FluentValidation - Popular .NET validation library for building strongly-typed validation rules
  • ✔️ Swagger & Swagger UI - Swagger tools for documenting API's built on ASP.NET Core
  • ✔️ Serilog - Simple .NET logging with fully-structured events
  • ✔️ Polly - Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner
  • ✔️ Scrutor - Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection
  • ✔️ Opentelemetry-dotnet - The OpenTelemetry .NET Client
  • ✔️ DuendeSoftware IdentityServer - The most flexible and standards-compliant OpenID Connect and OAuth 2.x framework for ASP.NET Core
  • ✔️ Newtonsoft.Json - Json.NET is a popular high-performance JSON framework for .NET
  • ✔️ Rabbitmq-dotnet-client - RabbitMQ .NET client for .NET Standard 2.0+ and .NET 4.6.1+
  • ✔️ AspNetCore.Diagnostics.HealthChecks - Enterprise HealthChecks for ASP.NET Core Diagnostics Package
  • ✔️ Microsoft.AspNetCore.Authentication.JwtBearer - Handling Jwt Authentication and authorization in .Net Core
  • ✔️ NSubstitute - A friendly substitute for .NET mocking libraries.
  • ✔️ StyleCopAnalyzers - An implementation of StyleCop rules using the .NET Compiler Platform
  • ✔️ Mapperly - A .NET source generator for generating object mappings, No runtime reflection.
  • ✔️ IdGen - Twitter Snowflake-alike ID generator for .Net

The Domain And Bounded Context - Service Boundary

TODO

Application Architecture

The bellow architecture shows that there is one public API (API Gateway) which is accessible for the clients and this is done via HTTP request/response. The API gateway then routes the HTTP request to the corresponding microservice. The HTTP request is received by the microservice that hosts its own REST API. Each microservice is running within its own AppDomain and has directly access to its own dependencies such as databases, files, local transaction, etc. All these dependencies are only accessible for that microservice and not to the outside world. In fact microservices are decoupled from each other and are autonomous. This also means that the microservice does not rely on other parts in the system and can run independently of other services.

Microservices are event based which means they can publish and/or subscribe to any events occurring in the setup. By using this approach for communicating between services, each microservice does not need to know about the other services or handle errors occurred in other microservices.

In this architecture we use CQRS Pattern for separating read and write model beside of other CQRS Advantages. Here for now I don't use Event Sourcing for simplicity but I will use it in future for syncing read and write side with sending streams and using Projection Feature for some subscribers to syncing their data through sent streams and creating our Custom Read Models in subscribers side.

Here I have a write model that uses a postgres database for handling better Consistency and ACID Transaction guaranty. beside o this write side I use a read side model that uses MongoDB for better performance of our read side without any joins with suing some nested document, also better scalability with some good scaling features in MongoDB.

Wolverine Transactional Messaging

This repository now uses Wolverine as the single durable messaging runtime for broker publishing, inbound idempotency, and internal asynchronous processing. The old custom polling outbox and inbox implementation is replaced in the active Wolverine-based services by Wolverine durability primitives.

What Wolverine Handles

  • Outbox: integration events are written through Wolverine using PostgreSQL durability and flushed in the same application transaction boundary as E

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#aspnetcoreclean-architecturecqrsddd

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category设计协作
PricingOpen source

> Related tools

F
Figma
协作式界面设计工具
S
sketch-wakatime
Sketch plugin for automatic time tracking and metrics generated from your Sketch usage.
Q
QuickColor
Quickly apply fills from the global or document color palettes to selected elements - 🎨