{"id":16407586,"url":"https://github.com/musabbozkurt/api-gateway-service","last_synced_at":"2025-07-24T03:06:04.694Z","repository":{"id":176736938,"uuid":"465049779","full_name":"musabbozkurt/api-gateway-service","owner":"musabbozkurt","description":"API Gateway Service with Spring Cloud Gateway, Spring Boot 3, Java 21","archived":false,"fork":false,"pushed_at":"2025-06-11T12:51:51.000Z","size":672,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T13:55:18.319Z","etag":null,"topics":["docker-compose","eureka-client","eureka-server","feign-client","google-recaptcha","hcaptcha","java-21","keycloak","kubernetes","kubernetes-deployment","maven","mdc","micrometer","openai","rabbitmq","spring-boot-3","spring-cloud-gateway","springdoc-openapi-ui","swagger-ui","swagger2"],"latest_commit_sha":null,"homepage":"","language":"Java","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/musabbozkurt.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-01T20:41:29.000Z","updated_at":"2025-06-11T12:51:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"4919e7cd-26e2-446c-8a80-56e61fa01c07","html_url":"https://github.com/musabbozkurt/api-gateway-service","commit_stats":null,"previous_names":["musabbozkurt/api-gateway-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/musabbozkurt/api-gateway-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musabbozkurt%2Fapi-gateway-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musabbozkurt%2Fapi-gateway-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musabbozkurt%2Fapi-gateway-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musabbozkurt%2Fapi-gateway-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/musabbozkurt","download_url":"https://codeload.github.com/musabbozkurt/api-gateway-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musabbozkurt%2Fapi-gateway-service/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266786798,"owners_count":23983871,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docker-compose","eureka-client","eureka-server","feign-client","google-recaptcha","hcaptcha","java-21","keycloak","kubernetes","kubernetes-deployment","maven","mdc","micrometer","openai","rabbitmq","spring-boot-3","spring-cloud-gateway","springdoc-openapi-ui","swagger-ui","swagger2"],"created_at":"2024-10-11T06:14:17.885Z","updated_at":"2025-07-24T03:06:04.668Z","avatar_url":"https://github.com/musabbozkurt.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003e\u003ch2 style=\"display: inline-block\"\u003eTable of Contents\u003c/h2\u003e\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#summary\"\u003eSummary\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#services\"\u003eServices\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#references\"\u003eReferences\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n---\n\n\u003c!-- SUMMARY --\u003e\n\n## Summary\n\n- `api-gateway-service` project established by combination of the following services and features\n\n### Services\n\n   ```\n    * api-gateway\n    * payment-service\n    * student-service\n    * swagger-application\n    * openai-service\n    * service-registry\n   ```\n\n### Features\n\n   ```\n    * Spring Cloud Gateway\n    * SpringDoc Swagger\n    * Event Driven Architecture with RabbitMQ\n    * micrometer-tracing dependencies to track the logs\n    * Postman collection to test by using Postman\n    * Keycloak integration is completed under the payment-service\n    * Feign Client secure call with Keycloak integration is completed under the student-service\n    * MDC was added to improve logging between microservices\n    * Google reCAPTCHA was added to secure endpoint calls\n    * HCaptcha repo migration is completed under the student-service\n    * openai-service repo migration is completed\n    * Spring Cloud Eureka Server and Client integrations are completed with service-registry repo\n    * KubernetesDeploymentGuide.md is added\n   ```\n\n---\n\n\u003c!-- GETTING STARTED --\u003e\n\n## Getting Started\n\n- To get a local copy up and running please follow these steps\n\n---\n\n### Prerequisites\n\n- Followings should be installed and links for how to install them\n  ####\n    * Java 21 or higher [How to install Java](https://java.com/en/download/help/download_options.html)\n        * Set `JAVA_HOME` to 21 -\u003e `export JAVA_HOME=$(/usr/libexec/java_home -v 21)`\n    * Maven [How to install Maven](https://maven.apache.org/install.html)\n    * Docker [How to install Docker](https://docs.docker.com/get-docker)\n    * [Postman](https://www.postman.com/downloads/) can be installed (OPTIONAL),\n      follow [how to import postman collection](https://learning.postman.com/docs/getting-started/importing-and-exporting-data/#importing-postman-data)\n      to import files that are under the [postman_collection](docs/postman_collection) folder\n  ####\n    * Create a new secret key via [this url](https://platform.openai.com/account/api-keys), copy the value, and add it\n      as `YOUR_API_KEY_HERE` value in the [.env](.env)\n  ####\n    * Google reCAPTCHA installation (OPTIONAL)\n        * Log in to the https://www.google.com/recaptcha/admin/create\n        * Fill the necessary fields.\n            * [This url](https://examples.javacodegeeks.com/wp-content/uploads/2020/12/springboot-google-captcha-google-config-img1.jpg)\n              can guide you\n        * Copy `SITE_KEY` and `SECRET_KEY` and add them into related fields that are in the [.env](.env)\n  ####\n    * HCaptcha integration was implemented in 4 different ways\n      in [HCaptchaController.java](student-service/src/main/java/com/mb/studentservice/api/controller/HCaptchaController.java)\n      (OPTIONAL)\n\n---\n\n### Installation\n\n1. Clone the repo\n   ```sh\n    git clone https://github.com/musabbozkurt/api-gateway-service.git\n   ```\n\n####\n\n2. Run all services\n\n    - (OPTION 1)\n        - Run `docker-compose --profile start_application up -d --build` command in\n          the [docker-compose.yml](docker-compose.yml) directory\n    - (OPTION 2)\n        1. Enable [spring.docker.compose](api-gateway/src/main/resources/application.yml) property and just\n           run [ApiGatewayApplication.java](api-gateway/src/main/java/com/mb/apigateway/ApiGatewayApplication.java) to\n           install RabbitMQ, PostgreSQL and Keycloak\n        2. Run `mvn clean install` or `mvn clean package` command under each service's directory\n        3. Run `mvn spring-boot:run` command under each service's directory\n\n####\n\n3. Log in to http://localhost:9090/admin with `username`: `admin` and `password`: `admin`\n    1. `Create realm` --\u003e Import [payment-service-realm-export.json](docs/keycloak/payment-service-realm-export.json)\n    2. `Clients` --\u003e `payment-service` --\u003e `Credentials` --\u003e `Regenerate` copy the value and add it as\n       `PAYMENT_CLIENT_SECRET_ENV` value in the [.env](.env)\n    3. `Users` --\u003e `Add user` --\u003e `Username` --\u003e `payment-service-user`\n    4. `Users` --\u003e `payment-service-user` --\u003e `Credentials` --\u003e `Set password` to `test` and turn off `Temporary` toggle\n    5. `Users` --\u003e `payment-service-user` --\u003e `Role Mapping` --\u003e `Assign role` add `admin` role\n    6. Restart `student-service` to fetch `PAYMENT_CLIENT_SECRET`\n\n####\n\n4. Additional information to access endpoints, swagger and actuator\n\n    * Swagger: http://localhost:8080/swagger-ui.html\n        * Open `Swagger` --\u003e select `Payment Service` definition --\u003e Click `Authorize`\n            1. Enter the following credentials into the pop-up window\n                1. `username`: `payment-service-user`\n                2. `password`: `test`\n                3. `client_id`: `payment-service`\n                4. `client_secret`: `PAYMENT_CLIENT_SECRET_ENV` value in the [.env](.env)\n            2. ![img.png](img.png)\n            3. Click `Authorize` to get token\n            4. Click `Close` and test the services\n    * Actuator: http://localhost:8080/actuator\n    * Eureka: http://localhost:8761/\n\n####\n\n5. [Kubernetes Deployment Guide](KubernetesDeploymentGuide.md) (OPTIONAL)\n\n---\n\n\u003c!-- REFERENCES --\u003e\n\n## References\n\n* [References](References.md)\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmusabbozkurt%2Fapi-gateway-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmusabbozkurt%2Fapi-gateway-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmusabbozkurt%2Fapi-gateway-service/lists"}