Giter VIP home page Giter VIP logo

coffeeshop-on-dapr's Introduction

coffeeshop-on-dapr

The .NET coffeeshop application runs on Dapr

Services

No. Service Name URI
1 product-service http://localhost:5001
2 counter-service http://localhost:5002
3 barista-service http://localhost:5003
4 kitchen-service http://localhost:5004
5 reverse-proxy http://localhost:8080

Featured technologies

Architecture

Pre-requisites

Get starting locally

> dapr init
> docker compose up 

Finally, you can play around using client.http to explore the application!

Make sure no redis, zipkin instances running

Get starting on Azure

  1. Ensure you have access to an Azure subscription and the Azure CLI installed

    az login
    az account set --subscription "My Subscription"
  2. Clone this repository

    git clone https://github.com/thangchung/coffeeshop-on-dapr.git
    cd coffeeshop-on-dapr
  3. Install KEDA extension

    Enable KEDA extension here

    az feature register --namespace "Microsoft.ContainerService" --name "AKS-KedaPreview"
  4. Deploy the infrastructure

    az deployment sub create --location eastus --template-file ./iac/bicep/main.bicep
  5. Install Dapr extension

    Enable Dapr extension here

    az k8s-extension create --cluster-type managedClusters --cluster-name coffeeshop --resource-group azure_oss_rg --name dapr --extension-type Microsoft.Dapr
  6. Log into Azure Container Registry You can get your registry name from your resource group in the Azure Portal

    # enable admin login on Azure Portal
    docker login <registry_server_uri> -u <admin username> -p <password>

    For example: <registry_server_uri> looks like coffeeshopf2syic6ephtxk.azurecr.io

  7. Build and push containers

    Create an .env file at root project folder with content

    DOCKER_REGISTRY=<registry_server_uri>

    Then run docker-compose CLI as

    docker compose build
    docker push <registry_server_uri>/product-service:latest
    docker push <registry_server_uri>/counter-service:latest
    docker push <registry_server_uri>/barista-service:latest
    docker push <registry_server_uri>/kitchen-service:latest
    docker push <registry_server_uri>/reverse-proxy:latest
  8. Get AKS credentials

    az aks get-credentials --resource-group az_oss_rg --name coffeeshop

    Make sure when you go to Azure Portal, you should see keda and dapr components as the picture below

  9. Create dapr component on AKS

    kubectl apply -f iac/dapr/azure/orderup_pubsub.yaml
    kubectl apply -f iac/dapr/azure/barista_pubsub.yaml
    kubectl apply -f iac/dapr/azure/kitchen_pubsub.yaml
  10. Deploy the application

    az deployment group create --resource-group az_oss_rg --template-file ./iac/bicep/app.bicep
  11. Get your frontend URL

    kubectl get ingress

    For example,

    NAME CLASS HOSTS ADDRESS PORTS AGE
    reverseproxy app.5cde744b1d1242ffbc32.eastus.aksapp.io 20.241.232.155 80 13m
  12. Navigate to client.http, and change @host to what you can see on previous command, for example: app.5cde744b1d1242ffbc32.eastus.aksapp.io, then play with REST APIs there. Enjoy!

Clean up

az group delete -n az_oss_rg

Credits

coffeeshop-on-dapr's People

Contributors

thangchung avatar

Forkers

sanan-wow

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.