This repo serves to persist the towercrush data in a db and to communicate with different microservices.
Beginning of additions (that work)
Make sure you have the following installed:
- Java: JDK 1.17 or higher
- Maven: Maven 3.6.3
- Docker: Docker
- PostgreSQL: PostgreSQL
To build the project, run:
mvn install
in the project folder. Then go to the target folder:
cd target
and run:
java -jar towercrush-backend-0.0.1-SNAPSHOT.jar
to start the application.
To run your local changes as a docker container, with all necessary dependencies, build the Docker container with:
docker compose up --build
You can remove the containers with:
docker compose down
To run your local build within your IDE, but also have the dependencies running in docker, follow the steps to build the project, then run the dependencies in docker with the following:
docker compose -f docker-compose-dev.yaml up
You can remove the containers with:
docker compose -f docker-compose-dev.yaml down
End of additions
to setup a database with docker for testing you can use
docker run -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres --rm --name towercrush-database postgres
To stop and remove it simply type
docker stop towercrush-database
Rest mappings are defined
in towercrush-service/src/main/java/com/towercrushservice/towercrushservice/controller/TowercrushController.java
Access swagger-ui for visuals under: http://localhost/minigames/towercrush/api/v1/swagger-ui/index.html#/
and
fill http://localhost/minigames/towercrush/api/v1/v3/api-docs
into the input field in the navbar.