{"id":22173829,"url":"https://github.com/puneethkumarck/microservice-public-api","last_synced_at":"2025-03-24T18:14:18.913Z","repository":{"id":129141022,"uuid":"117454466","full_name":"Puneethkumarck/microservice-public-api","owner":"Puneethkumarck","description":"Building microservice using public API","archived":false,"fork":false,"pushed_at":"2018-09-17T17:08:05.000Z","size":906,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T22:46:09.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Groovy","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/Puneethkumarck.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}},"created_at":"2018-01-14T18:12:24.000Z","updated_at":"2018-09-17T17:08:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"b351c1e4-9a6a-4e77-b53c-07381deb58d7","html_url":"https://github.com/Puneethkumarck/microservice-public-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Puneethkumarck%2Fmicroservice-public-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Puneethkumarck%2Fmicroservice-public-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Puneethkumarck%2Fmicroservice-public-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Puneethkumarck%2Fmicroservice-public-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Puneethkumarck","download_url":"https://codeload.github.com/Puneethkumarck/microservice-public-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245325223,"owners_count":20596818,"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-12-02T07:35:44.438Z","updated_at":"2025-03-24T18:14:18.887Z","avatar_url":"https://github.com/Puneethkumarck.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microservice-public-api\n\n[![Build Status](https://travis-ci.org/Puneethkumarck/microservice-public-api.svg?branch=master)](https://travis-ci.org/Puneethkumarck/microservice-public-api)\n\nBuilding microservice using publicly hosted API\n\nThis Application demonstrates the microservice implementation using Spring cloud and Netflix OSS stack and docker .\n\nThere are six Spring Boot Apps , implmented in a diff programming languages to show advantages of building micro services.\n\n\n## eureka-server\n\n  Which is Service registration and discovery service using Spring cloud netflix Eureka.\n  \n```\n  \t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.springframework.cloud\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003espring-cloud-netflix-eureka-server\u003c/artifactId\u003e\n\t\t\u003c/dependency\u003e\n```\n\n  ![Settings Window](https://raw.github.com/Puneethkumarck/microservice-public-api/master/screenshots/eureka_registration.png)\n    \n## config-server.\n\nWhich is git backed Config server , to keep separate the property file from actual app , to support the 12 Factor App  Architecture style to implement the microservices . This App talks to config stored in git repo in runtime to resolve the properties for microservices. Which uses the spring security dependecy to decrypt the encrypted properties stored in config repo . Encrypted property should be prefixed with {cipher} , for spring security to decrypt the respective values.\n \n \n ```\n \t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.springframework.cloud\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003espring-cloud-config-server\u003c/artifactId\u003e\n\t\t\u003c/dependency\u003e\n    \n    \t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003espring-boot-starter-security\u003c/artifactId\u003e\n\t\t\u003c/dependency\u003e\n```\n\n\n## edge service\nZuul is a JVM based router and server side load balancer by Netflix.It provides a single entry to our system, which allows a browser, mobile app,or other user interface to consume services from multiple hosts without managing cross-originresource sharing (CORS) and authentication for each one. We can integrate Zuul with other Netflix projects like Hystrix for fault tolerance and Eureka for service discovery, or use it to manage routing rules,filters, and load balancing across your system.\n\n```\n\u003cdependency\u003e\n\t\u003cgroupId\u003eorg.springframework.cloud\u003c/groupId\u003e\n\t\u003cartifactId\u003espring-cloud-starter-zuul\u003c/artifactId\u003e\n\u003c/dependency\u003e\n\n```\n\n```\nzuul:\n  ignored-services: '*'\n  ignoredPatterns: /**/api/**\n  routes:\n    github:\n       path: /github/**\n       serviceId: github-api\n    youtube:\n          path: /youtube/**\n          serviceId: youtube-api\n    youtube-api-kotlin:\n          path: /yk/**\n          serviceId: youtube-api-kotlin\n```\n\nAbove yml routes config is responsible for microservice routing , serviceId refers to microservice name/application name which is registered with eureka server , above mapping guides all the request from the user which contains /github/** to github-api microservice which is registered with eureka and respective endpoints , same applies for other mappings shown above.\n\n\n## github-api\n\n\nwhich is an microservice implemented using groovy as an programming language . Which is performing HTTP GET operations for    GITHUB endpoints . Below dependecies required to resolve the properties to talk to config server and register with eureka\n\n```\n\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.springframework.cloud\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003espring-cloud-starter-config\u003c/artifactId\u003e\n\t\t\u003c/dependency\u003e\n\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.springframework.cloud\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003espring-cloud-starter-eureka\u003c/artifactId\u003e\n\t\t\u003c/dependency\u003e\n  ```\n  ## youtube-api \n  \n  which is an microservice implemented using groovy as an programming language . Which is performing HTTP GET operations for     YOUTUBE endpoints .which registeres with eureka server and calls config server to resolve the properties @ runtime.\n  \n ## youtube-api-kotlin\n  \n  which is same as youtube api , but implemeted using kotlin.\n  \n  \n  # Run\n  \n  * JAVA \n  * Groovy\n  * Kotlin\n  * Docker Tool box\n  * Docker compose\n  * Kitematic\n  * Mvn\n  * Intelli j idea\n  * Groovy-Spock Unit Testing\n  \n  \n  \n  \n  clone the git repo to your local [https://github.com/Puneethkumarck/microservice-public-api.git] , Make sure docker is running in your   machine before building project\n  \n  run below mvn command in root pom\n  \n  ```\n  mvn clean install -DskipTests=true -Ddocker.skip=false\n  ```\n  \n  Which will build the respective JAR and docker images . Later run the docker compose command spin up th docker contaniers\n  \n  ```\n  docker-compose up\n  ```\n  \n # Windows Users:\n  perform the mvn command in docker terminal , since docker image build is enabled using pom using spotify plugin , if we try execute from     other terminals will face below issue,since plugin failed to connect docker host\n  ```\n  [ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.5:build (server) on project web-service: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1, localhost/fe80:0:0:0:0:0:0:1%1] failed: Connection refused -\u003e\n  ```\n  \n  # Screen shots\n  \n  * Building docker image for single project\n  \n  ![Settings Window](https://raw.github.com/Puneethkumarck/microservice-public-api/master/screenshots/building_eureka_server.png)\n \n  * pushing docker image to docker hub repo \n  \n    \u003e Note: Make sure your image name prefix with your exact username of docker hub , other wise push will fail.\n  \n  ![Settings Window](https://raw.github.com/Puneethkumarck/microservice-public-api/master/screenshots/publish_to_docker_hub.jpg)\n  \n  * Intelij docker config\n   ![Settings Window](https://raw.github.com/Puneethkumarck/microservice-public-api/master/screenshots/docker_config_Intellij.jpg)\n   \n   * docker image info\n    ![Settings Window](https://raw.github.com/Puneethkumarck/microservice-public-api/master/screenshots/docker_config_Intellij2.jpg)\n  \n  * docker contanier Info\n   ![Settings Window](https://raw.github.com/Puneethkumarck/microservice-public-api/master/screenshots/docker_config_Intellij3.jpg)\n   \n   # Useful docker commands to run throgh this project\n```\n   docker -v (to check docker version installed on machine)\n   docker image build --rm=true  ( to build an image)\n   docker image pull ${IMAGE ID} (to pull docker image from docker hub registry)\n   docker image ls (list all images available in local docker machine)\n   docker image prune (removes all dangling images locally)\n   docker image rm ${IMAGE_ID} (remove an image from local dcoker machine)\n   docker container run (startup the contanier)\n   docker container ls (list all the contanier)\n   docker container rm ${contanier_id} (remove contanier)\n   \n  ```\n    \n  # Useful links\n  \n  * spotify Maven plugin info\n  \n  (https://forums.docker.com/t/spotify-docker-maven-plugin-cant-connect-to-localhost-2375/9093)\n  (https://forums.docker.com/t/spotify-docker-maven-plugin-cant-connect-to-localhost-2375/9093/6)\n  \n  * Working with docker inside intellij\n  (https://www.jetbrains.com/help/idea/docker.html)\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuneethkumarck%2Fmicroservice-public-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuneethkumarck%2Fmicroservice-public-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuneethkumarck%2Fmicroservice-public-api/lists"}