https://github.com/thangchung/practical-dotnet-aspire
The practical .NET Aspire builds on the coffeeshop app business domain
https://github.com/thangchung/practical-dotnet-aspire
dotnet dotnet-aspire marten masstransit
Last synced: about 1 year ago
JSON representation
The practical .NET Aspire builds on the coffeeshop app business domain
- Host: GitHub
- URL: https://github.com/thangchung/practical-dotnet-aspire
- Owner: thangchung
- License: mit
- Created: 2023-12-16T06:05:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-06T04:10:41.000Z (over 1 year ago)
- Last Synced: 2025-04-30T22:49:38.316Z (about 1 year ago)
- Topics: dotnet, dotnet-aspire, marten, masstransit
- Language: C#
- Homepage:
- Size: 729 KB
- Stars: 390
- Watchers: 8
- Forks: 59
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-dotnet-aspire - thangchung/practical-dotnet-aspire - The practical .NET Aspire builds on the coffeeshop app business domain (Example projects)
README
# The Coffeeshop Apps on .NET Aspire
The coffeeshop apps on .NET Aspire

## Get starting
In `Visual Studio` with the project opening, press `F5`!!!
or
```sh
> dotnet build coffeeshop-aspire.sln
> dotnet run --project app-host/CoffeeShop.AppHost.csproj
# http://localhost:5019
```
## Introduction
> Notice: This is just a demo of how can we build and deploy the microservices approach. In the reality, the boundary should be defined by bounded-context concepts of Domain-driven Design, and totally based on the business domain, and might not be so fine-grained services like this demo, so you use it with care.
- [x] Built on .NET 9.0 STS
- [x] .NET Aspire 9
- [x] Microservices architectural style
- [x] Follows Vertical Sliding principles
- [x] Domain Driven Design building blocks
- [x] CQRS with MediatR and Fluent Validations
- [x] Shift-left Observability with .NET Aspire (OpenTelemetry built-in)
- [x] Custom OpenTelemetry for MediatR and FluentValidation handlers
- [x] Custom OpenTelemetry for MassTransit on consumers
- [x] Enrich .NET 8 global loggings
- [x] OpenAPI supports
- [x] Mapperly for generating object mappings
- [x] API Versioning
- [x] Integration test with .NET Aspire and Wiremock.NET
- [x] Run it on GitHub Actions and output code coverage
- [x] UUID v7
- [Extend System.Guid with a new creation API for v7](https://github.com/dotnet/runtime/issues/103658)
- [Npgsql.EntityFrameworkCore.PostgreSQL-UUIDv7 GUIDs are generated by default](https://www.npgsql.org/efcore/release-notes/9.0.html#uuidv7-guids-are-generated-by-default)
- [x] Microsoft.Extensions.AI (Ollama for local dev and Azure OpenAI service)
- [ ] Response Caching - Distributed Caching with Redis
- [ ] JWT & Authentication with ASP.NET Identity
## System Context diagram - C4 Model
```mermaid
C4Context
title System Context diagram for CoffeeShop Application
Boundary(b0, "Boundary1") {
Person(customer, "Customers", "Customers of the coffeeshop.")
Boundary(b1, "Application", "boundary") {
System(SystemA, "CoffeeShop app", "Allows customers to submit and view their orders.")
}
Boundary(b2, "Infrastructure", "boundary") {
SystemDb(SystemD, "Database", "A system of the coffeeshop app.")
SystemQueue(SystemQ, "Message Queue", "A system of the coffeeshop app.")
}
}
Rel(customer, SystemA, "Uses")
Rel(SystemA, SystemD, "Uses")
Rel(SystemA, SystemQ, "Uses")
```
## Container diagram - C4 Model
```mermaid
C4Container
title Container diagram for CoffeeShop Application
Person(customer, "Customers", "Customers of the coffeeshop.")
Container_Boundary(c1, "CoffeeShop Application") {
Container(reverse_proxy, "Gateway", "C#, .NET 8, YARP", "The reverse proxy/API gateway of the coffeeshop app.")
Container(counter_api, "Counter APIs", "C#, .NET 8, MassTransit", "The counter service.")
Container(barista_api, "Barista APIs", "C#, .NET 8, MassTransit", "The barista service.")
Container(kitchen_api, "Kitchen APIs", "C#, .NET 8, MassTransit", "The kitchen service.")
Container(order_summary, "Order Summary", "C#, .NET 8, Marten", "The order summary service.")
Container(product_api, "Product APIs", "C#, .NET 8", "The product service.")
Boundary(b1, "Docker containers", "boundary") {
ContainerDb(database, "Database", "Postgres", "Stores orders, audit logs, etc.")
ContainerQueue(message_broker, "Message Broker", "RabbitMQ", "Asynchronous communication between counter, barista, kitchen, and order-summary")
}
}
Rel(customer, reverse_proxy, "Uses", "HTTPS")
Rel(reverse_proxy, product_api, "Proxies", "HTTP")
Rel(reverse_proxy, counter_api, "Proxies", "HTTP")
Rel(order_summary, database, "Uses", "TCP")
Rel(counter_api, product_api, "Calls", "HTTP")
Rel(counter_api, message_broker, "Publishes", "TCP")
Rel(counter_api, message_broker, "Publishes", "TCP")
Rel_Back(barista_api, message_broker, "Subscribes", "TCP")
Rel_Back(kitchen_api, message_broker, "Subscribes", "TCP")
Rel_Back(order_summary, message_broker, "Subscribes", "TCP")
```
## CoffeeShop App Infused with AI - Intelligent Apps Development
### Seeding data - chat completion

### Semantic Searching - vector embeddings

The detail blog of how to implement it at https://dev.to/thangchung/coffeeshop-app-infused-with-ai-intelligent-apps-development-202k