{"id":16149311,"url":"https://github.com/juliaaano/quarkus","last_synced_at":"2025-06-21T09:39:35.136Z","repository":{"id":49939810,"uuid":"343608258","full_name":"juliaaano/quarkus","owner":"juliaaano","description":"Java Quarkus quickstart application.","archived":false,"fork":false,"pushed_at":"2023-09-11T15:35:41.000Z","size":433,"stargazers_count":5,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T18:50:07.512Z","etag":null,"topics":["docker","java","keycloak","postman","quarkus"],"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/juliaaano.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":"2021-03-02T01:27:12.000Z","updated_at":"2023-11-13T14:30:28.000Z","dependencies_parsed_at":"2024-10-27T18:27:24.182Z","dependency_job_id":"99070255-3fb5-4cb2-9fa1-5dcca29db83d","html_url":"https://github.com/juliaaano/quarkus","commit_stats":null,"previous_names":[],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/juliaaano/quarkus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliaaano%2Fquarkus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliaaano%2Fquarkus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliaaano%2Fquarkus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliaaano%2Fquarkus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliaaano","download_url":"https://codeload.github.com/juliaaano/quarkus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliaaano%2Fquarkus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261101617,"owners_count":23109860,"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":["docker","java","keycloak","postman","quarkus"],"created_at":"2024-10-10T00:38:33.614Z","updated_at":"2025-06-21T09:39:30.123Z","avatar_url":"https://github.com/juliaaano.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quarkus Project\n\n[![ci](https://github.com/juliaaano/quarkus/actions/workflows/ci.yml/badge.svg)](https://github.com/juliaaano/quarkus/actions/workflows/ci.yml)\n[![ci-native](https://github.com/juliaaano/quarkus/actions/workflows/ci-native.yml/badge.svg)](https://github.com/juliaaano/quarkus/actions/workflows/ci-native.yml)\n[![scanning](https://github.com/juliaaano/quarkus/actions/workflows/scanning.yml/badge.svg)](https://github.com/juliaaano/quarkus/actions/workflows/scanning.yml)\n\nThis project uses [**Quarkus**](https://quarkus.io/), the Supersonic Subatomic Java Framework.\n\nIt showcases a diverse set of features and capabilities provided by the framework.\n\n* HTTP REST API OpenAPI configured.\n* Request input validation.\n* Dependency injection.\n* Database with PostgreSQL and Liquibase.\n* OIDC/Oauth2/JWT handling with Keycloak.\n* Docker, Kubernetes and OpenShift deployments.\n* Unit testing (REST Assured, JUnit).\n* Postman automated API testing.\n* CI pipeline with [GitHub Actions](./github/workflows/ci.yml)\n* Works on native mode.\n\n## Running the application in dev mode\n\nYou can run your application in dev mode that enables live coding using:\n```\nmvn quarkus:dev\n```\n\n## Running the application with containers\n\nBuild and push of containers images are powered by Jib: https://quarkus.io/guides/container-image#jib.\n\nSee [application.properties](./src/main/resources/application.properties) for container image options.\n\nInstructions require **docker** installed.\n\n### Red Hat container registry login\n```\ndocker login registry.redhat.io\n```\n\n### Run from the CI upstream image build\n```\n./run.sh\n```\nTry the **native** or any other compatible image:\n```\n./run.sh ghcr.io/juliaaano/quarkus-native:latest\n```\n\n### Build and run image locally:\n```\n./build.sh \u0026\u0026 ./run.sh localhost/juliaaano/quarkus\n```\n\n## Build and test a native executable\n\n```\ntest-native.sh\n```\n\n## Playing with the app\n\nIn Quarkus **DEV** mode, there is no security enabled, the API can be accessed from:\n\n* http://localhost:8080/q/swagger-ui\n\nAs a container, the app runs in **PROD** mode along a set of other services, which can be found in the [docker-compose.yaml](./docker-compose.yaml) file.\n\n\u003e **_NOTE:_**  Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.\n\n## OpenShift\n\nWorks with Kubernetes too, but then you need to take care of the database and ingress yourself.\n\n```\noc new-project juliaaano\noc new-app --name=postgresql --template=postgresql-ephemeral -e POSTGRESQL_USER=quarkus -e POSTGRESQL_PASSWORD=password -e POSTGRESQL_DATABASE=quarkusdb --labels=\"app=quarkus-app\"\nkubectl create configmap liquibase --from-file=liquibase/ \u0026\u0026 kubectl label cm liquibase app=quarkus-app\nkubectl apply -f manifests/\nkubectl set env deployment quarkus APP_AUTHORIZATION_ENABLED=false\nkubectl scale deployment quarkus --replicas 2\noc expose service quarkus --labels=\"app=quarkus-app\"\ncurl -i \"http://$(oc get route quarkus -o jsonpath='{.spec.host}')/q/health\"\n```\n\n### S2I: build image from source\n\nThese instructions are intended to be used in testing and development and not for CI/CD.\n\n### JVM build\n\n```\noc new-build --binary=true --image=registry.redhat.io/ubi9/openjdk-17 --name=quarkus --labels=\"app=quarkus-app\"\noc start-build quarkus --from-dir . --follow\n```\n\n### Native build\n\n```\nmvn clean package -Pnative -Dquarkus.native.container-build=true\noc new-build --binary=true --docker-image=quay.io/quarkus/ubi-quarkus-native-binary-s2i:2.0 --name=quarkus-native --labels=\"app=quarkus-app\"\noc start-build quarkus-native --from-file ./target/quarkus-app-1.0.1-runner --follow\n```\n\n### Deployment\n\nOnce image is built and pushed to the registry, just set the image in the deployment:\n\n```\noc set image deployment quarkus app=$(oc get istag quarkus:latest -o jsonpath='{.image.dockerImageReference}')\n```\n\nReview any steps above in [OpenShift](#OpenShift).\n\n### Clean up\n\n```\nkubectl delete all -l app=quarkus-app\n```\n\n### Postman API testing\n\nThis project offers an automated setup of integration API testing with Postman.\n\nPostman collections present in the [postman](./postman) folder can be imported and exported into the app and are automatically executed using docker compose with [Newman](https://github.com/postmanlabs/newman) under the hood.\n\n![Postman API Testing with Newman](./postman-api-testing-newman.png )\n\nThe **QUARKUS_APP_HOST** var points to the system under test and can be adjusted accordingly.\n\n```\nmvn quarkus:dev\ndocker compose run --rm postman\nQUARKUS_APP_HOST=http://localhost:8080 docker compose run --rm postman\n```\n\n### Keycloak and JWT RBAC Security\n\nWhen using docker compose, a Keycloak realm is automatically imported, so tokens can be issued and used with the application as follows:\n\n```\nexport access_token=$(\\\n    curl -X POST http://localhost:50102/realms/quarkus/protocol/openid-connect/token \\\n    --user quarkus-api-test-client:\"\" \\\n    -H 'content-type: application/x-www-form-urlencoded' \\\n    -d 'username=bob\u0026password=password\u0026grant_type=password\u0026scope=api.pets:read' | jq --raw-output '.access_token' \\\n)\ncurl -v http://localhost:50101/api/pets -H \"Authorization: Bearer \"$access_token\n\nexport access_token=$(\\\n    curl -X POST http://localhost:50102/realms/quarkus/protocol/openid-connect/token \\\n    --user quarkus-api-test-client:\"\" \\\n    -H 'content-type: application/x-www-form-urlencoded' \\\n    -d 'username=alice\u0026password=password\u0026grant_type=password\u0026scope=api.pets:read api.pets:write api.pets:erase' | jq --raw-output '.access_token' \\\n)\ncurl -v -X POST http://localhost:50101/api/pets -H \"Authorization: Bearer \"$access_token -H \"Content-Type: application/json\" -d '{\"species\":\"bird\",\"breed\":\"krakatoo\"}'\n```\n\n## Misc\n\nTest i18n localization:\n\n```\ncurl -i -X PUT http://localhost:8080/api/pets/x -d '{}' -H 'Content-Type: application/json' -H 'Accept-Language: fr-FR'\n```\n\nKeycloak export:\n\n```\ndocker exec -it quarkus-keycloak-1 /opt/keycloak/bin/kc.sh export --users realm_file --realm quarkus --file /tmp/export.json\ndocker exec -it quarkus-keycloak-1 cat /tmp/export.json | pbcopy\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliaaano%2Fquarkus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliaaano%2Fquarkus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliaaano%2Fquarkus/lists"}