{"id":19818837,"url":"https://github.com/sloppycoder/bank-demo","last_synced_at":"2025-10-05T06:47:44.764Z","repository":{"id":41622128,"uuid":"271636823","full_name":"sloppycoder/bank-demo","owner":"sloppycoder","description":"demo banking application written using gRPC microservices","archived":false,"fork":false,"pushed_at":"2022-12-08T01:53:46.000Z","size":4183,"stargazers_count":6,"open_issues_count":12,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2023-02-27T23:02:09.530Z","etag":null,"topics":["distributed-tracing","gke","golang","grpc","istio","java","kuber","micronaut","micronaut-grpc","microservices-architecture","opencensus","python"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sloppycoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-11T20:04:19.000Z","updated_at":"2022-12-27T08:25:21.000Z","dependencies_parsed_at":"2023-01-25T02:15:15.823Z","dependency_job_id":null,"html_url":"https://github.com/sloppycoder/bank-demo","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/sloppycoder%2Fbank-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloppycoder%2Fbank-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloppycoder%2Fbank-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloppycoder%2Fbank-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sloppycoder","download_url":"https://codeload.github.com/sloppycoder/bank-demo/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224253291,"owners_count":17280936,"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":["distributed-tracing","gke","golang","grpc","istio","java","kuber","micronaut","micronaut-grpc","microservices-architecture","opencensus","python"],"created_at":"2024-11-12T10:17:02.840Z","updated_at":"2025-10-05T06:47:44.694Z","avatar_url":"https://github.com/sloppycoder.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A modern microservice based application  \n\nThis is a demo banking applicaiton built around modern technolgies. The key pillars of this application are:\n* Self-contained [microservices](https://microservices.io/patterns/microservices.html) deployed into [Kubernetes](https://kubernetes.io)\n* [Polyglot](https://en.wikipedia.org/wiki/Polyglot_(computing)) applicatoin with microservices written in different languages and communicate with each other over standard network protocols.\n* Every microservice supports observability with metrics and distributed tracing. Use [opencensus](https://opencensus.io/) and [Prometheus](https://prometheus.io/) to be compatbile with both on-premise stack with [Jaeger](https://www.jaegertracing.io/), [Prometheus](https://prometheus.io/) and [Elastic](https://www.elastic.co/); or [Stackdriver](https://cloud.google.com/products/operations) in GCP.\n* Use [Istio](https://istio.io) service mesh to perform traffic management within and inter kubernetes clusters\n* High performance inter microservice communication with [gRPC](https://grpc.io). The gRPC services can be directly exposed to external client or use [Envoy gRPC-Web filter](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/grpc_web_filter) for clients that do not support HTTP/2 natively.\n\n\n\n![architecture diagram](doc/architecture.png)\n\n\n\n## Modules in this repo\n\n| Directory     | Language      | Conent      |\n| ------------- |-------------|-------------| \n| [protos](protos)    | protobuf | protobuf API definition used in all across the application. |\n| [dashboard](dashboard) | Go | dashboard microservice, calls casa-account services, either v1 or v2, controlled by [istio virtualservice](https://istio.io/latest/docs/reference/config/networking/virtual-service/) configuration      |\n| [customer-v1](customer-v1) | Java | customer microservice built using spring boot. It reads customer data stored in MySQL |\n| [casa-account-v1](casa-account-v1) | Java | casa account microservice built using [micronaut](https://micronaut.io/) framework. It reads account data stored in Cassandra |\n| [casa-account-v2](casa-account-v2) | nodejs | casa account microservice, only returns dummy data. |\n| [ext-cust-svc](ext-cust-svc) | python | a simple http server written using [aiohttp](https://docs.aiohttp.org/en/stable/#) to mock an external REST server that provides customer info |\n| [load-generator](load-generator) | python | uses [Locust](https://locust.io/) to generate API calls |\n| [testdata](testdata) | python | generates test data and write them to Cassandra |\n| [istio](istio) | yaml | istio manifest files to traffice management |\n| [gcp](gcp) | shell | script and manifests to provision GKE cluster. |\n\n### Requirement\nThe code in this repo has been tested with minikube and GKE. Details below\n\nLocal Minikue\n* Ubuntu Linux 20.04\n* [minikube](https://kubernetes.io/docs/setup/learning-environment/minikube/) v1.11.0\n* Kubernetes 1.16.8\n* Istio 1.4.8\n* [Apache Cassandra](https://cassandra.apache.org/) version 4.0.0\n\nGoogle Kubernetes Engine\n * Kubernetes provisioned using [regular channel provided by GKE](https://cloud.google.com/kubernetes-engine/docs/release-notes-regular), v1.16.8-gke.15 as of now\n * Istio is provisioned as a feature of GKE cluster, 1.4.6-gke.0 as of now\n * [Datastax Astra](https://www.datastax.com/products/datastax-astra) running in GCP\n\nDevelopment Tools:\n* [kustomize](https://github.com/kubernetes-sigs/kustomize) 3.5.4\n* [skaffold](https://skaffold.dev) v1.10.1\n\n### Run with minikube\nBelow are steps tesed on Ubutnu Bionic and Focal, should work on other linux flavors too.\n\nGet prerequites first\n1. [Install minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/)\n2. Download Istio from 1.4.8 from [Istio release pages from Github](https://github.com/istio/istio/releases/)\n3. [Install Skaffold](https://skaffold.dev/docs/install/) \n4. Get Evans gRPC utility from [Github release pages](https://github.com/ktr0731/evans/releases)\n\nfirst, then\n```\n#\n# the k8s and istio versions below matches to versions in GKE's regular channel\n#\n\n# start minikube. for \nminikube start \\\n   --driver=kvm2 \\\n   --disk-size='30000mb' \\\n   --cpus='2' \\\n   --memory='12000mb' \\\n   --kubernetes-version='1.16.8'\n\n# install istio with auto mTLS enabled\ncd istio-1.4.8\nbin/istioctl manifest apply --set profile=demo \\\n  --set values.global.mtls.auto=true \\\n  --set values.global.mtls.enabled=true\n\n# istio takes sometime to get installed, wait till all the \n# pods are in Running status\n\n# expose port 31400 for use grpc services\n# this port is enabled on GCP and later versions of Istio\nkubectl patch svc istio-ingressgateway -n istio-system \\\n--type='json' \\\n-p='[{\"op\":\"add\",\"path\":\"/spec/ports/0\",  value: {\"name\": \"tcp\", \"port\":31400,\"targetPort\":31400, \"protocol\":\"TCP\"}}]'\n\n#\n# come back to this directory and run all the services \n# the script should build and start microservices\n./deploy\n\n# if all goes well, you should see output similiar to the one below\n{\n  \"customer\": {\n    \"customerId\": \"10001000\",\n    \"loginName\": \"10001000\"\n  }\n}\n\n```\n\n\n\n### Roadmap\n1. better integration of logging and tracing. ability to navigate from trace to log with high accuracy. (implemeneted logic for adding data to trace span, and use custom data, e.g. login_name to search trace span. same custom data is added to log entries)\n2. use an external OpenID Connect provide for authentication.\n3. enable mTLS for inter microservice communication. (done)\n4. use Istio for oauth token validation\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsloppycoder%2Fbank-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsloppycoder%2Fbank-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsloppycoder%2Fbank-demo/lists"}