Git Product home page Git Product logo

chzbrgr71 / container-apps-store-api-microservice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure-samples/container-apps-store-api-microservice

1.0 1.0 0.0 1.93 MB

Sample microservices solution using Azure Container Apps, Dapr, Cosmos DB, and Azure API Management

License: MIT License

Dockerfile 6.28% Shell 42.49% Bicep 28.67% Go 1.89% JavaScript 10.28% CSS 4.68% Pug 2.10% Python 3.61%

container-apps-store-api-microservice's Introduction

Container App Store Microservice Sample (Forked)

This is a sample microservice solution for Azure Container Apps. It will create a series of microservices for managing orders and inventory. Dapr is used to secure communication and calls between services and Azure Cosmos DB is created alongside the microservices.

Note: This solution is a fork from the original. It's been changed a lot, but thanks to the original team who put this together!

Quickstart

Deployment is done via Bicep with a simple bash script to get you started. You can fork the repo and run the below script in bash or GitHub Codespaces.

Just run the ./start.sh script to deploy everything. You can edit the LOCATION variable in the script if needed.

Some notes on how to test the app here

Container Images

Container images are hosted in GitHub Container Registry.

The "official" images are here: https://github.com/orgs/Azure/packages?tab=packages&q=container-apps-demo

ghcr.io/azure/container-apps-demo/store-service
ghcr.io/azure/container-apps-demo/order-service
ghcr.io/azure/container-apps-demo/inventory-service

The below steps are for working locally, but this is optional.

export GITHUB_CR_PAT='' # set in bash profile
docker login ghcr.io -u chzbrgr71 -p $GITHUB_CR_PAT

export TAG='v1.21'

docker build -t chzbrgr71/store-service:$TAG ./store-service
docker build -t chzbrgr71/inventory-service:$TAG ./inventory-service
docker build -t chzbrgr71/order-service:$TAG ./order-service

docker tag chzbrgr71/store-service:$TAG ghcr.io/chzbrgr71/store-service:$TAG
docker tag chzbrgr71/inventory-service:$TAG ghcr.io/chzbrgr71/inventory-service:$TAG
docker tag chzbrgr71/order-service:$TAG ghcr.io/chzbrgr71/order-service:$TAG

docker push ghcr.io/chzbrgr71/store-service:$TAG
docker push ghcr.io/chzbrgr71/inventory-service:$TAG
docker push ghcr.io/chzbrgr71/order-service:$TAG

Note: Manually mark images as public here: https://github.com/chzbrgr71?tab=packages

Solution Overview

image of architecture

There are three main microservices in the solution.

Store API (store-service)

The store-service is an express.js API that exposes three endpoints. / will return the primary index page, /order will return details on an order (retrieved from the order service), and /inventory will return details on an inventory item (retrieved from the inventory service).

Order Service (order-service)

The order-service is a Python flask app that will retrieve and store the state of orders. It uses Dapr state management to store the state of the orders. When deployed in Container Apps, Dapr is configured to point to an Azure Cosmos DB to back the state.

Inventory Service (inventory-service)

The inventory-service is a Go mux app that will retrieve and store the state of inventory.

container-apps-store-api-microservice's People

Contributors

chzbrgr71 avatar jeffhollan avatar lastcoolnameleft avatar matsest avatar paulyuk avatar philliphoff avatar willtsai avatar

Stargazers

 avatar

Watchers

 avatar

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.