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).
Client UI written in Blazor Web Assembly. The WASM app is served from an ASP.NET Host which also helps with authentication (AAD B2C)
REST API for inserting/updating tiles in the database
ASP.NET Hosted Service which listens for create tile events and pre-calculates the necessary color data for creating mosiacs
REST API for creating mosaics from the tiles in the database
ASP.NET Hosted Service which listens for create mosaic events and generates the mosaics
- Azure Service Bus
- Azure Database for PostgreSQL
- Azure Storage
- Application Insights
- Azure Container Apps
- Cosmos DB
- AAD B2C
- Create an Azure blob storage container
- Create a "secrets.json" file in the src/components folder (this file will be ignored by git)
- In the secrets.json file, create a key "tileStorageKey" with the value of the blob storage access key
- 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;"
- Run the solution in Visual Studio using the docker-compose project as the startup project
- 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}"
- initialize the Azure CLI - only needs run once - prereq.ps1
- 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
- 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}"