Skip to content

This is my implementation of a Product REST resource / endpoint / service using the latest cloud-native development Java framework - Quarkus

Notifications You must be signed in to change notification settings

TheAvgMan/Product-REST-Resource-Quarkus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎨💻 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 - Quarkus

The following technologies were used for this task:


REST API Java Quarkus Maven Hibernate IntelliJ Postman JUnit PostgreSQL Docker Swagger

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:

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:

./mvnw clean compile quarkus:dev

II) - Running the application dockerized

For this method, you need to follow these steps:

  1. Replace localhost with host.docker.internal in application.properties file
    under the src/main/resources directory.
  2. Package this application using the following command:
  3. ./mvnw clean package
  4. Build the docker image of this application using the following command:
  5. 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.

  6. Run a container from this image using the following command:
  7. 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:

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 ❤

Releases

No releases published

Packages

No packages published

Languages