Git Product home page Git Product logo

vietnam-devs / coolstore-microservices Goto Github PK

View Code? Open in Web Editor NEW
2.4K 135.0 570.0 61.51 MB

A full-stack .NET microservices build on Dapr and Tye

Home Page: https://vietnam-devs.github.io/coolstore-microservices

License: MIT License

CSS 9.65% HTML 5.07% Dockerfile 1.32% Shell 2.50% PowerShell 0.25% C# 46.35% JavaScript 0.14% TypeScript 15.62% SCSS 0.13% Mustache 0.40% Less 10.07% Go 0.17% Rust 5.24% Bicep 3.08%
kubernetes microservices rest-api service-mesh dotnet-core docker ddd clean-architecture cloud-native aks

coolstore-microservices's People

Contributors

azure-pipelines[bot] avatar hkboujrida avatar stuartleeks avatar thangchung avatar thinhnotes avatar trumhemcut avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coolstore-microservices's Issues

Error Connection refused

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)

Windows net5 tye run throws system cannot be found exception (fine on mac)

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, Action1 outputDataReceived, Action1 errorDataReceived, Action1 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, IDictionary2 environmentVariables, Action1 outputDataReceived, Action1 errorDataReceived, Action1 onStart, Action1 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, Action1 outputDataReceived, Action1 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

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).

Changes in README and .env

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

CQRS and Event Source

What did know about an demo implemention with RabbitMQ between some microsservices under CQRS and Event Source?

Thank you

A brief hello from one of your beneficiaries of a great project.

Keep up the good work.

Fig

Re-vamp with new architecture on .NET Core 3.0

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

Compilation issue

I am trying to compile code from master branch. I took latest version of netcorekit and getting compiling issues. please help.

API Gateway

  • Using Istio networking.istio.io/v1alpha3 for API gateway, instead of Nginx as right now
  • Refactor to remove aggregation service to avoid duplicated code

Problem with running project in Docker.

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.

Missing KeyValueObject

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.

Blazor (WebAssembly) for the front-end

deployment to aks

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.

Additionally, i don't see anywere any ingress gateway configuration - i don't understand how you configure routing in this deployment.

Question: communication between services?

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:

  • User add a near out of stock item to shopping cart, system update the inventory. However, the customer won't submit the order soon, how would you let other customer buy that same product?
  • If Inventory service is degraded or down, would it affect checkout journey?

Thanks.

The next version of coolstore

More to come. Stay stunned!

Long running (workflow and Sagas)

Yarp Integration with Dapr

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.

GraphQL acts on the API Gateway

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:

'run' failed

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.