{"id":15013817,"url":"https://github.com/radcortez/quarkus-playground","last_synced_at":"2025-04-09T13:11:25.475Z","repository":{"id":37854563,"uuid":"121988963","full_name":"radcortez/quarkus-playground","owner":"radcortez","description":"Showcases typical use cases of Quarkus Applications","archived":false,"fork":false,"pushed_at":"2024-10-07T17:00:08.000Z","size":490,"stargazers_count":46,"open_issues_count":5,"forks_count":28,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-10-21T04:35:20.006Z","etag":null,"topics":["java","quarkus","smallrye"],"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/radcortez.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-02-18T20:42:07.000Z","updated_at":"2024-10-14T22:14:23.000Z","dependencies_parsed_at":"2023-02-10T16:01:38.604Z","dependency_job_id":"645de446-05c3-4255-bbc7-a078a52e88bf","html_url":"https://github.com/radcortez/quarkus-playground","commit_stats":{"total_commits":259,"total_committers":6,"mean_commits":"43.166666666666664","dds":0.5482625482625483,"last_synced_commit":"39c3de294d73ade2137e189ade2716fe2a90fbf9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radcortez%2Fquarkus-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radcortez%2Fquarkus-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radcortez%2Fquarkus-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radcortez%2Fquarkus-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/radcortez","download_url":"https://codeload.github.com/radcortez/quarkus-playground/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045266,"owners_count":21038555,"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":["java","quarkus","smallrye"],"created_at":"2024-09-24T19:44:49.024Z","updated_at":"2025-04-09T13:11:25.444Z","avatar_url":"https://github.com/radcortez.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quarkus Playground\n\nThe purpose of this Github repository is to showcase typical use cases of [Quarkus](https://quarkus.io) in applications\ndevelopment.\n\n## Pre Requisites\n\n* [OpenJDK 17](https://adoptium.net/temurin/releases/?version=17)\n* [GraalVM 22.3 - JDK 17](https://www.graalvm.org/release-notes/22_3/) (for native image)\n* [Maven 3.9.6](https://maven.apache.org/download.cgi)\n* [Docker](https://hub.docker.com/search/?type=edition\u0026offering=community)\n\n:information_source: **Use [SDKMAN!](https://sdkman.io) to manage Java and Maven versions**\n\n## Project Structure\n\nThe project is a backend for a book store. It provides a REST API to Create, Read, Update and Delete books, and a REST\nAPI to retrieve the ISBN of the book.\n\n* number-api - A service to generate configurable Numbers.\n* book-api - A service to manage books.\n* standalone - A standalone client to call the Book API.\n* simulator - A client simulator that generates random requests to the Book API and simulate traffic.\n\n## SmallRye APIs\n\nThe following SmallRye APIs can be found through the project:\n\n* Config (to generate the prefix of the Number API generation)\n* OpenAPI (to document the REST API of both Number API and Book API)\n* JWT (to authenticate and authorize calls that manage books)\n* Fault Tolerance (to handle ISBN book generation if Number API cannot be called)\n* Reactive Messaging (to store Books that require ISBN book generation due to failure)\n* Health (to monitor health of the Number API)\n* REST Client (to call Book API with a standalone client)\n* Telemetry (to trace calls and record statistics between Book API and Number API)\n\n## Libraries and Infra\n\nThe project uses [Quarkus](https://quarkus.io) as the Java stack, and the built in [SmallRye](https://smallrye.io)\ncomponents.\n\nThe required infrastructure provided by either Docker or Kubernetes includes:\n\n* Postgres Database\n* Kafka\n* Jaeger\n* Prometheus\n\n## Build\n\nSet up a local Docker Registry first to store the generated Docker images:\n\n```bash\ndocker run -d -p 5000:5000 --restart=always --name docker-registry registry:2\n```\n\nUse Maven to build the project with the following command from the project root:\n\n```bash\nmvn verify -Dquarkus.container-image.build=true\n```\n\n## Run\n\n### With Docker\n\nThe easiest way to run the entire system is to use `docker-compose`. This will run the apps, plus all the required\ninfrastructure. Run the following command from the project root:\n\n```bash\ndocker-compose up\n```\n\nUse the following command to stop and remove all the containers:\n\n```bash\ndocker-compose down\n```\n\n### With Java\n\nThe infrastructure is still required to run the applications properly. They can also be set up manually in the running\nhost, or use `docker-compose` to start only the required infrastructure:\n\n```bash\ndocker-compose up database zookeeper kafka prometheus jaeger\n```\n\nTo execute `number-api` and `book-api` directly, run the following command from each module root:\n\n```bash\njava -jar target/number-api-runner.jar\n\njava -jar target/book-api-runner.jar\n```\n\n### With Kubernetes\n\nThe infrastructure to run in Kubernetes is available in the `.kubernetes` folder. \n\nSet the default Kubernetes namespace:\n\n```bash\nkubectl config set-context --current --namespace=default\n```\n\nTo start the infrastructure run:\n\n```bash\nkubectl apply -f .kubernetes\n```\n\nQuarkus is able to generate the Kubernetes deployment files and deploy the application directly. This requires a Maven\nbuild to generate the deployment descriptors:\n\n ```bash\nmvn verify -Dquarkus.container-image.build=true -Dquarkus.kubernetes.deploy=true\n```\n\n## Test the Applications\n\nUse Swagger-UI to access the applications REST endpoint and invoke the APIs:\n\n* [Book API](http://localhost:8080/swagger-ui/#/)\n* [Number API](http://localhost:8090/swagger-ui/#/)\n\nFor Authentication and Authorization in `book-api` you need to call `Authorize` in the Swagger interface to generate a\n`JWT`. Any `client_id`, and `client_secret` is acceptable.\n\nTo check Metris and Tracing information:\n\n* [Prometheus](http://localhost:9090)\n* [Jaeger](http://localhost:16686)\n\n## Native Images\n\nInstall GraalVM Native Image binary with:\n\n```bash\ngu install native-image\n```\n\nSet up an environment variable `GRAALVM_HOME` pointing to the GraalVM installation folder.\n\n```bash\nmvn package -Pnative\n```\n\nThis is going to generate a binary executable for each module. To execute `number-api` and `book-api` as native, run\nthe following command from each module root:\n\n```bash\n./target/number-api-runner\n\n./target/book-apo-runner\n```\n\n### Build Native Docker Images\n\nTo build Docker Images with the native binaries run the following command:\n\n```bash\nmvn verify -Pnative -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true\n```\n\nOr to deploy it directly to Kubernetes:\n\n```bash\nmvn verify -Pnative -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true -Dquarkus.kubernetes.deploy=true\n```\n\n## Resources\n\n* [Quarkus](https://quarkus.io)\n* [SmallRye](https://smallrye.io)\n* [Developer Joy with Quarkus](https://docs.google.com/presentation/d/1W7NS7psVN5r35G-ItOaW9_4DWKDXFSRQ8ND928xtKHc/edit?usp=sharing)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradcortez%2Fquarkus-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradcortez%2Fquarkus-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradcortez%2Fquarkus-playground/lists"}