vietnam-devs / coolstore-microservices Goto Github PK
View Code? Open in Web Editor NEWA full-stack .NET microservices build on Dapr and Tye
Home Page: https://vietnam-devs.github.io/coolstore-microservices
License: MIT License
A full-stack .NET microservices build on Dapr and Tye
Home Page: https://vietnam-devs.github.io/coolstore-microservices
License: MIT License
Hello,
First of all, thanks for this cool project. Been looking to find something like this as a guide on my software development projects (other than using ABP).
This may not actually be an issue but I was trying to have a successful build but the solution fails because KeyValueObject is missing. Can't find it anywhere in code. Please point me in the right direction.
public static class EnumHelper
{
public static IEnumerable<KeyValueObject> GetEnumKeyValue<TEnum, TKey>()
where TKey : class
{
var metas = GetMetadata<TEnum, TKey>();
var results = metas.Item1.Zip(metas.Item2, (key, value) =>
new KeyValueObject
(
key,
value
)
);
return results;
}
public static (IEnumerable<TKey>, IEnumerable<string>) GetMetadata<TEnum, TKey>()
{
var keyArray = (TKey[])Enum.GetValues(typeof(TEnum));
var nameArray = Enum.GetNames(typeof(TEnum));
var keys = new List<TKey>();
foreach (var item in keyArray) keys.Add(item);
var names = new List<string>();
foreach (var item in nameArray) names.Add(item);
return (keys, names);
}
}
Thank you very much.
Hi team,
I run with command but get error:
$ tye run
Loading Application Details...
Drats! 'run' failed:
Evaluated project metadata file could not be found for service webapigatewayapp
Using helm to deploy and manage pipelines
Just like this article, we need to add skaffold
into current code base so that we can track changes, build and publish to current docker for desktop
We need a refactor of current deployment scripts to helm chart
, and apply skaffold
with helm
just like here.
References:
Thanks so much for the project and guidance. Any plans for a multitenant design?
It's great if we can support Docker for Mac also!
Upgrade to latest version of netcorekit
with gRPC protocol out of the box.
Event storming methodology for analysis and design the distributed services.
References:
Search service:
Cloud-native apps
gRPC
Linkerd 2.0
https://github.com/vaquarkhan/microservices-recipes-a-free-gitbook
https://hackernoon.com/migrating-to-microservices-and-event-sourcing-the-dos-and-donts-195153c7487d
GitOps
UI/UX
https://app.leanboard.io/board/4c814b4f-0349-43d6-bfbc-b214b893e7ff
Ocelot is good tool for that https://github.com/ThreeMammals/Ocelot
Installation via docker should be replaced with :
docker-compose -f docker-compose.base.yml -f docker-compose.base.override.yml -f docker-compose.yml -f docker-compose.override.yml up -d
And .env to catch user home instead of :
LOCAL_NUGET_PATH=/c/Users/Thang Chung/.nuget/packages
Having errors when trying to run "tye run" with net5. Exception:
01:13:22 INF] Launching service inventoryapp-dapr_7e8e0a8a-e: daprd -app-id inventoryapp -app-port 5002 -dapr-grpc-port 54291 --dapr-http-port 54292 --metrics-port 54293 --placement-address localhost:50005 -config "D:\research\daprs\test\coolstore-microservices\components\appconfig.yaml" -log-level debug -components-path ./components/local/
[01:13:22 ERR] Failed to launch process for service shoppingcartapp-dapr_a9076c7a-8
System.ComponentModel.Win32Exception (2): The system cannot find the file specified.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at Microsoft.Tye.ProcessUtil.RunAsync(String filename, String arguments, String workingDirectory, Boolean throwOnError, IDictionary2 environmentVariables, Action
1 outputDataReceived, Action1 errorDataReceived, Action
1 onStart, Action1 onStop, CancellationToken cancellationToken) in /_/src/Microsoft.Tye.Core/ProcessUtil.cs:line 113 at Microsoft.Tye.Hosting.ProcessRunner.<>c__DisplayClass8_0.<<LaunchService>g__RunApplicationAsync|0>d.MoveNext() in /_/src/Microsoft.Tye.Hosting/ProcessRunner.cs:line 402 [01:13:22 ERR] Failed to launch process for service identityapp-dapr_c1321c2e-6 System.ComponentModel.Win32Exception (2): The system cannot find the file specified. at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at Microsoft.Tye.ProcessUtil.RunAsync(String filename, String arguments, String workingDirectory, Boolean throwOnError, IDictionary
2 environmentVariables, Action1 outputDataReceived, Action
1 errorDataReceived, Action1 onStart, Action
1 onStop, CancellationToken cancellationToken) in //src/Microsoft.Tye.Core/ProcessUtil.cs:line 113
at Microsoft.Tye.Hosting.ProcessRunner.<>c__DisplayClass8_0.<g__RunApplicationAsync|0>d.MoveNext() in //src/Microsoft.Tye.Hosting/ProcessRunner.cs:line 402
[01:13:22 ERR] Failed to launch process for service inventoryapp-dapr_7e8e0a8a-e
System.ComponentModel.Win32Exception (2): The system cannot find the file specified.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at Microsoft.Tye.ProcessUtil.RunAsync(String filename, String arguments, String workingDirectory, Boolean throwOnError, IDictionary2 environmentVariables, Action
1 outputDataReceived, Action1 errorDataReceived, Action
1 onStart, Action`1 onStop, CancellationToken cancellationToken) in //src/Microsoft.Tye.Core/ProcessUtil.cs:line 113
at Microsoft.Tye.Hosting.ProcessRunner.<>c__DisplayClass8_0.<g__RunApplicationAsync|0>d.MoveNext() in //src/Microsoft.Tye.Hosting/ProcessRunner.cs:line 402
Also, I'm able to run the dotnet-sdk dapr sample with tye with no issue.
I also tried to run it in wsl2 and wsl in docker (both set to run as linux, haven't tried to run docker in windows containers as I assumed it dapr wouldnt work).
Currently, we don't have the neat solution for waiting Db started (see https://github.com/vietnam-devs/coolstore-microservices/blob/master/deploys/dockers/mssqldb/init.sh) so that we need to re-visit it later.
The Idea is using k8s StatefulSets, then Db need to write out something to the output (file-system maybe), the service needs to check the waiting status using dockerize or wait-for-it
I want to integrate YARP with DAPR. My use case is that when a user hits the yarp URL, the downstream of it must invoke the DAPR sidecar URL for service invocation Eg.
http(s)://<Yarp service >/api/< service name >/XXXXX (Upstream)
To
http://<Dapr-sidecar>/v1.0/invoke/< service name >/method/XXXXX (Downstream)
I'm not sure how I configure this as YARP routes.
Please help.
I got 500 error as bellow, how can I fix it,
Dapr.Client.InvocationException: Exception while invoking get-inventories-by-ids on appId:inventoryapp
---> Grpc.Core.RpcException: Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Connection refused (127.0.0.1:50001) SocketException: Connection refused", DebugException="System.Net.Http.HttpRequestException: Connection refused (127.0.0.1:50001)
---> System.Net.Sockets.SocketException (61): Connection refused
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|283_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.DefaultConnectAsync(SocketsHttpConnectionContext context, CancellationToken cancellationToken)
at System.Net.Http.ConnectHelper.ConnectAsync(Func`3 callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.ConnectAsync(Func`3 callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)")
at Dapr.Client.DaprClientGrpc.MakeInvokeRequestAsyncWithResponse[TRequest,TResponse](InvocationRequest`1 request, Boolean useRaw, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Dapr.Client.DaprClientGrpc.MakeInvokeRequestAsyncWithResponse[TRequest,TResponse](InvocationRequest`1 request, Boolean useRaw, CancellationToken cancellationToken)
at Dapr.Client.DaprClientGrpc.InvokeMethodAsync[TRequest,TResponse](String appId, String methodName, TRequest data, HTTPExtension httpExtension, CancellationToken cancellationToken)
at ProductCatalogService.Infrastructure.Gateway.InventoryGateway.GetInventoryListAsync(IEnumerable`1 ids, CancellationToken cancellationToken) in /Users/giauht/coolstore-microservices/src/Services/ProductCatalog/ProductCatalogService/Infrastructure/Gateway/InventoryGateway.cs:line 28
at ProductCatalogService.Application.SearchProducts.SearchProductsHandler.Handle(SearchProductsQuery request, CancellationToken cancellationToken) in /Users/giauht/coolstore-microservices/src/Services/ProductCatalog/ProductCatalogService/Application/SearchProducts/SearchProductsHandler.cs:line 63
at ProductCatalogService.Application.SearchProducts.SearchProductsHandler.Handle(SearchProductsQuery request, CancellationToken cancellationToken) in /Users/giauht/coolstore-microservices/src/Services/ProductCatalog/ProductCatalogService/Application/SearchProducts/SearchProductsHandler.cs:line 113
at N8T.Infrastructure.OTel.MediatR.OTelMediatRTracingBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next) in /Users/giauht/coolstore-microservices/src/BasicBuildingBlocks/N8T.Infrastructure.OTel/MediatR/OTelMediatRTracingBehavior.cs:line 45
at N8T.Infrastructure.Auth.AuthBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next) in /Users/giauht/coolstore-microservices/src/BasicBuildingBlocks/N8T.Infrastructure/Auth/AuthBehavior.cs:line 58
at N8T.Infrastructure.Logging.LoggingBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next) in /Users/giauht/coolstore-microservices/src/BasicBuildingBlocks/N8T.Infrastructure/Logging/LoggingBehavior.cs:line 27
at N8T.Infrastructure.Validator.RequestValidationBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next) in /Users/giauht/coolstore-microservices/src/BasicBuildingBlocks/N8T.Infrastructure/Validator/RequestValidationBehavior.cs:line 36
at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
at MediatR.Pipeline.RequestPostProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
at MediatR.Pipeline.RequestPreProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
at ProductCatalogService.Api.Http.Controllers.ProductSearchController.Get(IMediator mediator, String query, Double price, Int32 page, Int32 pageSize) in /Users/giauht/coolstore-microservices/src/Services/ProductCatalog/ProductCatalogService.Api/Http/Controllers/ProductSearchController.cs:line 17
at lambda_method226(Closure , Object )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
We will build the backoffice front-end using create-react-app
References:
Currently, we host the GRPC inside out. Everything is seem fine, but this approach looks like has a lot of drawback such as 2 protocols (REST and gRPC) exposed, some of authentication and authorization functionalities are still processing... If we can have a way to work with GraphQL.NET on the server, and apollo-client for the front-end then it can be standardized with the normal use-case in many projects in the world. Just like below but for .NET ecosystem
References:
A brief hello from one of your beneficiaries of a great project.
Keep up the good work.
Fig
Articles:
Camuda Client:
Source code:
Presentation:
.NET Workflow libs:
NATS
Using SignalR behind, and then expose it to the outside.
References:
WebAssembly will become dominant in a couple of months. If we can use Blazor to build the front-end, then we will utilize the whole .NET stack in this project.
Reference:
Tool for converting stylus to css http://beautifytools.com/stylus-compiler.php
i appreciate your work a lot!
I'm trying to make your PoC work.
However i fail to follow your guide from this site: https://hackernoon.com/5-steps-to-bring-coolstores-service-mesh-to-azure-kubernetes-service-aks-9cd1a5aa008a
This the content of dev-all-in-one.aks.yaml that was generated: here
I get a timeout exception when trying to access http://coolstore.aks.
One service don't even get up (sorry for formatting):
cart-v1-76cd4c469b-ckbc2 2/2 Running 12 25m
cartdb-v1-6496fb8f99-mtm8l 2/2 Running 0 25m
catalog-v1-6746c59bbd-9jxjg 2/2 Running 5 25m
idp-v1-7fc69b654c-24vqj 2/2 Running 0 25m
inventory-v1-5449599dbd-4tcb6 1/2 CrashLoopBackOff 9 25m
inventorydb-v1-b474576dd-8chb8 2/2 Running 0 25m
mongodb-v1-7c8685b5f6-nxm4m 2/2 Running 0 25m
rating-v1-bc4d4cb4c-9j2lw 2/2 Running 5 25m
review-v1-6f77959996-gkgch 2/2 Running 12 25m
reviewdb-v1-6bbd69d479-wrhxt 2/2 Running 0 25m
webui-v1-7d68c4c4c9-bxp58 2/2 Running 0 25m
For inventory container the error is:
The specified framework 'Microsoft.AspNetCore.App', version '2.1.6' was not found.
- Check application dependencies and target a framework version installed at:
/usr/share/dotnet/- Installing .NET Core prerequisites might help resolve this problem:
http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409- The .NET Core framework and SDK can be installed from:
https://aka.ms/dotnet-download- The following versions are installed:
2.1.5 at [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Additionally, i don't see anywere any ingress gateway configuration - i don't understand how you configure routing in this deployment.
What did know about an demo implemention with RabbitMQ between some microsservices under CQRS and Event Source?
https://github.com/DataGrip/docker-env/blob/master/mssql-server-linux/README.md
docker run -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=Passw0rd -p 1433:1433 microsoft/mssql-server-linux:2017-latest
The document site at https://vietnam-devs.github.io/docs/overview/introduction
Follow the structure of documents at https://docs.microsoft.com/en-us/azure/architecture/microservices
We use gatsbyjs v1 which mainly borrows from graphql.net repo so that we need to base on it to upgrade it to gatsby v2, just like https://github.com/ryanwiemer/gatsby-starter-gcn
I am trying to compile code from master branch. I took latest version of netcorekit and getting compiling issues. please help.
We need to add Swagger UI for the currently NodeJS Services
https://www.rajram.net/node-101-part-5-auto-generate-swagger-for-your-web-api-and-use-swaggerui-to-try-it-out/
More to come. Stay stunned!
https://github.com/nginxinc/nginmesh
Demo integrating with Graylog and kSQL
networking.istio.io/v1alpha3
for API gateway, instead of Nginx as right nowWe need this for traffic splitting using istio
.
https://anthonychu.ca/post/api-versioning-kubernetes-nginx-ingress/
https://andrewlock.net/setting-asp-net-core-version-numbers-for-a-docker-onbuild-builder-image/
Hi
Thanks for the clear repository and architecture :) !
I try to run this project in Docker with the command "docker-compose up" but I directly get this error:
docker-compose : Service 'migration-data' depends on service 'sqlserver' which is undefined.
Can someone help me what i'm doing wrong ?
With other projects I don't have any problems with docker.
Thanks.
Hi,
@thangchung How can I run microservices and required docker infrastructure on gitpod in your project? where is its configuration for gitpod?
Especially in rocket framework and yew
At the moment, we have to seed data to the shop, but we can consider to seed some kind of open source db API on the internet like https://www.openbrewerydb.org
Hi,
When a product is added to ShoppingCart service, how would that event update the Stock availability in Inventory service? Is it via event stream or via api update?
There are a few interesting use cases i'm facing:
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.