A simple proof of concept banking system built on Microservices Architecture
| Spring Cloud : config server | eureka | Gateway server. |
Shout out to EazyBytes for teaching me most of what i implemented in this project.
-Before running this solution you need to have docker installed in your local system.
docker-compose file; run docker-compose up to spin up all the microservices that power this project.-Clone the project and generate you own docker images from the following springBoot projects :
1. Accounts :
has a docker file to build its image command: mvn install + docker build . -t mufasa/accounts
2. Cards - command `mvn spring-boot:build-image`
3. ConfigServer - command `mvn spring-boot:build-image`
4. EurekaServer - command `mvn spring-boot:build-image`
5. GatewayServer - command `mvn spring-boot:build-image`
6. Loans - command `mvn spring-boot:build-image`
7. Zipkin - command `docker run -p 9411:9413 openzipkin/zipkin `
8. Keycloak server - command `docker run -p 7080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:18.0.0 start-dev`
Haha.zipkin->keycloak->configserver->eurekaserver->accounts->loans->cards->gatewayserver
And felicidades! you are ready to test build more on this project !Note:
loans service endpoints require authentication while some require authorization too.http://localhost:8072/mufasa/*Oauth2 client credentials grant flow and Oauth2 Authorization code grant flow . The submitted code uses the latter but you can pull this accounts image and gatewayserver image from my dockerhub to test using client credentials grant flow / clone the code from client-credentials-grantflow branch
. The submitted code uses the latter but you can pull this [accounts microservice image) to use the former.
``


2. Create a role called ACCOUNTS and assign it to mufasa-test-environment client.

3. Create user and give them ACCOUNTS role

- a `post` call to : `http://localhost:7080/realms/master/protocol/openid-connect/token` to get a token`

- Call the endpoints using this generated token.
- call any `get` rest API from the browser.
- the URL should be redirected to a keycloak login page.
- login with a user with the required roles to access that resource.
- log in to your google cloud platform and select a GKE(Google Kubernetes Engine resource).
- Create a cluster and connect to it in your local terminal.
`Note` :
1. You can choose to deploy each microservice at a time to the kubernetes cluster/ you can use `helm` charts provided in this repo/helm to deploy all the microservices at once.
kubectl scale deployment accounts-deployment --replicas=3
kubectl describe pod <pod name>
kubectl set image deployment accounts-deployment accounts=bobmwas/mufasa:accounts-k8s
kubectl get events --sort-by=.metadata.creationTimestamp
kubectl rollout history deployment accounts-deployment
kubectl rollout undo deployment accounts-deployment --to-revision=1
helm create <chartName>
helm dependencies build
helm template .
helm install <deployment name> <helm env folder>
helm upgrade <deployment name> <helm env folder>
helm history <deployment name>
helm rollback <deployment name> <revision number>
helm uninstall <deployment name>
helm list
gcloud config set project <project name>
docker system prune -a :- removes all stopped containers,un used images cache etc
docker stop $(docker container ls -q) :-stops all running containers