CoolStore Web Application - 🎡 Modern Application on Dapr and Tye ⛵
CoolStore Website is a containerised microservices application consisting of services based on .NET Core running on Dapr. It demonstrates how to wire up small microservices into a larger application using microservice architectural principals.
This repository based on some of the old libraries. So be careful if you use it in your production environment!!!
We are working on practical-clean-ddd for the new version of building the .NET apps with domain-driven design, clean architecture with Docker, Kubernetes, Tye, and Dapr in a practical way 👍
Read documentation for more information.
Table of contents
- Dapr Building Blocks
- Try it!
- OS, SDK, library, tooling and prerequisites
- µService development
- Open API
- Public presentation
Dapr Building Blocks
- User clicks to the detail product
- Populate product information for shopping cart items
- Order gets detail information of buyer
|productcatalogapp, inventoryapp, shoppingcartapp, identityapp|
|State management||Items in the shopping cart||shoppingcartapp|
|Publish and subscribe||User clicks checkout button, and the checkout process happens. It triggers the pub/sub flow in the system||shoppingcartapp, saleapp, identityapp|
|Resource bindings||Every 30 seconds and 1 minutes the validation process happens. It will change the status of order from Received to Process and Complete via Cron binding||productcatalogapp, inventoryapp|
|Observability||All apps in the application are injected by daprd so that it's tracked and observed by dapr||identityapp, webapigatewayapp, inventoryapp, productcatalogapp, shoppingcartapp, saleapp, web|
|Secrets||Bind with local secret file to hide password of redis||inventoryapp, productcatalogapp, shoppingcartapp, saleapp|
Shopping Cart page
Only wanna see wth is it?
$ tye run
http://localhost:8000, and you're able to access to several endpoints whenevever it's ready as below:
- Web App:
- Web Api Gateway:
- Identity Server:
Wanna go deeply to see how can we built it!
- Start core components
$ tye run tye.slim.yaml
- Start dapr apps locally via dapr cli
$ dapr run --app-port 5001 --app-id identityapp dotnet run -- -p src\Services\Identity\IdentityService\IdentityService.csproj
$ dapr run --app-port 5002 --app-id inventoryapp dotnet run -- -p src\Services\Inventory\InventoryService.Api\InventoryService.Api.csproj
$ dapr run --app-port 5003 --app-id productcatalogapp dotnet run -- -p src\Services\ProductCatalog\ProductCatalogService.Api\ProductCatalogService.Api.csproj
$ dapr run --app-port 5004 --app-id shoppingcartapp dotnet run -- -p src\Services\ShoppingCart\ShoppingCartService.Api\ShoppingCartService.Api.csproj
Now, you can start to develop, debug or explore more about
tye via Coolstore Apps.
vm.max_map_countfor ElasticSearch via run
sysctl -w vm.max_map_count=262144
OS, SDK, library, tooling and prerequisites
Windows 10- The OS for developing and building this demo application.
WSL2 - Ubuntu OS- the subsystem that helps to run easily the bash shell on Windows OS
Docker for desktop (Kubernetes enabled)- The easiest tool to run Docker, Docker Swarm and Kubernetes on Mac and Windows
AKS- The app is designed to run on Kubernetes (both locally on "Docker for Desktop" as well as on the cloud with AKS)
helm- Best package manager to find, share, and use software built for Kubernetes
dapr- An event-driven, portable runtime for building microservices on cloud and edge
tye- A developer tool that makes developing, testing, and deploying microservices and distributed applications easier
.NET Core 5- .NET Framework and .NET Core, including ASP.NET and ASP.NET Core
IdentityServer4- Identity and Access Control solution for .NET Core
YARP- A toolkit for developing high-performance HTTP reverse proxy applications
FluentValidation- Popular .NET validation library for building strongly-typed validation rules
MediatR- Simple, unambitious mediator implementation in .NET
EF Core- Modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations
Scrutor- Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection
serilog- Simple .NET logging with fully-structured events
NEST- Elasticsearch.Net & NEST
create-react-app- A modern web app by running one command
Guidance for developing µService can be found at Clean Domain-Driven Design in 10 minutes
Debug and Tracing Apps
- Setup Kibana with
leveland filter with
Then, you can find the exception happend in code via Kibana dashboard with settings above. Grab the
TraceId, then paste it to
Zipkin dashboard, then you can see the tracing of this request as the following picture
- Service Mesh on AKS, the future is now - Microsoft Build event in May 2019
- From Microservices to Service Mesh - DevCafe event in July 2018
- Service Mesh for Microservices- Vietnam Mobile Day event in June 2018
- Avoid SPOF in Cloud-native Apps - Vietnam Web Summit event in December 2018
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :p
Thanks goes to these wonderful people (emoji key)
Code released under the MIT license.