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.
The business domain is inspired from CoolStore project by JBoss Demo Central and Red Hat Demo Central.
Check out my medium, or my dev.to or say hi on Twitter!
Name | Usecase | Apps Participants |
---|---|---|
Service-to-service invocation | - 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 |
Actors | N/A | N/A |
Make sure you have dapr
and tye
installed on your machine!
$ tye run
Go to http://localhost:8000
, and you're able to access to several endpoints whenevever it's ready as below:
http://localhost:3000
http://localhost:5000
http://localhost:5001
$ tye run tye.slim.yaml
$ 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 dapr
with tye
via Coolstore Apps.
Enable
vm.max_map_count
for ElasticSearch via runsysctl -w vm.max_map_count=262144
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 OSDocker for desktop (Kubernetes enabled)
- The easiest tool to run Docker, Docker Swarm and Kubernetes on Mac and WindowsKubernetes
/ 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 Kubernetesdapr
- An event-driven, portable runtime for building microservices on cloud and edgetye
- 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 CoreIdentityServer4
- Identity and Access Control solution for .NET CoreYARP
- A toolkit for developing high-performance HTTP reverse proxy applicationsFluentValidation
- Popular .NET validation library for building strongly-typed validation rulesMediatR
- Simple, unambitious mediator implementation in .NETEF Core
- Modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrationsScrutor
- Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjectionserilog
- Simple .NET logging with fully-structured eventsNEST
- Elasticsearch.Net & NESTnodejs 10.x
- JavaScript runtime built on Chrome's V8 JavaScript enginetypescript
- A typed superset of JavaScript that compiles to plain JavaScriptcreate-react-app
- A modern web app by running one commandGuidance for developing µService can be found at Clean Domain-Driven Design in 10 minutes
TraceId
, HandlerName
, RequestPath
, level
and filter with HandlerName
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
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
Thanks goes to these wonderful people (emoji key)
Thang Chung |
Phuong Le |
Phi Huynh |
Thinh Nguyen |
Stuart Leeks |
Code released under the MIT license.
Microservice Architecture(微服务架构)目前还没有标准的定义,维基百科解释为:微服务是 SOA - Service-oriented architectures(面向服务体系结构)实现方法的一个特殊形式,用以建立灵活的和可独立部署的软件系统。其中作为微服务架构的关键组成部分 - Service(服务)是一些通过网络相互通信以共同完成某一目标的程序。 服务间的交流通信取决于特
http://blog.christianposta.com/microservices/netflix-oss-or-kubernetes-how-about-both/ http://blog.christianposta.com/our-book-has-been-released-introducing-istio-service-mesh-for-microservices/
brms-coolstore-demo 是一个很酷的网店演示程序,基于 Vaalidin 框架、JBoss BRMS (jBPM) 5.3 和 JBDS 5 构建。运行在 JBoss EAP 6 之上。
我想知道如何将基本身份验证用户名和密码传递给resttemplate,以便其他应用程序允许我访问endpoint 这是我的restTemplate 我正在尝试从其他微服务应用程序中检索火车列表。 注意:这些所有应用程序都在eureka服务器上运行,这就是为什么我使用应用程序名称 活动名称
我正在构建一个应用程序,其中微服务通过RabbitMQ(请求-响应模式)进行通信 一切正常,但我仍然有一个错误“远程服务中没有定义匹配的消息处理程序。”- 当我向客户端应用程序发送帖子时,它只需通过客户端(ClientProxy)发送包含数据的消息,消费者应用程序就会响应。此功能实际上可以工作,但始终只能第二次使用。我知道这听起来很奇怪,但在我的第一个POST请求中,总是有来自客户的错误,我的每一
我有两个微服务,一个配置为OAuth2服务器-A,另一个配置为OAuth2客户端-B。我想在这两个微服务之间共享我的自定义用户。当用户使用A对自己进行身份验证时,我创建了UserDetails的自定义实现,我想保护B中的一些资源。因此,我配置了与A相同的资源服务器。我希望我可以使用主体在A和B之间共享UserDetails的自定义实现。我可以从A中的主体获取自定义用户,但在B中,主体仅由字符串(用
我使用Spring Cloud方法来构建一些应该相互交互的微服务。对于微服务之间的消息传递,我打算使用RabbitMQ和Spring AMQP,但在我看了Spring Cloud Stream之后,我感到迷失了。在我看来,Spring Cloud Stream是下一个抽象级别(可能太强了,但您应该会得到整体印象),具有许多非常有用的功能。所以我想知道为什么有人会使用Spring AMQP进行新开发
微服务是一种分布式系统解决方案,推动细粒度服务的使用,这些服务协同工作,且每个服务都有自己的生命周期。因为微服务主要围绕业务领域建模,所以避免了由传统的分层架构引发的很多问题。 微服务也整合了过去十年来的新概念和技术,因此得以避开许多面向服务的架构中的陷阱。本书包含了业界使用微服务的很多案例,包括 Netflix、Amazon、Gilt 和 REA 等。这些组织都发现这种架构有一个很大的好处,就是