Giter Club home page Giter Club logo

negativeeddy / mosaic-microservices Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 1.66 MB

This project is a work-in-progress example of a microservice architecture app built with Dapr. The app creates photo mosaics. It runs locally in Docker Compose with local services (Zipkin, Redis, Postgres) and runs in Azure Container Apps with cloud resources (App Insights, Azure Service Bus, Cosmos DB, Azure PostgreSQL).

License: MIT License

HTML 12.33% C# 66.77% CSS 2.79% PowerShell 1.07% Dockerfile 2.87% TSQL 0.22% Bicep 13.95%
azure-container-apps csharp dapr microservices

mosaic-microservices's Introduction

Mosaic

This project is a work-in-progress example of a microservice architecture app built with Dapr. The app creates photo mosaics. It runs locally in Docker Compose with local services (Zipkin, Redis, Postgres) and runs in Azure Container Apps with cloud resources (App Insights, Azure Service Bus, Cosmos DB, Azure PostgreSQL).

cloud architecture

App Services

Front End

Client UI written in Blazor Web Assembly. The WASM app is served from an ASP.NET Host which also helps with authentication (AAD B2C)

Tiles API

REST API for inserting/updating tiles in the database

Tile Processor

ASP.NET Hosted Service which listens for create tile events and pre-calculates the necessary color data for creating mosiacs

Mosaic API

REST API for creating mosaics from the tiles in the database

Mosaic Processor

ASP.NET Hosted Service which listens for create mosaic events and generates the mosaics

Azure Resources

  • Azure Service Bus
  • Azure Database for PostgreSQL
  • Azure Storage
  • Application Insights
  • Azure Container Apps
  • Cosmos DB
  • AAD B2C

Deployment

Local

  1. Create an Azure blob storage container
  2. Create a "secrets.json" file in the src/components folder (this file will be ignored by git)
  3. In the secrets.json file, create a key "tileStorageKey" with the value of the blob storage access key
  4. In the usersecrets of the Tile API, add a key "ConnectionStrings:tiledbconnectionstring" with a value below
    • NOTE: The admin username and password can changed from the defaults in docker-composer.override.yml
  "Server=mosaic.tilesapi.db;Database=tiles;Port=5432;User Id={POSTGRESADMIN};Password={POSTGRESADMINPWD};Ssl Mode=Prefer;"
  1. Run the solution in Visual Studio using the docker-compose project as the startup project
  2. Once started up, the front end will display, but the database still needs to be initialized. Run the following command from the Mosaic.TilesApi project directory. The connection string is the same as step 4 except the server is "localhost"
    dotnet ef database update --connection "{CONNECTION STRING}"
    

In Azure

  1. initialize the Azure CLI - only needs run once - prereq.ps1
  2. provision the app with provision.ps1
  • REQUIRED - provide the name of the stage (dev, prod, etc). This will be used in the names of all the resources
  • REQUIRED - provide the SQL admin password
  1. Update the database schema. Run the following command from the Mosaic.TilesApi project directory. The connection string is the same form as above step 4 except the server will be the azure postgres instance domain name, the admin user name is "mosaic" and the password is whatever you specified when running the script
dotnet ef database update --connection "{CONNECTION STRING}"

mosaic-microservices's People

Contributors

negativeeddy avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

disgone

mosaic-microservices's Issues

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.