Repository for the project of the lecture distributed systems. A small application that displays a list of animals. The user is able to add, edit and delete animals. Even though it is out-of-scope for now it will have a filter function to filter through the animals based on their species and their attributes. With the help of the search field one will be able to search for a specific breed.
Before starting with docker open the backend in your IDE. In Eclipse select the root of your dirctory and go to Run as. There select the command Maven clean first to ensure that there are no jar-files under the target directory. After that select under Run as the command Maven install. That will provide you with the necessary jar-file to start the backend docker container.
After that install docker on your machine if you have not already done so. To ckeck the version you are using you can simply run:
$ docker -v
The output should look something like this when using Linux Ubuntu:
$ Docker version 20.10.21, build 20.10.21-0ubuntu1~20.04.2
Then go to the directory that contains the docker-compose.yml file. Run the command:
$ docker-compose up --build
After stoping the containers make sure to run the command:
$ docker-compose down --volumes
Otherwise a second attempt to start the project might fail.
- communication problems between the database and the backend might occur -> a workaround is to start the backend locally through an IDE
- so far docker-compose has only been tested on Windows and on Linux Ubuntu
Simply run the project as a Spring Boot project.
In a terminal go to the directory pet-project. There just enter the command:
$ ng serve
The frontend is using the angular framework. In order to set up the project one has to install angular on their local machines.
First install nodejs:
$ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - && sudo apt-get install -y nodejs
Check the version:
$ node -v
One should get something like this:
$ v18.16.1
After that one can get the latest version of npm (optional):
$ sudo npm install npm@latest -g
Check the version:
$ npm -v
The feedback should look like this:
$ 9.7.2
Now install angular/cli:
$ sudo npm install -g @angular/cli
Check the version:
$ ng version
The feedback should look like this:
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 16.1.1
Node: 18.16.1
Package Manager: npm 9.7.2
OS: linux x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.1601.1 (cli-only)
@angular-devkit/core 16.1.1 (cli-only)
@angular-devkit/schematics 16.1.1 (cli-only)
@schematics/angular 16.1.1 (cli-only)
The Backend language used for this project is Java 17. While the framework Springboot is used, it requires no further installation process.
To install Java 17, first check if there is already a version installed.
$ java -version
If it is not installed the output will look somewhat like this:
Command 'java' not found, but can be installed with:
sudo apt install default-jdk
sudo apt install default-jre
Before installation first run the command:
$ sudo apt-get update
Now to the actual installation, run the command:
$ sudo apt install openjdk-17-jdk openjdk-17-jre
When running the command:
$ java -version
The output should look somewhat like this:
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment (build 17.0.7+7-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 17.0.7+7-Ubuntu-0ubuntu120.04, mixed mode, sharing)
The choice of an IDE is of course for the developer to make. So this part covers the personally preferred IDEs for a project like this.
For the frontend the IDE Visual Studio Code was used.
To get Visual Studio Code simply follow this Link and choose the version for the operating system of the local machine used for this project.
For the backend the IDE Eclipse was used.
To get it, simply follow the instructions of the Eclipse Foundation
This application uses Lombok. In order to use Lombok in Eclipse this tool has to be installed.