This project uses Quarkus, the Supersonic Subatomic Java Framework.
- Download and install IntelliJ Community Edition.
- Configure IntelliJ to use JDK 22 by going to File > Project Structure > Project > Project SDK and adding JDK 22.
- Download Maven from the official site.
- Extract the archive and set the
M2_HOME
environment variable to the extracted directory. - Add
M2_HOME/bin
to your systemPATH
.
- Download JDK 22 from the official Oracle website or use OpenJDK.
- Set the
JAVA_HOME
environment variable to the JDK installation directory. - Add
JAVA_HOME/bin
to your systemPATH
.
- Install MySQL following the instructions on MySQL's official website.
- Create a database for the application.
- Configure your
application.properties
file in Quarkus to connect to your MySQL instance.
- Install Docker following the instructions on Docker's official website.
- Use Docker to run MySQL and your application containers.
- Download and install the latest version of Node.js from the official website.
- Verify the installation by running:
node -v npm -v
- Download and install Visual Studio Code.
- Open your project in VSCode.
- Install Vue CLI globally by running:
npm install -g @vue/cli@4.5.15
- Create a new Vue.js 2 project or navigate to your existing project directory and install dependencies:
npm install
- Configure your vue.config.js for the port you want and set up a proxy layer to the port where your API is running to avoid CORS issues:
const { defineConfig } = require('@vue/cli-service') module.exports = defineConfig({ transpileDependencies: true, devServer: { port: 8084, proxy: { '/api': { target: 'http://localhost:8080', // Port where your API is running changeOrigin: true, pathRewrite: { '^/api': '' }, }, }, }, })
- Run the Vue.js development server on port 8084:
npm run serve
NOTE: Ensure your front-end runs on port 8084, while your API runs on port 8080 using Docker to avoid conflicts.
This project is a modern CRUD API built with SOLID principles using:
- JDK 22
- Quarkus 3.12.3
- Maven 3.9.8
- MySQL
- Docker 4.32.0
It includes endpoints for managing services, users, and service requests.
To run the application in development mode with live coding enabled:
./mvnw compile quarkus:dev
NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
To package the application:
./mvnw package
This produces the quarkus-run.jar
file in the target/quarkus-app/
directory. It’s not an über-jar as the dependencies are copied into the target/quarkus-app/lib/
directory. You can run the application using:
java -jar target/quarkus-app/quarkus-run.jar
To build an über-jar:
./mvnw package -Dquarkus.package.jar.type=uber-jar
Run the über-jar with:
java -jar target/*-runner.jar
To create a native executable:
./mvnw package -Dnative
Or, if you don't have GraalVM installed, use a container for the native build:
./mvnw package -Dnative -Dquarkus.native.container-build=true
Run your native executable with:
./target/thiago-code-1.0.0-SNAPSHOT-runner
For more information on native executables, consult Quarkus Native Guide.
-
GET /servicos/{id}
Retrieve a specific service by ID. -
POST /servicos
Create a new service.
Request Body Example:{ "id": 1, "name": "Service Name", "description": "Service Description" }
-
PUT /servicos
Update an existing service.
Request Body Example:{ "id": 1, "name": "Updated Service Name", "description": "Updated Description" }
-
DELETE /servicos/{id}
Delete a service by ID.
-
GET /users
Retrieve all users. -
GET /users/{id}
Retrieve a specific user by ID. -
POST /users
Create a new user.
Request Body Example:{ "id": 1, "name": "User Name", "cpf": "12345678901" }
-
PUT /users
Update an existing user.
Request Body Example:{ "id": 1, "name": "Updated User Name", "cpf": "09876543210" }
-
DELETE /users/{id}
Delete a user by ID.
-
POST /solicitacoesServicos
Create a new service request.
Request Body Example:{ "userId": 1, "servicoId": 2, "status": "PENDING" }
-
GET /solicitacoesServicos
Retrieve all service requests. -
GET /solicitacoesServicos/{id}
Retrieve a specific service request by ID. -
PUT /solicitacoesServicos/{id}
Update the status of a service request.
Request Body Example:{ "status": "COMPLETED" }
-
DELETE /solicitacoesServicos/{id}
Delete a service request by ID.
- REST Data with Panache: Generate Jakarta REST resources for your Hibernate Panache entities and repositories.
- RESTEasy Classic's REST Client JSON-B: JSON-B serialization support for the REST client.
- RESTEasy Classic: REST endpoint framework implementing Jakarta REST and more.
- JDBC Driver - MySQL: Connect to the MySQL database via JDBC.
- Security JPA: Secure your applications with username/password stored in a database via Jakarta Persistence.
Thiago-Hercules