{"id":19099830,"url":"https://github.com/thinktecture-labs/cloud-native-sample","last_synced_at":"2025-04-18T17:32:07.166Z","repository":{"id":46143171,"uuid":"483995851","full_name":"thinktecture-labs/cloud-native-sample","owner":"thinktecture-labs","description":"Sample application to demonstrate how to build, orchestrate, and automate a polyglot cloud-native application","archived":false,"fork":false,"pushed_at":"2023-06-07T13:55:41.000Z","size":39573,"stargazers_count":24,"open_issues_count":18,"forks_count":9,"subscribers_count":8,"default_branch":"main","last_synced_at":"2023-06-07T14:37:13.210Z","etag":null,"topics":["azure","csharp","docker","golang","kubernetes","rust"],"latest_commit_sha":null,"homepage":"","language":"C#","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/thinktecture-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-04-21T09:52:57.000Z","updated_at":"2023-09-24T16:29:22.791Z","dependencies_parsed_at":"2023-09-24T16:43:48.235Z","dependency_job_id":null,"html_url":"https://github.com/thinktecture-labs/cloud-native-sample","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinktecture-labs%2Fcloud-native-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinktecture-labs%2Fcloud-native-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinktecture-labs%2Fcloud-native-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinktecture-labs%2Fcloud-native-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thinktecture-labs","download_url":"https://codeload.github.com/thinktecture-labs/cloud-native-sample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223783108,"owners_count":17201903,"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":["azure","csharp","docker","golang","kubernetes","rust"],"created_at":"2024-11-09T03:52:19.170Z","updated_at":"2025-04-18T17:32:07.158Z","avatar_url":"https://github.com/thinktecture-labs.png","language":"C#","funding_links":[],"categories":["azure","rust"],"sub_categories":[],"readme":"# Cloud-Native Sample Application\n\nThis repository contains a sample application that serves as a demonstration for building and automating a polyglot cloud-native application. The application is designed to showcase proven practices for developing and deploying cloud-native software using a combination of programming languages and tools:\n\n* Programming Languages\n  * .NET (C#)\n  * Go\n\n* Tools\n  * Docker\n  * Docker Compose\n  * Dapr (Distributed Application Runtime)\n  * Kubernetes (when running in Azure)\n  * HashiCorp Terraform\n  * GitHub Actions\n  * Makefiles\n\n[TBD: Some general introduction.]\n\n## Builds\n\n![AuthenticationService](https://img.shields.io/github/actions/workflow/status/thinktecture-labs/cloud-native-sample/cn.authn.ci.yml?branch=main\u0026label=Authentication%20Service\u0026logo=github) ![OrdersService](https://img.shields.io/github/actions/workflow/status/thinktecture-labs/cloud-native-sample/cn.orders.ci.yml?branch=main\u0026label=Orders%20Service\u0026logo=github) ![ProductsService](https://img.shields.io/github/actions/workflow/status/thinktecture-labs/cloud-native-sample/cn.products.ci.yml?branch=main\u0026label=Products%20Service\u0026logo=github) ![ShippingService](https://img.shields.io/github/actions/workflow/status/thinktecture-labs/cloud-native-sample/cn.shipping.ci.yml?branch=main\u0026label=Shipping%20Service\u0026logo=github) ![OMC](https://img.shields.io/github/actions/workflow/status/thinktecture-labs/cloud-native-sample/cn.order-monitor-client.ci.yml?branch=main\u0026label=Order%20Monitor%20Client\u0026logo=github) ![OrderMonitorService](https://img.shields.io/github/actions/workflow/status/thinktecture-labs/cloud-native-sample/cn.authn.ci.yml?branch=main\u0026label=Order%20Monitor%20Service\u0026logo=github) ![Gateway](https://img.shields.io/github/actions/workflow/status/thinktecture-labs/cloud-native-sample/cn.gateway.ci.yml?branch=main\u0026label=Gateway\u0026logo=github)\n\n## License\n\n[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)\n\n## Application Diagram\n\n![Architecture Overview](assets/architecture-overview.jpg)\n\n## Observability Stack\n\nFor the scope of this application, we've choosen the following technologies to address observability concerns:\n\n* Metrics: [Prometheus](https://prometheus.io)\n* Distributed Tracing: [Zipkin](https://zipkin.io)\n* Logs: [Grafana Loki](https://grafana.com/oss/loki/)\n* Visualization: [Grafana](https://grafana.com/grafana/)\n\n## Local execution\n\nWe decided to go with Docker Compose for local development story. As an alternative, you can also setup a local Kubernetes cluster (KIND / minikube /...).\n\n### URLs and demo credentials\n\nWhen running the application in Docker Compose, you'll end up with the following ports forwarded on your host machine:\n\n* Frontend: Order Monitor Client (OMC)\n  * [http://localhost:5000](http://localhost:5000)\n* Authentication Service (IdSrv)\n  * [http://localhost:5009](http://localhost:5009)\n  * Credentials (`bob:bob`)\n* Gateway\n  * Root: [http://localhost:5000](http://localhost:5000) -\u003e Serves the Frontend (OMC)\n  * Swagger (Products Service): [http://localhost:5000/products/swagger/](http://localhost:5000/products/swagger/)\n  * Swagger (Orders Service): [http://localhost:5000/orders/swagger/](http://localhost:5000/orders/swagger/)\n* Grafana\n  * [http://localhost:3000](http://localhost:3000)\n  * Username: `admin`\n  * Password: `admin`\n* Prometheus\n  * [http://localhost:9090](http://localhost:9090)\n* Alertmanager\n  * [http://localhost:9093](http://localhost:9093)\n* Zipkin\n  * [http://localhost:9411](http://localhost:9411)\n* RabbitMQ\n  * [http://localhost:15672](http://localhost:15672)\n  * Username: `guest`\n  * Password: `guest`\n\n**Use [http://localhost:5000](http://localhost:5000) to access the OMC proxied through the gateway locally.**\n\nNote: *Dapr-dashboard does currently not work in Docker compose mode*\n\n### Necessary plugins for local execution\n\nWe use Loki as log aggregation system. In the local environment, we leverage lokis docker plugin to ship all logs from containers output streams (`STDOUT` and `STDERR`) to Loki.\n\n```bash\n# Install Docker Plugin for Loki\ndocker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions\n```\n\n### Local Environment Execution using the Makefile\n\nFind the `Makefile` in the root of the repository. Use it to perform common tasks as shown below:\n\n```bash\n\n# Install loki plugin locally\nmake init\n\n# Start the sample locally (in docker)\nmake start \n\n# Quickstart (no image build) the sample locally (in docker)\nmake quickstart\n\n# get logs\nmake logs\n\n# stop the sample\nmake stop\n\n# clean-up the local docker environment\n## stops everything\n## removes images\n## removes volumes\n## removes orphan containers\n## removes custom docker network\nmake cleanup\n```\n\n### Local Environment Execution using the docker-compose CLI\n\n```bash\n# Build Container images\ndocker-compose build\n\n# Cleanup previously started instances\ndocker-compose rm -f\n\n# Start cloud-native sample application (detached)\ndocker-compose up -d\n# Start cloud-native sample application (blocking)\ndocker-compose up\n\n# To stream logs to the terminal use\ndocker-compose logs\n```\n\n#### Cleanup environment\n\n```bash\n# remove running containers\ndocker-compose rm -f\n\n# remove custom Docker network\ndocker network rm cloud-native -f\n\n# uninstall Loki Plugin\ndocker plugin rm loki -f\n```\n\n### Local Environment Execution using the `cn-sample` CLI\n\nYou can also automate the local environment execution using the `cn-sample` CLI (see `/tools/\u003cyour_platform\u003e`).\n\nConsider adding `cn-sample` to your path before invoking it.\n\nThe `sn-sample` CLI is designed to be invoked from the root directory of this repository.\n\n## Azure environment\n\nFor demonstration purposes, we added all necessary Infrastructure-as-Code (IaC) (using [HashiCorp Terraform](https://terraform.io)) and corresponding [GitHub Actions](./github/workflows) to deploy and run the application in Microsoft Azure leveraging Azure Kubernetes Service (AKS).\n\nWhen running in the cloud, one must always decide on **Run vs. Rent**. For example: Instead of running a message broker like [RabbitMQ](https://www.rabbitmq.com/) on your own (yes, running something in a container means you run it on your own, because you've to maintain and troubleshoot it), and renting a message broker like [Azure Service Bus](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview).\n\nAgain, you can find corresponding GitHub Actions in the repository to switch between **Run** and **Rent** in Azure. Those GitHub Actions must be triggered manually.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinktecture-labs%2Fcloud-native-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthinktecture-labs%2Fcloud-native-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinktecture-labs%2Fcloud-native-sample/lists"}