{"id":21565247,"url":"https://github.com/mastercloudapps-projects/iss-api-gateway","last_synced_at":"2025-03-18T05:17:48.607Z","repository":{"id":55776035,"uuid":"285352226","full_name":"MasterCloudApps-Projects/iss-api-gateway","owner":"MasterCloudApps-Projects","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-12T18:21:27.000Z","size":6672,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-24T11:44:48.068Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MasterCloudApps-Projects.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}},"created_at":"2020-08-05T16:54:45.000Z","updated_at":"2020-12-14T16:11:47.000Z","dependencies_parsed_at":"2022-08-15T07:00:36.940Z","dependency_job_id":null,"html_url":"https://github.com/MasterCloudApps-Projects/iss-api-gateway","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasterCloudApps-Projects%2Fiss-api-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasterCloudApps-Projects%2Fiss-api-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasterCloudApps-Projects%2Fiss-api-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasterCloudApps-Projects%2Fiss-api-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MasterCloudApps-Projects","download_url":"https://codeload.github.com/MasterCloudApps-Projects/iss-api-gateway/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244160055,"owners_count":20408021,"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":[],"created_at":"2024-11-24T10:18:59.950Z","updated_at":"2025-03-18T05:17:48.578Z","avatar_url":"https://github.com/MasterCloudApps-Projects.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iss-api-gateway\n\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=iss-api-gateway\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=iss-api-gateway)[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=iss-api-gateway\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=iss-api-gateway)\n\nWe decided to implement it in an extremely simplified version of an insurance sales system to test the following aspects of microservice development:\n\n* Project creation and development\n* Access of both relational and NoSQL databases\n* Blocking and non-blocking operations implementation\n* Microservice to microservice communication (synchronous and asynchronous)\n* Service discovery\n* Running background jobs\n\n![Architecture](https://github.com/MasterCloudApps-Projects/iss-api-gateway/blob/master/images/iss-architecture.jpg?raw=true)\n\nThe complexity of “business microservices” was hidden by using a Gateway pattern. This component was responsible for the proper redirection of requests to the appropriate services based on the configuration. The frontend application could only communicate with this component. This component showed the usage of non-blocking http declarative clients.\n\n## How to run Application\n\nRunning application from command line using Docker, this is the cleanest way.\nIn order for this approach to work, of course, you need to have Docker installed in your local environment.\n\n* From the root directory you can run the following command:\u003cbr/\u003e\n    ```docker-compose -f docker/docker-compose.yml up --build```\n* Application will be running on: http://localhost:8084\n* To stop it you can open other terminal in the same directory, and then run the following command:\u003cbr/\u003e\n    ```docker-compose -f docker/docker-compose.yml down```\n\n## How to run the Unit Test\n\n```mvn -B clean verify```\n\n## Deploy solution in minikube\n\n# Prerequisites\n\n- Minikube cluster with kubectl installed and configured to use your cluster\n\n1. Run minikube\n```\nminikube start --memory 8192\n```\n2. Create a ClusterRoleBinding for default namespace\n```\nkubectl create clusterrolebinding admin --clusterrole=cluster-admin --serviceaccount=default:default\n```\n3. Create a config map of Postgres\n```\nkubectl apply -f k8s/postgres/postgres-config.yaml\n```\n4. Deploy Postgres with a persistent volume claim\n```\nkubectl apply -f k8s/postgres/volume.yaml\nkubectl apply -f k8s/postgres/postgres.yaml\n```\n5. Create a config map and secret of Mongodb\n```\nkubectl apply -f k8s/mongodb/mongodb-config.yaml\nkubectl apply -f k8s/mongodb/mongodb-secret.yaml\n```\n6. Deploy Mongodb with a persistent volume claim\n```\nkubectl apply -f k8s/mongodb/volume.yaml\nkubectl apply -f k8s/mongodb/mongodb.yaml\n```\n7. Create a config map of Kafka service\n```\nkubectl apply -f k8s/kafka/kafka-config.yaml\n```\n8. Deploy Zookeeper and Kafka Cluster\n```\nkubectl apply -f k8s/kafka/zookeeper-services.yaml\nkubectl apply -f k8s/kafka/zookeeper-cluster.yaml\nkubectl apply -f k8s/kafka/kafka-service.yaml\nkubectl apply -f k8s/kafka/kafka-cluster.yaml\n```\n9. Deploy Pricing service\n```\nkubectl apply -f k8s/iss-pricing-service-deployment.yaml\n```\n10. Deploy Product service\n```\nkubectl apply -f k8s/iss-product-service-deployment.yaml\n```\n11. Deploy Policy service\n```\nkubectl apply -f k8s/iss-policy-service-deployment.yaml\n```\n12. Deploy Policy search service\n```\nkubectl apply -f k8s/iss-policy-search-service-deployment.yaml\n```\n13. Deploy Payment service\n```\nkubectl apply -f k8s/iss-payment-service-deployment.yaml\n```\n14. Deploy Api gateway service\n```\nkubectl apply -f k8s/iss-api-gateway-deployment.yaml\n```\n15. Active ingress controller plugin\n```\nminikube addons enable ingress\n```\n16. Deploy ingress\n```\nkubectl apply -f k8s/ingress.yaml\n```\n17. Define mastercloudapps.com local DNS\n```\nexport MINIKUBE_IP=$(minikube ip)\necho $MINIKUBE_IP mastercloudapps.com | sudo tee --append /etc/hosts \u003e/dev/null\n```\n18. Check status pods and services with kubectl get pods,services\n```\nkubectl get pods,services\n```\n![Pods](https://github.com/MasterCloudApps-Projects/iss-api-gateway/blob/master/images/pods-services.png?raw=true)\n\n19. run dashboard and check status services in dashboard\n```\nminikube dashboard\n```\n\n![Dashboard](https://github.com/MasterCloudApps-Projects/iss-api-gateway/blob/master/images/services-dashboard.png?raw=true)\n\n\n20. an example of endpoint execution\n\n![Mastercloudapps](https://github.com/MasterCloudApps-Projects/iss-api-gateway/blob/master/images/mastercloudapps-example.png?raw=true)\n\n\n21. Deleting all the Resources\n\n```\nkubectl delete -f k8s/ingress.yaml\nkubectl delete -f k8s/iss-api-gateway-deployment.yaml\nkubectl delete -f k8s/iss-payment-service-deployment.yaml\nkubectl delete -f k8s/iss-policy-search-service-deployment.yaml\nkubectl delete -f k8s/iss-policy-service-deployment.yaml\nkubectl delete -f k8s/iss-product-service-deployment.yaml\nkubectl delete -f k8s/iss-pricing-service-deployment.yaml\nkubectl delete -f k8s/kafka/kafka-config.yaml\nkubectl delete -f k8s/kafka/kafka-cluster.yaml\nkubectl delete -f k8s/kafka/kafka-service.yaml\nkubectl delete -f k8s/kafka/zookeeper-cluster.yaml\nkubectl delete -f k8s/kafka/zookeeper-services.yaml\nkubectl delete -f k8s/mongodb/mongodb.yaml\nkubectl delete -f k8s/mongodb/volume.yaml\nkubectl delete -f k8s/mongodb/mongodb-config.yaml\nkubectl delete -f k8s/mongodb/mongodb-secret.yaml\nkubectl delete -f k8s/postgres/postgres.yaml\nkubectl delete -f k8s/postgres/volume.yaml\nkubectl delete -f k8s/postgres/postgres-config.yaml\n```\n\n22. Stop minikube\n```\nminikube stop\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmastercloudapps-projects%2Fiss-api-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmastercloudapps-projects%2Fiss-api-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmastercloudapps-projects%2Fiss-api-gateway/lists"}