Is a RESTfull Web API that provides endpoints for storing, receiving and deleting user feedbacks.
Table of Contents
# clone the repository cd repository # copy the configuration files for your configuration cp src/main/resources/application.properties-dist src/main/resources/application.properties cp src/main/resources/application-test.properties-dist src/main/resources/application-test.properties
Create a test database and a local database to run the application locally if needed. You can find the newest DB dump in src/main/resources/db. Fill in your DB credentials and all other required values in the newly created application.properties and application-test.properties. Do not add this file to the GIT index.
cd repository # create the gradle properties file and fill in the credentials (ask Yosu <email@example.com> or Ronnie <firstname.lastname@example.org>) cp gradle.properties-dist gradle.properties # install the project's dependencies and generate the war file in build/libs/ gradle build
DB dump in src/main/resources/db/migrations/supersede_repository_db_structure.sql
To run the integration tests, execute the following commands:
Executing 'gradle build' in the root folder creates a build folder. In build/libs there is a war file. This war file can be deployed, e.g. on a Apache Tomcat.
The suggested IDE is IntelliJ, but Eclipse works as well.
The prerequisites for running the application locally are a local Tomcat installation (just download the zip and unzip) and the Tomcat Server Plugin in IntelliJ. Then you can setup a run configuration for a local Tomcat:
Create the run configuration:
Add the war from build/libs as the artefact:
Build the JAR and the images and containers for the Java Spring Repository and the Repository DB.
The jdbs connection string in the application.properties should have the DB container service name as host:
spring.datasource.url = jdbc:mysql://mysqldbserver:3306/<db_name>?useSSL=false
gradle clean build jar docker-compose up -d
Check if the 2 containers are up and running:
docker ps -a
You might get:
ERROR org.springframework.boot.SpringApplication - Application startup failed ... Caused by: java.lang.IllegalArgumentException: No auto configuration classes found in META-INF/spring.factories. If you are using a custom packaging, make sure that file is correct.
Completely delete the container and image:
docker rm -v <container_name> docker rmi <image_name>
Attention: This would delete all stopped containers, all unused images and all dangling volumes:
docker ps -q |xargs docker rm docker images -q |xargs docker rmi docker volume rm `docker volume ls -q -f dangling=true`
gradle build jar -x test gradle bootRepackage docker-compose up -d
Apache License 2.0