Skip to content

robinmanuelthiel/microcommunication

Repository files navigation

Screenshot of the Web Frontend

Micro-service Intercommunication Demo

Docker   Docker   Docker   Build and push Docker images   Quality Gate Status

This is a small demo project to quickly setup a mix of containerized micro-services that communicate with each other within the network. This demo is intended to provide a playground for orchestrators!

The project consists of

  • An API Gateway, written in .NET Core, exposes port 8080 (8080 when in a Container)
  • A Radom Number Generator Service, written in .NET Core, exposes port 8090 (8080 when in a Container)
  • A Web Frontend, written in Angular, exposes port 4200 (8080 when in a Container)

Make it run

Prerequisites

The easiest way to run and debug the microservices on you development machine is Visual Studio Code. Just open the folder and select one of the Debug configurations.

Screenshot of Visual Studio Code

Environment variables

You need to set some environment variables to configure the services and their discovery.

MicroCommunication.Api:

  • ApiKey=test123 Optional: The key, that the API allows for authorization
  • RedisCacheConnectionString=... Optional: The connection string for a Redis Cache to sync SignalR Hubs
  • ApplicationInsightsConnectionString=... Optional: The Azure Application Insights Connection String
  • Cors Optional: The domain of your web app to add to the CORS
  • RandomApiUrl The URL to connect to the Random Service

MicroCommunication.Random:

  • MongoDbConnectionString=mongo://... Optional: The connection string for a Mongo DB to store the history in
  • ApplicationInsightsConnectionString=... Optional: The Azure Application Insights Connection String
  • Cors Optional: The domain of your web app to add to the CORS

MicroCommunication.Web:

  • API_URL=http://localhost:8080 Where to find the API
  • API_KEY=test123 Which key to use when calling the API
  • APPLICATION_INSIGHTS_CONNECTION_STRING=... Optional: The Azure Application Insights Connection String

Deploy

This Demo project is intended to be tested within container orchestrators. For the various different orchestrators out there, you can find configuration files for multiple different ones in the repository.

Kubernetes

Manifests

kubectl create -f env/kubernetes

Helm

helm install microcommunication env/helm \
  --namespace microcommunication \
  --create-namespace

GitOps with Flux

helm repo add fluxcd https://charts.fluxcd.io

helm upgrade -i flux fluxcd/flux \
  --set git.url=https://github.com/robinmanuelthiel/microcommunication.git \
  --set git.path=env/kubernetes \
  --set git.readonly=true \
  --namespace flux

Docker Compose

docker compose -f env/docker/docker-compose.yaml up

Testing

Performance Test

k6 tests/performance/script.js

About

A Demo project for micro-service intercommunication

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published