GithubHelp home page GithubHelp logo

thangchung / practical-dapr Goto Github PK

View Code? Open in Web Editor NEW
297.0 20.0 64.0 3.24 MB

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

License: MIT License

C# 89.99% HTML 5.22% PowerShell 3.18% JavaScript 0.06% Dockerfile 1.11% Less 0.44%
dotnet-core graphql mediatr clean-architecture domain-driven-design docker docker-compose kubernetes protobuf minimalist

practical-dapr's Introduction

practical-dapr project

A lightweight low ceremony .NET microservices are lifted and shifted to Kubernetes platform and run on Dapr runtime (with and without Tye options).

Price webhost-ui graphql-api identity-api product-catalog-api inventory-api

This repository based on some of the old libraries. So be careful if you use it in your production environment!!!

We're working on clean-architecture-dotnet for the new and lightweight version of the minimal Clean Architecture, Domain-driven Design lite, CQRS lite, and just enough Cloud-native patterns, then package into Docker, and finally deploy it using Tye on Kubernetes and Dapr in a practical way ๐Ÿ‘

High level architecture

CoolStore demo application

Want to develop this application? Reference at Developer Guidance

Want to deployment this application? Reference at Deployment Guidance

Dapr building blocks

Service to service

  • Dapr client to calling to another service (product-catalog-api to inventory-api)
  • HTTP/gRPC invocation

State store

  • Using state management to store the shopping cart data and its items
  • Redis for state management

Pub/sub message

  • Create, update and delete a project at product-catalog-api, and subsequently publish an event to inventory-api to create price, rop, and eoq
  • Redis for pub/sub

Input/output binding

TODO

Observability

  • Run tye command as following
$ tye run --dtrace zipkin=http://localhost:9411 --logs seq=http://localhost:5340
  • Log management with Seq dashboard

  • Distributed Tracing with Zipkin dashboard (OpenTelemetry)

Technical stack is at technical_stack

Show your support

If you liked practical-dapr project or if it helped you, please give a star โญ for this repository. That will not only help strengthen our .NET community but also improve cloud-native apps development skills for .NET developers in around the world. Thank you very much ๐Ÿ‘

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :p

practical-dapr's People

Contributors

kimcuhoang avatar thangchung 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

practical-dapr's Issues

Having issues running the solution

Hey there

First of all: I'm impressed by this sample and would like to thank you for blog article as well as the source here :) I wanted to analyse it and take parts of it into a solution I'm trying to build - but I'm new to tye as well as dapr and having problems running your solution.

First things first:
Windows Version:

> winver
Version 2004 (OS Build 19041.264)

Dapr:

> dapr --version
CLI version: 0.7.0
Runtime version: 0.7.1

Tye:

> tye --version
0.3.0-alpha.20268.1+d6c8dc25041984c59752216758858a1d68e083b3

Git:

> git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

Starting with:

> tye run
Loading Application Details...
Launching Tye Host...

[21:56:40 INF] Executing application from C:\git\practical-dapr\tye.yaml
[21:56:40 INF] Dashboard running on http://127.0.0.1:8000
[21:56:41 INF] Docker image openzipkin/zipkin-slim already installed
[21:56:41 INF] Docker image datalust/seq already installed
[21:56:41 INF] Docker image mcr.microsoft.com/mssql/server:2017-latest already installed
[21:56:41 INF] Docker image redis already installed
[21:56:41 INF] Creating docker network tye_network_fffce4e6-4
[21:56:41 INF] Running docker command network create --driver bridge tye_network_fffce4e6-4
[21:56:41 INF] Running image mcr.microsoft.com/mssql/server:2017-latest for sqlserver_58c4ba2d-c
[21:56:41 INF] Running image redis for redis_a2df345a-b
[21:56:41 INF] Running image openzipkin/zipkin-slim for zipkin_6bdf4620-c
[21:56:41 INF] Running image datalust/seq for seq_082cee1f-2
[21:56:41 INF] Running image mcr.microsoft.com/dotnet/core/sdk:3.1 for graph-api-proxy_a024cc71-f
[21:56:41 INF] Running image mcr.microsoft.com/dotnet/core/sdk:3.1 for identity-api-proxy_6ea44373-5
[21:56:41 INF] Running image mcr.microsoft.com/dotnet/core/sdk:3.1 for product-catalog-api-proxy_d4ea92ce-1
[21:56:41 INF] Running image mcr.microsoft.com/dotnet/core/sdk:3.1 for inventory-api-proxy_839715d1-6
[21:56:41 INF] Running image mcr.microsoft.com/dotnet/core/sdk:3.1 for webui-proxy_d5221475-c
[21:56:41 INF] Running image mcr.microsoft.com/dotnet/core/sdk:3.1 for graph-api-dapr-proxy_52fe93df-2
[21:56:41 INF] Running image mcr.microsoft.com/dotnet/core/sdk:3.1 for identity-api-dapr-proxy_3c21898a-c
[21:56:41 INF] Running image mcr.microsoft.com/dotnet/core/sdk:3.1 for product-catalog-api-dapr-proxy_364b4f6f-6
[21:56:41 INF] Running image mcr.microsoft.com/dotnet/core/sdk:3.1 for inventory-api-dapr-proxy_a9fc8d93-e
[21:56:41 INF] Running image mcr.microsoft.com/dotnet/core/sdk:3.1 for webui-dapr-proxy_2203ddcc-1
[21:56:41 INF] Building projects
[21:56:42 INF] Running container sqlserver_58c4ba2d-c with ID fb223fdce917
[21:56:42 INF] Running docker command network connect tye_network_fffce4e6-4 sqlserver_58c4ba2d-c --alias sqlserver
[21:56:42 INF] Running container zipkin_6bdf4620-c with ID 1bfb3c2fbdb8
[21:56:42 INF] Running docker command network connect tye_network_fffce4e6-4 zipkin_6bdf4620-c --alias zipkin
[21:56:42 INF] Running container redis_a2df345a-b with ID 06a759b084dd
[21:56:42 INF] Running docker command network connect tye_network_fffce4e6-4 redis_a2df345a-b --alias redis
[21:56:42 INF] Running container seq_082cee1f-2 with ID 37e3c07385eb
[21:56:42 INF] Running docker command network connect tye_network_fffce4e6-4 seq_082cee1f-2 --alias seq
[21:56:42 INF] Running container identity-api-proxy_6ea44373-5 with ID 33049876bfa2
[21:56:42 INF] Running docker command network connect tye_network_fffce4e6-4 identity-api-proxy_6ea44373-5 --alias identity-api
[21:56:43 INF] Collecting docker logs for sqlserver_58c4ba2d-c.
[21:56:43 INF] Running container product-catalog-api-proxy_d4ea92ce-1 with ID 39fd287c188c
[21:56:43 INF] Running docker command network connect tye_network_fffce4e6-4 product-catalog-api-proxy_d4ea92ce-1 --alias product-catalog-api
[21:56:43 INF] Running container graph-api-dapr-proxy_52fe93df-2 with ID 1143462960ed
[21:56:43 INF] Running docker command network connect tye_network_fffce4e6-4 graph-api-dapr-proxy_52fe93df-2 --alias graph-api-dapr
[21:56:43 INF] Running container webui-proxy_d5221475-c with ID 681317fd800a
[21:56:43 INF] Running docker command network connect tye_network_fffce4e6-4 webui-proxy_d5221475-c --alias webui
[21:56:43 INF] Running container graph-api-proxy_a024cc71-f with ID db21101ac3c7
[21:56:43 INF] Running docker command network connect tye_network_fffce4e6-4 graph-api-proxy_a024cc71-f --alias graph-api
[21:56:44 INF] Collecting docker logs for zipkin_6bdf4620-c.
[21:56:44 INF] Running container inventory-api-proxy_839715d1-6 with ID 54d35836974b
[21:56:44 INF] Running docker command network connect tye_network_fffce4e6-4 inventory-api-proxy_839715d1-6 --alias inventory-api
[21:56:44 INF] Running container product-catalog-api-dapr-proxy_364b4f6f-6 with ID 1d6453c27dc3
[21:56:44 INF] Running docker command network connect tye_network_fffce4e6-4 product-catalog-api-dapr-proxy_364b4f6f-6 --alias product-catalog-api-dapr
[21:56:44 INF] Collecting docker logs for redis_a2df345a-b.
[21:56:44 INF] Collecting docker logs for seq_082cee1f-2.
[21:56:44 INF] Collecting docker logs for identity-api-proxy_6ea44373-5.
[21:56:44 INF] Running container inventory-api-dapr-proxy_a9fc8d93-e with ID 5d24115e1f9a
[21:56:44 INF] Running docker command network connect tye_network_fffce4e6-4 inventory-api-dapr-proxy_a9fc8d93-e --alias inventory-api-dapr
[21:56:44 INF] Collecting docker logs for product-catalog-api-proxy_d4ea92ce-1.
[21:56:44 INF] Running container identity-api-dapr-proxy_3c21898a-c with ID c75ce5287159
[21:56:44 INF] Running docker command network connect tye_network_fffce4e6-4 identity-api-dapr-proxy_3c21898a-c --alias identity-api-dapr
[21:56:44 INF] Collecting docker logs for graph-api-dapr-proxy_52fe93df-2.
[21:56:44 INF] Collecting docker logs for webui-proxy_d5221475-c.
[21:56:45 INF] Running container webui-dapr-proxy_2203ddcc-1 with ID fc5fec91f5bc
[21:56:45 INF] Running docker command network connect tye_network_fffce4e6-4 webui-dapr-proxy_2203ddcc-1 --alias webui-dapr
[21:56:45 INF] Collecting docker logs for graph-api-proxy_a024cc71-f.
[21:56:45 INF] Collecting docker logs for inventory-api-proxy_839715d1-6.
[21:56:45 INF] Collecting docker logs for inventory-api-dapr-proxy_a9fc8d93-e.
[21:56:45 INF] Collecting docker logs for product-catalog-api-dapr-proxy_364b4f6f-6.
[21:56:45 INF] Collecting docker logs for identity-api-dapr-proxy_3c21898a-c.
[21:56:45 INF] Collecting docker logs for webui-dapr-proxy_2203ddcc-1.

I can access the dashboard at localhost:8000 but all the projects and dapper executables have a replica count of 0:
image

Do you have any idea why there are no instances of the projects and Dapr executables?

How to contribute

Hi,
I would like to know if you are open to contributions and, if so, what would be the opportunities to help you?

My goal is to promote .NET as a cloud-native development platform and I think that your initiative is quite on the edge. I'm looking also at the .NET Containerized eShopOnContainers app.

Some ideas I might think of right now are :

  • Upgrade to .NET 5
  • Add documentation on cloud-native patterns
  • Making templates out of your work to allow other to start quickly

Let me know what you think if you're willing.

Thank you!

tye run: Failed to launch processes

I'm unable to figure out this issue, it seems related to tye but, maybe I can get some help here, the containers are created successfully in Docker / Kubernetes but tye is unable to find / start the processes.
I receive below exception for all processes:

[11:11:13 ERR] Failed to launch process for service productcatalogapi-dapr_df61cb45-b
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 117
at Microsoft.Tye.Hosting.ProcessRunner.<>c__DisplayClass8_0.<g__RunApplicationAsync|0>d.MoveNext() in /
/src/Microsoft.Tye.Hosting/ProcessRunner.cs:line 402

This project looks very cool and I really want to experiment with it.

Any ideas would be appreciated.

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.