{"id":13449606,"url":"https://github.com/Azure-Samples/aks-store-demo","last_synced_at":"2025-03-22T22:33:20.985Z","repository":{"id":177723815,"uuid":"648726487","full_name":"Azure-Samples/aks-store-demo","owner":"Azure-Samples","description":"Sample microservices app for AKS demos, tutorials, and experiments","archived":false,"fork":false,"pushed_at":"2024-08-03T06:15:38.000Z","size":8769,"stargazers_count":134,"open_issues_count":9,"forks_count":207,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-08-03T07:27:54.442Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Bicep","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Azure-Samples.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-02T16:49:30.000Z","updated_at":"2024-08-03T07:27:57.145Z","dependencies_parsed_at":"2023-07-10T19:15:36.425Z","dependency_job_id":"ec6a5c40-3991-4646-98be-1ca55e4676b6","html_url":"https://github.com/Azure-Samples/aks-store-demo","commit_stats":null,"previous_names":["azure-samples/aks-store-demo"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Faks-store-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Faks-store-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Faks-store-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Faks-store-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure-Samples","download_url":"https://codeload.github.com/Azure-Samples/aks-store-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221840687,"owners_count":16889843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T06:00:46.489Z","updated_at":"2024-10-28T14:31:22.496Z","avatar_url":"https://github.com/Azure-Samples.png","language":"Bicep","funding_links":[],"categories":["Post-deployment","others"],"sub_categories":[],"readme":"---\npage_type: sample\nlanguages:\n- azdeveloper\n- go\n- javascript\n- rust\n- nodejs\n- python\n- bicep\n- terraform\n- dockerfile\nproducts:\n- azure\n- azure-kubernetes-service\n- azure-openai\n- azure-cosmos-db\n- azure-container-registry\n- azure-service-bus\n- azure-monitor\n- azure-log-analytics\n- azure-managed-grafana\n- azure-key-vault\nurlFragment: aks-store-demo\nname: AKS Store Demo\ndescription: This sample demo app consists of a group of containerized microservices that can be easily deployed into an Azure Kubernetes Service (AKS) cluster. \n---\n\u003c!-- YAML front-matter schema: https://review.learn.microsoft.com/en-us/help/contribute/samples/process/onboarding?branch=main#supported-metadata-fields-for-readmemd --\u003e\n\n# AKS Store Demo\n\nThis sample demo app consists of a group of containerized microservices that can be easily deployed into an Azure Kubernetes Service (AKS) cluster. This is meant to show a realistic scenario using a polyglot architecture, event-driven design, and common open source back-end services (eg - RabbitMQ, MongoDB). The application also leverages OpenAI's GPT-3 models to generate product descriptions. This can be done using either [Azure OpenAI](https://learn.microsoft.com/azure/ai-services/openai/overview) or [OpenAI](https://openai.com/).\n\nThis application is inspired by another demo app called [Red Dog](https://github.com/Azure/reddog-code).\n\n\u003e [!NOTE]\n\u003e This is not meant to be an example of perfect code to be used in production, but more about showing a realistic application running in AKS. \n\n\u003c!-- \nTo walk through a quick deployment of this application, see the [AKS Quickstart](https://learn.microsoft.com/azure/aks/learn/quick-kubernetes-deploy-cli).\n\nTo walk through a complete experience where this code is packaged into container images, uploaded to Azure Container Registry, and then run in and AKS cluster, see the [AKS Tutorials](https://learn.microsoft.com/azure/aks/tutorial-kubernetes-prepare-app).\n\n --\u003e\n\n## Architecture\n\nThe application has the following services: \n\n| Service | Description |\n| --- | --- |\n| `makeline-service` | This service handles processing orders from the queue and completing them (Golang) |\n| `order-service` | This service is used for placing orders (Javascript) |\n| `product-service` | This service is used to perform CRUD operations on products (Rust) |\n| `store-front` | Web app for customers to place orders (Vue.js) |\n| `store-admin` | Web app used by store employees to view orders in queue and manage products (Vue.js) | \n| `virtual-customer` | Simulates order creation on a scheduled basis (Rust) |\n| `virtual-worker` | Simulates order completion on a scheduled basis (Rust) |\n| `ai-service` | Optional service for adding generative text and graphics creation (Python) |\n| `mongodb` | MongoDB instance for persisted data |\n| `rabbitmq` | RabbitMQ for an order queue |\n\n![Logical Application Architecture Diagram](assets/demo-arch-with-openai.png)\n\n## Run the app on Azure Kubernetes Service (AKS)\n\nTo learn how to deploy this app on AKS, see [Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using Azure CLI](https://learn.microsoft.com/azure/aks/learn/quick-kubernetes-deploy-cli).\n\n\u003e [!NOTE]\n\u003e The above article shows a simplified version of the store app with some services removed. For the full application, you can use the `aks-store-all-in-one.yaml` file in this repo.\n\n## Run on any Kubernetes\n\nThis application uses public images stored in GitHub Container Registry and Microsoft Container Registry (MCR). Once your Kubernetes cluster of choice is setup, you can deploy the full app with the below commands.\n\nThis deployment deploys everything except the `ai-service` that integrates OpenAI. If you want to try integrating the OpenAI component, take a look at this article: [Deploy an application that uses OpenAI on Azure Kubernetes Service (AKS)](https://learn.microsoft.com/azure/aks/open-ai-quickstart?tabs=aoai).\n\n```bash\nkubectl create ns pets\n\nkubectl apply -f https://raw.githubusercontent.com/Azure-Samples/aks-store-demo/main/aks-store-all-in-one.yaml -n pets\n```\n\n## Run the app locally\n\nThe application is designed to be [run in an AKS cluster](#run-the-app-on-aks), but can also be run locally using Docker Compose.\n\n\u003e [!TIP]\n\u003e You must have [Docker Desktop](https://www.docker.com/products/docker-desktop) installed to run this app locally. If you do not have it installed locally, you can try opening this repo in a [GitHub Codespace instead](#run-the-app-with-github-codespaces)\n\nTo run this app locally:\n\nClone the repo to your development computer and navigate to the directory:\n\n```console\ngit clone https://github.com/Azure-Samples/aks-store-demo.git\ncd aks-store-demo\n```\n\nConfigure your Azure OpenAI or OpenAI API keys in [`docker-compose.yml`](./docker-compose.yml) using the environment variables in the `ai-service` section:\n\n```yaml\n  ai-service:\n    build: src/ai-service\n    container_name: 'ai-service'\n    ...\n    environment:\n      - USE_AZURE_OPENAI=True # set to False if you are not using Azure OpenAI\n      - AZURE_OPENAI_DEPLOYMENT_NAME= # required if using Azure OpenAI\n      - AZURE_OPENAI_ENDPOINT= # required if using Azure OpenAI\n      - OPENAI_API_KEY= # always required\n      - OPENAI_ORG_ID= # required if using OpenAI\n    ...\n```\n\nAlternatively, if you do not have access to Azure OpenAI or OpenAI API keys, you can run the app without the `ai-service` by commenting out the `ai-service` section in [`docker-compose.yml`](./docker-compose.yml). For example:\n\n```yaml\n#  ai-service:\n#    build: src/ai-service\n#    container_name: 'ai-service'\n...\n#    networks:\n#      - backend_services\n```\n\nStart the app using `docker compose`. For example:\n\n```bash\ndocker compose up\n```\n\nTo stop the app, you can hit the `CTRL+C` key combination in the terminal window where the app is running.\n\n## Run the app with GitHub Codespaces\n\nThis repo also includes [DevContainer configuration](./.devcontainer/devcontainer.json), so you can open the repo using [GitHub Codespaces](https://docs.github.com/en/codespaces/overview). This will allow you to run the app in a container in the cloud, without having to install Docker on your local machine. When the Codespace is created, you can run the app using the same instructions as above.\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true\u0026ref=main\u0026repo=648726487)\n\n## Deploy the app to Azure using Azure Developer CLI\n\nSee the [Azure Developer CLI](./docs/azd.md) documentation for instructions on how to quickly deploy the app to Azure.\n\n## Additional Resources\n\n- AKS Documentation. https://learn.microsoft.com/azure/aks\n- Kubernetes Learning Path. https://azure.microsoft.com/resources/kubernetes-learning-path \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAzure-Samples%2Faks-store-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAzure-Samples%2Faks-store-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAzure-Samples%2Faks-store-demo/lists"}