Requirements:
- Java 21
- Docker (running)
- docker-compose
Steps to start Salat locally:
- Build the image:
./mvnw spring-boot:build-image - Run docker-compose:
docker-compose up -d(in newer docker versions usedocker compose up -d) - That's it. Salat should now be running. To check, open in browser: http://localhost:8080?login-name=tt
Shutdown:
- Stop docker-compose: CTRL+C
- Stop built containers:
docker-compose stop(in newer docker versions usedocker compose stop) - If you want to remove the containers:
docker-compose down(in newer docker versions usedocker compose down)
Open the URL <http://localhost:8080?login-name=>
You can change the login-name parameter to login as a different user.
It is even possible to append ?login-name=<sign> to any URL, to log in the user.
Valid login-names in the test-dataset are:
- admin: Administrator
- bm: "Bossy Bossmann", Administrator
- tt: "Testy Testmann", Employee
There is no need to logout. But you can just click the button to logout.
With the above login url, you can change the login user at any time without logging out!
To start only the local database, without the Salat application:
docker-compose -f docker-compose-infra.yml up
docker-compose down if you had the application running before.
Should you encounter the error
Consider defining a bean of type 'org.springframework.boot.info.BuildProperties' in your configuration.
This can be fixed by running
./mvnw package
Explanation: Maven creates a file named build-info.properties.
This file might be missing when an IDE does not create it. (Happened to Klaus with IntelliJ IDEA, despite Maven Integration).
(by Klaus)
Changes to the data base are collected via Liquibase in the following file:
src/main/resources/db/changelog/db.changelog-master.yaml
The following environment variables must be set in each environment/stage:
SPRING_DATASOURCE_USERNAME
SPRING_DATASOURCE_PASSWORD
SPRING_DATASOURCE_URL
The following is an example for local testing with the included docker-compose file:
SPRING_DATASOURCE_USERNAME=salattest
SPRING_DATASOURCE_PASSWORD=salattest
SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/salat?useUnicode=true&useJDBCCompliantTimezoneShift=true&serverTimezone=Europe/Berlin&useLegacyDatetimeCode=false&autoReconnect=true
- TimereportHelper#determineBeginTimeToDisplay - move to WorkingdayService
- TimereportHelper#determineTimesToDisplay - move to WorkingdayService and introduce a better value class to carry the result
- TimereportHelper#calculateLaborTime - more or less just a sum up time on Timereports, maybe this can be done without any service, just use Java streaming API and Duration.plus
- TimereportHelper#checkLaborTimeMaximum - move to WorkingdayService? Or maybe a business rule in TimereportService that creates a warning? Or when it's a warning, maybe add to the WarningService.
- TimereportHelper#calculateQuittingTime - nach WorkingdayService
- TrainingHelper#fromDBtimeToString - nach DurationUtils als neue Methode formatWithWorkingsdays(Duration duration, Duration dailyWorkingTime
- TrainingHelper#hoursMinToString - better use Duration and then DurationUtils#format
Follow the step-by-step guide in docs/how-to-test-new-ui.md. Quick start:
- Start the app (see Run locally above)
- Open: http://localhost:8080/reporting/jobs2?login-name=tt
- If the list is empty, create a scheduled job via legacy pages (e.g., /ShowReports) and refresh the page.