This project contains the TIM reference implementation of a Fachdienst. It is based on the following technologies:
MavenSpring BootPostgreSQLAngular (Frontend)TypeScript (Frontend)
-
Update your
hostsfile with the following entry:127.0.0.1 host.docker.internal- Linux and Mac:
/etc/hosts - Windows:
C:\Windows\System32\Drivers\etc\hosts
- Linux and Mac:
HINT
In the local environment there is no Kubernetes operator. Calls to the Kubernetes operator are prevented by conditional statements in local environment. In the local environment one can createmessenger serviceinstances in the registration service frontend. Please note that these are not connected to themessenger serviceinstances started withdocker composein theMessenger Proxyproject.
- If you choose to use
maven-wrapperplease make sure that it uses JDK 21 and not above. You can verify this with following command:
$ ./mvnw --version
Maven home: [...]
Java version: 21, [...]
Default locale: de_DE, platform encoding: UTF-8
OS name: [...]You can bring up the Backend, Frontend, Keycloak (with database) and database with docker compose. Please note that the Spring Boot profile local-docker is then utilized by default.
-
Create a docker network with the name
timref-networkif it not already exists$ docker network create timref-network
-
The backend should be built at least once because the build artifact is used to create the docker image. This can be done like so:
$ ./mvnw -f rd-backend/pom.xml clean package
-
Run
$ docker compose up --build
- Navigate to
http://localhost:4200/where the frontend is running on.
As an alternative (especially for debugging purposes) you can run the backend natively via IntelliJ Run Configuration called Backend. See also the IntelliJ Documentation how to import the run configuration. This one utilizes the Spring Boot profile local by default.
ATTENTION
Please note that the backend run from docker compose must be disabled in that case to prevent port conflicts.
Open http://localhost:8080/backend/swagger-ui/index.html to see the API definitions
- Development server
- Start the angular application by running
$ cd rd-frontend $ ng serve - Navigate to
http://localhost:4200/. The application will automatically reload if you change any of the source files.
- Start the angular application by running
- Build
- Run
ng buildto build the project. The build artifacts will be stored in thedist/directory.
- Run
- Running unit tests
- Run
ng testto execute the unit tests via Karma.
- Run
- Further help
- To get more help on the Angular CLI use
ng helpor go check out the Angular CLI Overview and Command Reference page.
- To get more help on the Angular CLI use
HINT
As an alternative (especially for debugging purposes) you can run the Frontend via Run Configuration called Frontend. See also the IntelliJ Documentation how to import the run configuration. This enables you to put breakpoints into the frontend code (TypeScript) for better debugging.
- For a list of dependencies for the backend see here rd-backend/pom.xml. The dependencies are listed inside the
<dependencies>tag. Alternatively you can use the command (Mavenrequired):$ ./mvnw -f rd-backend/pom.xml dependency:tree
- For a list of dependencies for the frontend see here rd-frontend/package.json.
The dependencies are listed inside the
dependenciesand thedevDependenciesfield. Alternatively you can use the command (npmrequired):$ cd rd-frontend $ npm ls --all
| Port Number | Port Number Docker Internal | Description | Credentials |
|---|---|---|---|
| 8080 | 8080 | Application Backend | |
| 8081 | 8081 | Application Backend Healthcheck | |
| 4200 | 80 | Application Frontend | test:test |
| 5432 | 5432 | Application DB | registration-service:password |
| 8180 | 8080 | Keycloak | admin:admin |
| 5435 | 5435 | Keycloak DB | registration-service-keycloak:password |
The health and readiness of this service can be obtained at the following endpoints:
GET :8081/actuator/health/livenessGET :8081/actuator/health/readiness
liveness includes health states of the following components:
web-server
readiness includes health states of the following components:
databasekeycloak
The keycloak is running under http://host.docker.internal:8180.
To be able to send emails from local keycloak the SMTP Server configuration needs to be set in keycloak/import/realm-registrationservice.json property smtpServer
-
To connect to the test vzd you need to get a client id and a client secret. You can get it from the Arvato SE.
-
- Option 1: Copy application-local-docker-with-vzd-test.yml.template to
application-local-docker-with-vzd-test.ymlif you are using docker compose to run the backend. - Option 2: application-local-with-vzd-test.yml.template to
application-local-with-vzd-test.ymlif you are running your backend locally (with run configuration).
- Option 1: Copy application-local-docker-with-vzd-test.yml.template to
-
Edit the properties in the copied file application-local-docker-with-vzd-test.yml or application-local-with-vzd-test.yml in the section
vzd:Key Old Value New Value clientId fillInYourClientId {your client id} clientSecret fillInYourClientSecret {your client secret} -
Change the profile:
- Option 1. When you run the backend with
docker compose up, change the line in the docker-compose.ymlSPRING_PROFILES_ACTIVE: local-dockertoSPRING_PROFILES_ACTIVE: local-docker-with-vzd-test. - Option 2. When you run the backend locally use the predefined Run Configuration Backend - local-with-zd-test.
- Option 1. When you run the backend with
- Generally, the tests can be run with the following command. There are unit and integrations test executed.
$ ./mvnw -f rd-backend/pom.xml test- The Federation List Test requires the registration service to connect with the actual VZD-Server instead of the mock server. In order to run this test, you will have to use application-integration-tests-with-vzd-test.yml. In this file, you have to replace the clientID and clientSecret in the section
vzd
License reports can be created at any time for the following modules:
- rd-backend
- rd-frontend
In order to create a license report for the rd-backend module simply run the following commands inside the project root directory. These commands are tested with zsh but should apply in bash also:
$ ./mvnw license:third-party-report -f rd-backend/pom.xmlLicense reports can then be found at $PROJECT_DIR/target/reports/third-party-report.html.
In order to create a license report for the rd-frontend module simply run the following commands inside the project root directory. These commands are tested with zsh but should apply in bash also:
$ ./mvnw -f rd-frontend/pom.xml site -P licenseLicense reports can then be found at $PROJECT_DIR/target/reports/third-party-report-npm.txt.
Please note that the directories css and images and their contents actually belong to the license report. However, they are only used for styling the HTML page and as such are not required to view the report.
- Frontend needs to be able to communicate with the backend.
- Requests to homeserver Userinfo API ( "/_matrix/federation/v1/openid/userinfo" ) for contact-management OpenID token checks
- Requests toward the rawdata gathering service (
rawdata master) - Connection to Keycloak
- Requests towards the Kubernetes operator in non-local environments
- Requests towards the Grafana Loki in non-local environments for log downloads
- requests towards vzd
