Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #131

Merged
merged 30 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
48fd80e
Add run configurations for services and update JRE version
MichiBaum Dec 24, 2024
40098e5
Add Writerside documentation and update diagram structure
MichiBaum Dec 24, 2024
6bac9d8
Add new documentation topics and improve structure
MichiBaum Dec 24, 2024
80fa264
Update Writerside docs with deployment steps and libraries
MichiBaum Dec 25, 2024
a91109c
Update documentation structure
MichiBaum Dec 25, 2024
86a7f03
Merge pull request #127 from MichiBaum/docs-writerside
MichiBaum Dec 25, 2024
46593f4
Upgrade PrimeNG and cleanup unused chess settings code.
MichiBaum Dec 26, 2024
20c6c34
TEMP!! Remove fideId from Person and migrate to Account entity
MichiBaum Dec 25, 2024
875e1dd
Refactor Account conversion and fix FIDE ID check.
MichiBaum Dec 26, 2024
da6c970
Add internalComment field to events and improve authentication
MichiBaum Dec 27, 2024
8ca081a
Refactor authentication and API logic for servlet-based architecture.
MichiBaum Dec 27, 2024
513e71a
Refactor OAuth requests to use dedicated DTO objects
MichiBaum Dec 29, 2024
f2109f8
Remove redundant fields from test data models.
MichiBaum Dec 29, 2024
0676395
Refactor integration tests to use MockMvc and Testcontainers
MichiBaum Dec 30, 2024
5b844e5
Add Flyway-based database cleanup for tests
MichiBaum Dec 31, 2024
292dd56
Add additional `info` properties to all application.yml files
MichiBaum Dec 31, 2024
6242947
Bugfix Revision 8ca081aee62ea079c74266fe313b0736de2afcd7.
MichiBaum Dec 31, 2024
46a9ac0
Remove auth cookie handling and introduce microservice overview
MichiBaum Jan 1, 2025
bd5257a
Refactor security rules to enforce stricter access control
MichiBaum Jan 1, 2025
876b301
Merge pull request #129 from MichiBaum/remove-f-webflux-and-reactive-…
MichiBaum Jan 1, 2025
0f6a971
Remove reactive security dependencies and refactor frontend
MichiBaum Jan 1, 2025
7987381
Refactor imports for improved consistency
MichiBaum Jan 1, 2025
fabfb74
Add Testcontainers documentation and update SonarQube workflow
MichiBaum Jan 2, 2025
fab357c
Refactor participant handling to use rxResource
MichiBaum Jan 2, 2025
37d559f
Add ChessPlatform support to events and update account links
MichiBaum Jan 2, 2025
b176f63
Add platform support to chess events and simplify event loading
MichiBaum Jan 3, 2025
b2a10b1
Refactor participants display to use player cards.
MichiBaum Jan 3, 2025
1ce1344
Add gender-based icons and participant sorting
MichiBaum Jan 3, 2025
fe2cbcc
Merge pull request #130 from MichiBaum/126-refactor-database-schema
MichiBaum Jan 3, 2025
a4c64db
Bugfix & Refactor sorting translation keys and remove unused auth param.
MichiBaum Jan 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Pull Request Labeler"
name: Pull Request Labeler
on:
pull_request:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
distribution: 'zulu'
java-version: '21'
cache: 'maven'
# TODO maybe step to use Testcontainers Cloud but github actions env has docker already therefore no explicit docker installation is needed
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
Expand Down
13 changes: 13 additions & 0 deletions .run/All Backend.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Backend" type="CompoundRunConfigurationType">
<toRun name="Dev Admin-Service" type="SpringBootApplicationConfigurationType" />
<toRun name="Dev Authentication-Service" type="SpringBootApplicationConfigurationType" />
<toRun name="Dev Chess-Service" type="SpringBootApplicationConfigurationType" />
<toRun name="Dev Fitness-Service" type="SpringBootApplicationConfigurationType" />
<toRun name="Dev Gateway-Service" type="SpringBootApplicationConfigurationType" />
<toRun name="Dev Music-Service" type="SpringBootApplicationConfigurationType" />
<toRun name="Dev Registry-Service" type="SpringBootApplicationConfigurationType" />
<toRun name="Dev Usermanagement-Service" type="SpringBootApplicationConfigurationType" />
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion .run/All Project Tests.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ENTRIES>
</extension>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="openjdk-21" />
<option name="ALTERNATIVE_JRE_PATH" value="openjdk-23" />
<option name="PACKAGE_NAME" value="com.michibaum" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
Expand Down
2 changes: 1 addition & 1 deletion .run/All UT.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ENTRIES>
</extension>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="openjdk-21" />
<option name="ALTERNATIVE_JRE_PATH" value="openjdk-23" />
<option name="PACKAGE_NAME" value="com.michibaum" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
Expand Down
21 changes: 21 additions & 0 deletions .run/Dev Admin-Service.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Dev Admin-Service" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="ACTIVE_PROFILES" value="dev" />
<module name="admin-service" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.michibaum.admin_service.AdminServiceApplication" />
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="true" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
<ENTRY IS_ENABLED="true" PARSER="env" IS_EXECUTABLE="false" PATH=".local-env" />
</ENTRIES>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
21 changes: 21 additions & 0 deletions .run/Dev Authentication-Service.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Dev Authentication-Service" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="ACTIVE_PROFILES" value="dev" />
<module name="authentication-service" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.michibaum.authentication_service.AuthenticationServiceApplication" />
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="true" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
<ENTRY IS_ENABLED="true" PARSER="env" IS_EXECUTABLE="false" PATH=".local-env" />
</ENTRIES>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
21 changes: 21 additions & 0 deletions .run/Dev Chess-Service.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Dev Chess-Service" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="ACTIVE_PROFILES" value="dev" />
<module name="chess-service" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.michibaum.chess_service.ChessServiceApplication" />
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="true" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
<ENTRY IS_ENABLED="true" PARSER="env" IS_EXECUTABLE="false" PATH=".local-env" />
</ENTRIES>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
21 changes: 21 additions & 0 deletions .run/Dev Fitness-Service.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Dev Fitness-Service" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="ACTIVE_PROFILES" value="dev" />
<module name="fitness-service" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.michibaum.fitness_service.FitnessServiceApplication" />
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="true" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
<ENTRY IS_ENABLED="true" PARSER="env" IS_EXECUTABLE="false" PATH=".local-env" />
</ENTRIES>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
21 changes: 21 additions & 0 deletions .run/Dev Gateway-Service.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Dev Gateway-Service" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="ACTIVE_PROFILES" value="dev" />
<module name="gateway-service" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.michibaum.gatewayservice.GatewayServiceApplication" />
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="true" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
<ENTRY IS_ENABLED="true" PARSER="env" IS_EXECUTABLE="false" PATH=".local-env" />
</ENTRIES>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
21 changes: 21 additions & 0 deletions .run/Dev Music-Service.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Dev Music-Service" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="ACTIVE_PROFILES" value="dev" />
<module name="music-service" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.michibaum.music_service.MusicServiceApplication" />
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="true" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
<ENTRY IS_ENABLED="true" PARSER="env" IS_EXECUTABLE="false" PATH=".local-env" />
</ENTRIES>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
21 changes: 21 additions & 0 deletions .run/Dev Registry-Service.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Dev Registry-Service" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="ACTIVE_PROFILES" value="dev" />
<module name="registry-service" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.michibaum.registry_service.RegistryServiceApplication" />
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="true" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
<ENTRY IS_ENABLED="true" PARSER="env" IS_EXECUTABLE="false" PATH=".local-env" />
</ENTRIES>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
21 changes: 21 additions & 0 deletions .run/Dev Usermanagement-Service.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Dev Usermanagement-Service" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="ACTIVE_PROFILES" value="dev" />
<module name="usermanagement-service" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.michibaum.usermanagement_service.UsermanagementServiceApplication" />
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="true" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
<ENTRY IS_ENABLED="true" PARSER="env" IS_EXECUTABLE="false" PATH=".local-env" />
</ENTRIES>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
21 changes: 21 additions & 0 deletions .run/Dev Website-Service.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Dev Website-Service" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="ACTIVE_PROFILES" value="dev" />
<module name="website-service" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.michibaum.websiteservice.WebsiteServiceApplication" />
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="true" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
<ENTRY IS_ENABLED="true" PARSER="env" IS_EXECUTABLE="false" PATH=".local-env" />
</ENTRIES>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/Website start.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Website start" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/website/package.json" />
<command value="run" />
<scripts>
<script value="start" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
124 changes: 1 addition & 123 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,130 +47,8 @@ And these databases:
- Chess DB
- Fitness DB

## Actions

### Labeler

There is a github action, witch sets automatic labels on Pull requests.

### OSV Scanner

This scanner scans the dependencies and creates a vulnerability report.

## Maven

### Release plugin

The Maven Release Plugin automates the process of releasing project versions by updating version numbers and creating
tags in the version control system. Use the command `mvn release:update-versions` to update the version information in
your project's `pom.xml` files.

## Docker

### Container

#### Up

```
docker compose up -d
```

#### Down

```
docker compose down
```

#### Logs

```
# Follow
docker compose logs -f

# Single container
docker compose logs ´name´
```

#### Stats

```
docker stats
```

### Docker database backup

Replace 'PASSWORD' with password defined in .env.
Replace path '/data/db-backup' if different location is needed.
```
# Save sql file
docker exec microservices-chess-db-1 mysqldump -u root -pPASSWORD chess > someFilename.sql

# Save gzip
docker exec microservices-chess-db-1 mysqldump -u root -pPASSWORD chess | gzip -c > /data/db-backup/chess_$(date -d "today" +"%Y-%m-%d_%H-%M").sql.gz

# All databases, replace password and save path
docker exec microservices-chess-db-1 mysqldump -u root -pPASSWORD chess | gzip -c > /data/db-backup/chess_$(date -d "today" +"%Y-%m-%d_%H-%M").sql.gz
docker exec microservices-music-db-1 mysqldump -u root -pPASSWORD music | gzip -c > /data/db-backup/music_$(date -d "today" +"%Y-%m-%d_%H-%M").sql.gz
docker exec microservices-fitness-db-1 mysqldump -u root -pPASSWORD fitness | gzip -c > /data/db-backup/fitness_$(date -d "today" +"%Y-%m-%d_%H-%M").sql.gz
docker exec microservices-usermanagement-db-1 mysqldump -u root -pPASSWORD usermanagement | gzip -c > /data/db-backup/usermanagement_$(date -d "today" +"%Y-%m-%d_%H-%M").sql.gz
docker exec microservices-authentication-db-1 mysqldump -u root -pPASSWORD authentication | gzip -c > /data/db-backup/authentication_$(date -d "today" +"%Y-%m-%d_%H-%M").sql.gz

# Add to crontab (escape % with \%)
crontab -e

# List cronjobs
crontab -l
```

### Change HOSTS file (for dev on local machine)
*Remember to take Backup before editing your `hosts` file, mistakes there can block your internet access or cause other network-related issues.*


#### Windows

In *C:\Windows\System32\drivers\etc* find file *hosts* and add those lines:

```
# Microservices
127.0.0.1 chess.michibaum.ch
127.0.0.1 gateway.michibaum.ch
127.0.0.1 registry.michibaum.ch
127.0.0.1 admin.michibaum.ch
127.0.0.1 usermanagement.michibaum.ch
127.0.0.1 authentication.michibaum.ch
127.0.0.1 fitness.michibaum.ch
127.0.0.1 music.michibaum.ch
127.0.0.1 michibaum.ch
```

#### Linux

File: */etc/hosts*


### Scan docker files

```
docker scan YourDockerHubUsername/DockerHubRepository:TagName --dependency-tree
```

## Local dev db

```
docker run --name microservices -e MARIADB_ROOT_PASSWORD=someRootPass -p 3306:3306 -d mariadb:10.11
```

After that create the databases in the container.

```
create schema `authentication-db`;
create schema `chess-db`;
create schema `fitness-db`;
create schema `music-db`;
create schema `usermanagement-db`;
```

The tables are created trough [flyway](https://documentation.red-gate.com/fd/migrations-184127470.html).
All docs can be found [/docs/Writerside/topics](/docs/Writerside/topics/Overview.md)


## License
Expand Down
Loading
Loading