Practical Dapr on Coolstore business model
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 👍
- We need Docker for Desktop installed
- Follow those steps at https://github.com/dapr/cli to install Dapr CLI
- Follow these steps at https://github.com/dotnet/tye/blob/master/docs/getting_started.md to install
tyeCLI
$ docker-compose -f docker-compose.yml -f docker-compose.override.yml run sqlserver$ cd src\GraphApi\CoolStore.GraphApi
$ dapr run --app-id graphql-api --port 5102 --app-port 5101 dotnet run$ cd src\ProductCatalog\CoolStore.ProductCatalogApi
$ dapr run --app-id product-catalog-api --port 5202 --app-port 5201 dotnet run$ cd src\Inventory\CoolStore.InventoryApi
$ dapr run --app-id inventory-api --grpc-port 5303 --port 5302 --app-port 5301 dotnet run$ type run- Go to http://localhost:5102
query {
products(
page: 1
pageSize: 5
where: { price_lte: 10000 }
order_by: { price: DESC }
) {
edges {
id
name
imageUrl
price
categoryId
categoryName
inventoryId
inventoryLocation
}
totalCount
}
}mutation createProductMutation($createProductInput: CreateProductInput!) {
createProduct(createProductInput: $createProductInput) {
product {
id
name
}
}
}{
"createProductInput": {
"name": "product 1",
"description": "this is a description",
"imageUrl": "https://picsum.photos/1200/900?image=100",
"price": 100,
"categoryId": "77666AA8-682C-4047-B075-04839281630A",
"inventoryId": "90C9479E-A11C-4D6D-AAAA-0405B6C0EFCD"
}
}- 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



