Skip to content

Quarkus-Travel-Site-Martins96/Quarkus-Travel-Home

Repository files navigation

Home Quarkus Travel project

Docker Build Status

This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .


This Git organization is an example site for a Travel Company. I made this for study and fun, please feel free to watch or fork it!

You can run all microservice with a MySQL DB configured and initialized via sql script in Database project, or simply run with mocked in-memory data. Check the META-INF/microprofile-config.properties file


This part is related to the dynamic home page, here you can see the showcase and the offers about hotels

Running the application in dev mode

You can run your application in dev mode that enables live coding using:

./mvnw compile quarkus:dev

Frontend application exposed on localhost:8080/

Backend APIs:

Packaging and running the application

Build Front End part: inside folder /src/main/angular/home-ng

ng build

The application can be packaged using:

./mvnw package

It produces the home-quarkus-travel-1.0.0-SNAPSHOT-runner.jar file in the /target directory. Be aware that it’s not an über-jar as the dependencies are copied into the target/lib directory.

If you want to build an über-jar, execute the following command:

./mvnw package -Dquarkus.package.type=uber-jar

The application is now runnable using java -jar target/home-quarkus-travel-1.0.0-SNAPSHOT-runner.jar.

Creating a native executable

You can create a native executable using:

./mvnw package -Pnative

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:

./mvnw package -Pnative -Dquarkus.native.container-build=true

You can then execute your native executable with: ./target/home-quarkus-travel-1.0.0-SNAPSHOT-runner

If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.html.

Building for Openshift

Build and deploy for Openshift platform

In order to build the application on Openshift you can enable the property: quarkus.kubernetes.deploy=true

And run in a logged in shell:

./mvnw package

you can also pass the property directlly in the shell command:

./mvnw package -Dquarkus.kubernetes.deploy=true

Configure the Endpoints

Create a ConfigMap for declare the API Endpoints, the config should be like:

apiVersion: v1
kind: ConfigMap
metadata:
  name: example
  namespace: travelsite
data:
  endpoint.home: "http://home.endpoint.example.com"
  endpoint.hotel: "http://hotel.endpoint.example.com"
  endpoint.login: "http://login.endpoint.example.com"
  endpoint.registration: "http://registration.endpoint.example.com"
  endpoint.usermanagement: "http://usermanagement.endpoint.example.com"

Technologies in project

The main framework used is Quarkus by Red Hat, for the frontend part the framework used is Angular.

Before generate a full JAR, please build Angular part via (inside folder /src/main/angular/home-ng)

ng build

This will generate the frontend page in the Quarkus static files folder.

Quarkus Main Components

RESTEasy JAX-RS

REST APIs creator and exposer

Guide: https://quarkus.io/guides/rest-json

Fault tolerance

Error management and resilient applications

Guide: https://quarkus.io/guides/microprofile-fault-tolerance

Agroal datasource

Database manager and injectable (used with MySQL in this project)

If you run in 'IN_MEMORY' mode, the datasource use will be skipped

Guide: https://quarkus.io/guides/datasource

CDI

Context Dependency and Injection, used to inject in the logic the Java beans

Guide: https://quarkus.io/guides/cdi

Microprofile Config

Read and inject properties and env variables configuration in your app

Guide: https://quarkus.io/guides/config

Health Check

A simple REST exposer with application data, in order to check if application is up and running.
Check the localhost:8080/health if you running in dev mode

Guide: https://quarkus.io/guides/microprofile-health

Test: JUnit

Simple use JUnit for unit tests, the core is managed by Quarkus. Rest call managed by restassured

Guide: https://quarkus.io/guides/getting-started-testing

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published