Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/theavgman/product-rest-resource-quarkus
This is my implementation of a Product REST resource / endpoint / service using the latest cloud-native development Java framework - Quarkus
https://github.com/theavgman/product-rest-resource-quarkus
clean-architecture docker hibernate intellij java json junit maven object-oriented-programming postgresql postman problem-details-for-http-apis quarkus rest-api result-pattern solid-principles
Last synced: about 2 months ago
JSON representation
This is my implementation of a Product REST resource / endpoint / service using the latest cloud-native development Java framework - Quarkus
- Host: GitHub
- URL: https://github.com/theavgman/product-rest-resource-quarkus
- Owner: TheAvgMan
- Created: 2024-06-22T13:15:56.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-08-15T20:28:37.000Z (6 months ago)
- Last Synced: 2024-12-18T18:11:40.241Z (about 2 months ago)
- Topics: clean-architecture, docker, hibernate, intellij, java, json, junit, maven, object-oriented-programming, postgresql, postman, problem-details-for-http-apis, quarkus, rest-api, result-pattern, solid-principles
- Language: Java
- Homepage:
- Size: 81.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
🎨💻 Product REST Service using Quarkus 💻🎨
---
## 1 - ✨ Introduction ✨
🎉🥳 Welcome to this repo! 🥳🎉
This is my implementation of a Product REST resource / endpoint / service
using the latest cloud-native development Java framework - QuarkusThe following technologies were used for this task:
## 2 - ✨ Running The Database ✨
Before starting the application itself, you must run the database first.
The database is going to be executed as a docker container from the latest Postgres image.
Execute the following command to run this database container:```shell script
docker run --name products_pgcontainer -e POSTGRES_PASSWORD=secret123 -d -p 5432:5432 -v products_pgdata:/var/lib/postgresql/data postgres
```## 3 - ✨ Running The Application ✨
Now you need to clone this repo to run the application.
After cloning, open the project in your IDE by clicking on the pom.xml file.
Then you can run the application using one of the following two ways:I) - Running the application in dev mode
You can run (and re-run) the application in dev mode, which enables live coding using the following command:
```shell script
./mvnw clean compile quarkus:dev
```II) - Running the application dockerized
For this method, you need to follow these steps:
- Replace localhost with host.docker.internal in application.properties file
under the src/main/resources directory.
- Package this application using the following command:
```shell script
./mvnw clean package
```
- Build the docker image of this application using the following command:
```shell script
docker build -f src/main/docker/Dockerfile.jvm -t ProductResource-REST-Quarkus-jvm .
```> **_Note:_** This step and the two previous ones are performed only once.
- Run a container from this image using the following command:
```shell script
docker run -i --rm -p 8080:8080 ProductResource-REST-Quarkus-jvm
```> **_Note:_** This command is needed every time you want to execute the application as a docker container, because the container is automatically removed when stopped.
## 4 - ✨ The Endpoints ✨
Finally, you can start using the API endpoints of the application!! 🥳🎉
To know all the endpoints available and start trying them out, click the following link:[Let's try it out !!](http://localhost:8080/q/swagger-ui)
> **_Note:_** When using the POST and PUT endpoints, take care not to set the value of ID field as it's automatically generated.
---
## 👋 That's it 👋
I hope you enjoyed it 😊
Thank you for trying it out ❤