n-y-kim / aks-store-demo

Sample microservices app for AKS demos, tutorials, and experiments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AKS Store Demo

This 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 or OpenAI.

This application is inspired by another demo app called Red Dog.

Note: 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.

Architecture

The application has the following services:

Service Description
makeline-service This service handles processing orders from the queue and completing them (Golang)
order-service This service is used for placing orders (Javascript)
product-service This service is used to perform CRUD operations on products (Rust)
store-front Web app for customers to place orders (Vue.js)
store-admin Web app used by store employees to view orders in queue and manage products (Vue.js)
virtual-customer Simulates order creation on a scheduled basis (Rust)
virtual-worker Simulates order completion on a scheduled basis (Rust)
ai-service Optional service for adding generative text and graphics creation (Python)
mongodb MongoDB instance for persisted data
rabbitmq RabbitMQ for an order queue

Logical Application Architecture Diagram

Run the app on AKS

To learn how to deploy this app to AKS with Azure OpenAI, see Deploy an application that uses OpenAI on Azure Kubernetes Service (AKS).

Run the app locally

The application is designed to be run in an AKS cluster, but can also be run locally using Docker Compose.

IMPORTANT: You must have Docker Desktop installed to run this app locally.

To run this app locally:

Clone the repo to your development computer and navigate to the directory:

git clone https://github.com/Azure-Samples/aks-store-demo.git
cd aks-store-demo

Configure your Azure OpenAI or OpenAI API keys in docker-compose.yml using the environment variables in the aiservice section:

  aiservice:
    build: src/ai-service
    container_name: 'aiservice'
    ...
    environment:
      - USE_AZURE_OPENAI=True # set to False if you are not using Azure OpenAI
      - AZURE_OPENAI_DEPLOYMENT_NAME= # required if using Azure OpenAI
      - AZURE_OPENAI_ENDPOINT= # required if using Azure OpenAI
      - OPENAI_API_KEY= # always required
      - OPENAI_ORG_ID= # required if using OpenAI
    ...

Alternatively, 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 aiservice section in docker-compose.yml. For example:

#  aiservice:
#    build: src/ai-service
#    container_name: 'aiservice'
...
#    networks:
#      - backend_services

Start the app using docker compose. For example:

docker compose up

To stop the app, you can hit the CTRL+C key combination in the terminal window where the app is running.

Run the app with GitHub Codespaces

This repo also includes DevContainer configuration, so you can open the repo using GitHub Codespaces. 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.

Additional Resources

About

Sample microservices app for AKS demos, tutorials, and experiments

License:MIT License


Languages

Language:Vue 32.8%Language:Rust 16.8%Language:JavaScript 14.9%Language:Makefile 11.5%Language:Go 10.0%Language:Dockerfile 7.0%Language:Python 5.2%Language:HTML 1.2%Language:Shell 0.5%