refactor: Migrate from monolithic to modular architecture

1. **Dokumentation der Architektur:**
    - Vervollständigen Sie die C4-Diagramme im docs-Verzeichnis
    - Dokumentieren Sie die wichtigsten Architekturentscheidungen in ADRs

2. **Redis-Integration finalisieren:**
    - Implementieren Sie die verteilte Cache-Lösung für die Offline-Fähigkeit
    - Nutzen Sie Redis Streams für das Event-Sourcing
This commit is contained in:
stefan
2025-07-23 14:29:40 +02:00
parent a256622f37
commit 9282dd0eb4
52 changed files with 5648 additions and 3 deletions
+26
View File
@@ -0,0 +1,26 @@
@startuml C4_Context
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
title Systemkontext-Diagramm für Meldestelle
Person(eventOrganizer, "Veranstaltungsorganisator", "Organisiert und verwaltet Reitsportveranstaltungen")
Person(administrator, "Administrator", "Verwaltet Systemkonfiguration und Stammdaten")
Person(member, "Mitglied", "Meldet sich für Veranstaltungen an und verwaltet persönliche Informationen")
Person(horseOwner, "Pferdebesitzer", "Registriert und verwaltet Pferdeinformationen")
System(meldestelle, "Meldestelle", "Modulares System zur Verwaltung von Pferdesportveranstaltungen, einschließlich Registrierung von Pferden, Mitgliedern und Veranstaltungen")
System_Ext(paymentProvider, "Zahlungsanbieter", "Verarbeitet Zahlungen für Veranstaltungsanmeldungen")
System_Ext(emailSystem, "E-Mail-System", "Sendet Benachrichtigungen und Bestätigungen")
System_Ext(federationSystem, "Reitsportverband-System", "Bietet Validierung von Mitgliedschaften und Pferden")
Rel(eventOrganizer, meldestelle, "Erstellt und verwaltet Veranstaltungen mit")
Rel(administrator, meldestelle, "Konfiguriert und administriert")
Rel(member, meldestelle, "Meldet sich für Veranstaltungen an und aktualisiert persönliche Informationen mit")
Rel(horseOwner, meldestelle, "Registriert und verwaltet Pferde mit")
Rel(meldestelle, paymentProvider, "Verarbeitet Zahlungen über")
Rel(meldestelle, emailSystem, "Sendet Benachrichtigungen über")
Rel(meldestelle, federationSystem, "Validiert Mitgliedschaften und Pferde mit")
@enduml
+26
View File
@@ -0,0 +1,26 @@
@startuml C4_Context
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
title System Context diagram for Meldestelle
Person(eventOrganizer, "Event Organizer", "Organizes and manages equestrian events")
Person(administrator, "Administrator", "Manages system configuration and master data")
Person(member, "Member", "Registers for events and manages personal information")
Person(horseOwner, "Horse Owner", "Registers and manages horse information")
System(meldestelle, "Meldestelle", "Modular system for managing equestrian sports events, including registration of horses, members, and events")
System_Ext(paymentProvider, "Payment Provider", "Processes payments for event registrations")
System_Ext(emailSystem, "Email System", "Sends notifications and confirmations")
System_Ext(federationSystem, "Equestrian Federation System", "Provides validation of memberships and horses")
Rel(eventOrganizer, meldestelle, "Creates and manages events using")
Rel(administrator, meldestelle, "Configures and administers")
Rel(member, meldestelle, "Registers for events and updates personal information using")
Rel(horseOwner, meldestelle, "Registers and manages horses using")
Rel(meldestelle, paymentProvider, "Processes payments through")
Rel(meldestelle, emailSystem, "Sends notifications via")
Rel(meldestelle, federationSystem, "Validates memberships and horses with")
@enduml
+75
View File
@@ -0,0 +1,75 @@
@startuml C4_Container
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
title Container-Diagramm für Meldestelle
Person(eventOrganizer, "Veranstaltungsorganisator", "Organisiert und verwaltet Reitsportveranstaltungen")
Person(administrator, "Administrator", "Verwaltet Systemkonfiguration und Stammdaten")
Person(member, "Mitglied", "Meldet sich für Veranstaltungen an und verwaltet persönliche Informationen")
Person(horseOwner, "Pferdebesitzer", "Registriert und verwaltet Pferdeinformationen")
System_Boundary(meldestelle, "Meldestelle") {
Container(desktopApp, "Desktop-Anwendung", "Kotlin, Compose Multiplatform", "Bietet eine umfangreiche Benutzeroberfläche für Administratoren und Veranstaltungsorganisatoren")
Container(webApp, "Web-Anwendung", "Kotlin, Compose Multiplatform", "Bietet eine Weboberfläche für Mitglieder und Pferdebesitzer")
Container(apiGateway, "API-Gateway", "Kotlin, Ktor", "Leitet Anfragen an entsprechende Dienste weiter, verwaltet Authentifizierung und Autorisierung")
Container(masterdataService, "Stammdaten-Dienst", "Kotlin, Spring Boot", "Verwaltet Stammdaten wie Standorte, Disziplinen usw.")
Container(membersService, "Mitglieder-Dienst", "Kotlin, Spring Boot", "Verwaltet Mitgliederregistrierung und -profile")
Container(horsesService, "Pferde-Dienst", "Kotlin, Spring Boot", "Verwaltet Pferderegistrierung und -informationen")
Container(eventsService, "Veranstaltungs-Dienst", "Kotlin, Spring Boot", "Verwaltet Veranstaltungserstellung, -planung und -anmeldungen")
ContainerDb(postgresql, "PostgreSQL", "Datenbank", "Speichert alle persistenten Daten")
ContainerDb(redis, "Redis", "Cache", "Bietet Caching für häufig abgerufene Daten")
Container(kafka, "Kafka", "Message Broker", "Verarbeitet ereignisgesteuerte Kommunikation zwischen Diensten")
Container(keycloak, "Keycloak", "Authentifizierungsserver", "Verwaltet Benutzerauthentifizierung und -autorisierung")
Container(monitoring, "Monitoring", "Prometheus, Grafana, Zipkin", "Bietet Überwachung, Metriken und verteiltes Tracing")
}
System_Ext(paymentProvider, "Zahlungsanbieter", "Verarbeitet Zahlungen für Veranstaltungsanmeldungen")
System_Ext(emailSystem, "E-Mail-System", "Sendet Benachrichtigungen und Bestätigungen")
System_Ext(federationSystem, "Reitsportverband-System", "Bietet Validierung von Mitgliedschaften und Pferden")
Rel(eventOrganizer, desktopApp, "Verwendet")
Rel(administrator, desktopApp, "Verwendet")
Rel(member, webApp, "Verwendet")
Rel(horseOwner, webApp, "Verwendet")
Rel(desktopApp, apiGateway, "Stellt API-Aufrufe an", "HTTPS/JSON")
Rel(webApp, apiGateway, "Stellt API-Aufrufe an", "HTTPS/JSON")
Rel(apiGateway, masterdataService, "Leitet Anfragen weiter an", "HTTPS/JSON")
Rel(apiGateway, membersService, "Leitet Anfragen weiter an", "HTTPS/JSON")
Rel(apiGateway, horsesService, "Leitet Anfragen weiter an", "HTTPS/JSON")
Rel(apiGateway, eventsService, "Leitet Anfragen weiter an", "HTTPS/JSON")
Rel(apiGateway, keycloak, "Authentifiziert mit", "HTTPS/JSON")
Rel(masterdataService, postgresql, "Liest von und schreibt in")
Rel(membersService, postgresql, "Liest von und schreibt in")
Rel(horsesService, postgresql, "Liest von und schreibt in")
Rel(eventsService, postgresql, "Liest von und schreibt in")
Rel(masterdataService, redis, "Speichert Daten im Cache")
Rel(membersService, redis, "Speichert Daten im Cache")
Rel(horsesService, redis, "Speichert Daten im Cache")
Rel(eventsService, redis, "Speichert Daten im Cache")
Rel(masterdataService, kafka, "Veröffentlicht und abonniert Ereignisse")
Rel(membersService, kafka, "Veröffentlicht und abonniert Ereignisse")
Rel(horsesService, kafka, "Veröffentlicht und abonniert Ereignisse")
Rel(eventsService, kafka, "Veröffentlicht und abonniert Ereignisse")
Rel(masterdataService, monitoring, "Sendet Metriken und Traces an")
Rel(membersService, monitoring, "Sendet Metriken und Traces an")
Rel(horsesService, monitoring, "Sendet Metriken und Traces an")
Rel(eventsService, monitoring, "Sendet Metriken und Traces an")
Rel(apiGateway, monitoring, "Sendet Metriken und Traces an")
Rel(eventsService, paymentProvider, "Verarbeitet Zahlungen über", "HTTPS/JSON")
Rel(membersService, emailSystem, "Sendet Benachrichtigungen über", "SMTP")
Rel(eventsService, emailSystem, "Sendet Benachrichtigungen über", "SMTP")
Rel(membersService, federationSystem, "Validiert Mitgliedschaften mit", "HTTPS/JSON")
Rel(horsesService, federationSystem, "Validiert Pferde mit", "HTTPS/JSON")
@enduml
+75
View File
@@ -0,0 +1,75 @@
@startuml C4_Container
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
title Container diagram for Meldestelle
Person(eventOrganizer, "Event Organizer", "Organizes and manages equestrian events")
Person(administrator, "Administrator", "Manages system configuration and master data")
Person(member, "Member", "Registers for events and manages personal information")
Person(horseOwner, "Horse Owner", "Registers and manages horse information")
System_Boundary(meldestelle, "Meldestelle") {
Container(desktopApp, "Desktop Application", "Kotlin, Compose Multiplatform", "Provides a rich UI for administrators and event organizers")
Container(webApp, "Web Application", "Kotlin, Compose Multiplatform", "Provides a web interface for members and horse owners")
Container(apiGateway, "API Gateway", "Kotlin, Ktor", "Routes requests to appropriate services, handles authentication and authorization")
Container(masterdataService, "Masterdata Service", "Kotlin, Spring Boot", "Manages master data such as locations, disciplines, etc.")
Container(membersService, "Members Service", "Kotlin, Spring Boot", "Manages member registration and profiles")
Container(horsesService, "Horses Service", "Kotlin, Spring Boot", "Manages horse registration and information")
Container(eventsService, "Events Service", "Kotlin, Spring Boot", "Manages event creation, scheduling, and registrations")
ContainerDb(postgresql, "PostgreSQL", "Database", "Stores all persistent data")
ContainerDb(redis, "Redis", "Cache", "Provides caching for frequently accessed data")
Container(kafka, "Kafka", "Message Broker", "Handles event-driven communication between services")
Container(keycloak, "Keycloak", "Authentication Server", "Manages user authentication and authorization")
Container(monitoring, "Monitoring", "Prometheus, Grafana, Zipkin", "Provides monitoring, metrics, and distributed tracing")
}
System_Ext(paymentProvider, "Payment Provider", "Processes payments for event registrations")
System_Ext(emailSystem, "Email System", "Sends notifications and confirmations")
System_Ext(federationSystem, "Equestrian Federation System", "Provides validation of memberships and horses")
Rel(eventOrganizer, desktopApp, "Uses")
Rel(administrator, desktopApp, "Uses")
Rel(member, webApp, "Uses")
Rel(horseOwner, webApp, "Uses")
Rel(desktopApp, apiGateway, "Makes API calls to", "HTTPS/JSON")
Rel(webApp, apiGateway, "Makes API calls to", "HTTPS/JSON")
Rel(apiGateway, masterdataService, "Routes requests to", "HTTPS/JSON")
Rel(apiGateway, membersService, "Routes requests to", "HTTPS/JSON")
Rel(apiGateway, horsesService, "Routes requests to", "HTTPS/JSON")
Rel(apiGateway, eventsService, "Routes requests to", "HTTPS/JSON")
Rel(apiGateway, keycloak, "Authenticates with", "HTTPS/JSON")
Rel(masterdataService, postgresql, "Reads from and writes to")
Rel(membersService, postgresql, "Reads from and writes to")
Rel(horsesService, postgresql, "Reads from and writes to")
Rel(eventsService, postgresql, "Reads from and writes to")
Rel(masterdataService, redis, "Caches data in")
Rel(membersService, redis, "Caches data in")
Rel(horsesService, redis, "Caches data in")
Rel(eventsService, redis, "Caches data in")
Rel(masterdataService, kafka, "Publishes and subscribes to events")
Rel(membersService, kafka, "Publishes and subscribes to events")
Rel(horsesService, kafka, "Publishes and subscribes to events")
Rel(eventsService, kafka, "Publishes and subscribes to events")
Rel(masterdataService, monitoring, "Sends metrics and traces to")
Rel(membersService, monitoring, "Sends metrics and traces to")
Rel(horsesService, monitoring, "Sends metrics and traces to")
Rel(eventsService, monitoring, "Sends metrics and traces to")
Rel(apiGateway, monitoring, "Sends metrics and traces to")
Rel(eventsService, paymentProvider, "Processes payments through", "HTTPS/JSON")
Rel(membersService, emailSystem, "Sends notifications via", "SMTP")
Rel(eventsService, emailSystem, "Sends notifications via", "SMTP")
Rel(membersService, federationSystem, "Validates memberships with", "HTTPS/JSON")
Rel(horsesService, federationSystem, "Validates horses with", "HTTPS/JSON")
@enduml
@@ -0,0 +1,63 @@
@startuml C4_Component
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml
title Komponenten-Diagramm für Veranstaltungs-Dienst
Container_Boundary(apiGateway, "API-Gateway") {
Component(apiGatewayRouting, "Routing-Komponente", "Ktor Routing", "Leitet Anfragen an entsprechende Dienste weiter")
Component(apiGatewayAuth, "Authentifizierungs-Komponente", "Ktor Auth", "Verwaltet Authentifizierung und Autorisierung")
}
Container_Boundary(eventsService, "Veranstaltungs-Dienst") {
Component(eventsApi, "Veranstaltungs-API", "Kotlin, Spring Web", "Definiert die REST-API-Endpunkte für die Veranstaltungsverwaltung")
Component(eventsApplication, "Veranstaltungs-Anwendung", "Kotlin, Spring", "Enthält Anwendungsdienste und Anwendungsfälle")
Component(eventCommandHandlers, "Veranstaltungs-Befehlshandler", "Kotlin", "Verarbeitet Befehle zum Erstellen und Ändern von Veranstaltungen")
Component(eventQueryHandlers, "Veranstaltungs-Abfragehandler", "Kotlin", "Verarbeitet Abfragen zum Abrufen von Veranstaltungsinformationen")
Component(eventsDomain, "Veranstaltungs-Domäne", "Kotlin", "Enthält Domänenmodelle und Geschäftslogik")
Component(eventAggregate, "Veranstaltungs-Aggregat", "Kotlin", "Kern-Domänenentität, die eine Veranstaltung repräsentiert")
Component(participantAggregate, "Teilnehmer-Aggregat", "Kotlin", "Kern-Domänenentität, die einen Teilnehmer repräsentiert")
Component(eventDomainServices, "Veranstaltungs-Domänendienste", "Kotlin", "Domänendienste für komplexe Geschäftslogik")
Component(eventsInfrastructure, "Veranstaltungs-Infrastruktur", "Kotlin, Spring Data", "Enthält Infrastrukturimplementierungen")
Component(eventRepository, "Veranstaltungs-Repository", "Kotlin, Spring Data JPA", "Speichert und ruft Veranstaltungsdaten ab")
Component(eventMessagePublisher, "Veranstaltungs-Nachrichtenveröffentlicher", "Kotlin, Spring Kafka", "Veröffentlicht Domänenereignisse an Kafka")
Component(externalServiceClients, "Externe Dienst-Clients", "Kotlin, WebClient", "Clients für externe Dienste")
}
ContainerDb(postgresql, "PostgreSQL", "Datenbank", "Speichert alle persistenten Daten")
Container(kafka, "Kafka", "Message Broker", "Verarbeitet ereignisgesteuerte Kommunikation zwischen Diensten")
Container(redis, "Redis", "Cache", "Bietet Caching für häufig abgerufene Daten")
System_Ext(paymentProvider, "Zahlungsanbieter", "Verarbeitet Zahlungen für Veranstaltungsanmeldungen")
System_Ext(emailSystem, "E-Mail-System", "Sendet Benachrichtigungen und Bestätigungen")
Rel(apiGatewayRouting, eventsApi, "Leitet Anfragen weiter an", "HTTPS/JSON")
Rel(apiGatewayAuth, eventsApi, "Stellt Authentifizierungskontext bereit für")
Rel(eventsApi, eventsApplication, "Verwendet")
Rel(eventsApplication, eventCommandHandlers, "Verwendet")
Rel(eventsApplication, eventQueryHandlers, "Verwendet")
Rel(eventCommandHandlers, eventsDomain, "Verwendet")
Rel(eventQueryHandlers, eventsDomain, "Verwendet")
Rel(eventCommandHandlers, eventsInfrastructure, "Verwendet")
Rel(eventQueryHandlers, eventsInfrastructure, "Verwendet")
Rel(eventsDomain, eventAggregate, "Enthält")
Rel(eventsDomain, participantAggregate, "Enthält")
Rel(eventsDomain, eventDomainServices, "Enthält")
Rel(eventsInfrastructure, eventRepository, "Enthält")
Rel(eventsInfrastructure, eventMessagePublisher, "Enthält")
Rel(eventsInfrastructure, externalServiceClients, "Enthält")
Rel(eventRepository, postgresql, "Liest von und schreibt in")
Rel(eventMessagePublisher, kafka, "Veröffentlicht Nachrichten an")
Rel(eventQueryHandlers, redis, "Speichert Ergebnisse im Cache")
Rel(externalServiceClients, paymentProvider, "Stellt API-Aufrufe an", "HTTPS/JSON")
Rel(externalServiceClients, emailSystem, "Sendet E-Mails über", "SMTP")
@enduml
@@ -0,0 +1,63 @@
@startuml C4_Component
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml
title Component diagram for Events Service
Container_Boundary(apiGateway, "API Gateway") {
Component(apiGatewayRouting, "Routing Component", "Ktor Routing", "Routes requests to appropriate services")
Component(apiGatewayAuth, "Authentication Component", "Ktor Auth", "Handles authentication and authorization")
}
Container_Boundary(eventsService, "Events Service") {
Component(eventsApi, "Events API", "Kotlin, Spring Web", "Defines the REST API endpoints for event management")
Component(eventsApplication, "Events Application", "Kotlin, Spring", "Contains application services and use cases")
Component(eventCommandHandlers, "Event Command Handlers", "Kotlin", "Handles commands for creating and modifying events")
Component(eventQueryHandlers, "Event Query Handlers", "Kotlin", "Handles queries for retrieving event information")
Component(eventsDomain, "Events Domain", "Kotlin", "Contains domain models and business logic")
Component(eventAggregate, "Event Aggregate", "Kotlin", "Core domain entity representing an event")
Component(participantAggregate, "Participant Aggregate", "Kotlin", "Core domain entity representing a participant")
Component(eventDomainServices, "Event Domain Services", "Kotlin", "Domain services for complex business logic")
Component(eventsInfrastructure, "Events Infrastructure", "Kotlin, Spring Data", "Contains infrastructure implementations")
Component(eventRepository, "Event Repository", "Kotlin, Spring Data JPA", "Persists and retrieves event data")
Component(eventMessagePublisher, "Event Message Publisher", "Kotlin, Spring Kafka", "Publishes domain events to Kafka")
Component(externalServiceClients, "External Service Clients", "Kotlin, WebClient", "Clients for external services")
}
ContainerDb(postgresql, "PostgreSQL", "Database", "Stores all persistent data")
Container(kafka, "Kafka", "Message Broker", "Handles event-driven communication between services")
Container(redis, "Redis", "Cache", "Provides caching for frequently accessed data")
System_Ext(paymentProvider, "Payment Provider", "Processes payments for event registrations")
System_Ext(emailSystem, "Email System", "Sends notifications and confirmations")
Rel(apiGatewayRouting, eventsApi, "Routes requests to", "HTTPS/JSON")
Rel(apiGatewayAuth, eventsApi, "Provides authentication context to")
Rel(eventsApi, eventsApplication, "Uses")
Rel(eventsApplication, eventCommandHandlers, "Uses")
Rel(eventsApplication, eventQueryHandlers, "Uses")
Rel(eventCommandHandlers, eventsDomain, "Uses")
Rel(eventQueryHandlers, eventsDomain, "Uses")
Rel(eventCommandHandlers, eventsInfrastructure, "Uses")
Rel(eventQueryHandlers, eventsInfrastructure, "Uses")
Rel(eventsDomain, eventAggregate, "Contains")
Rel(eventsDomain, participantAggregate, "Contains")
Rel(eventsDomain, eventDomainServices, "Contains")
Rel(eventsInfrastructure, eventRepository, "Contains")
Rel(eventsInfrastructure, eventMessagePublisher, "Contains")
Rel(eventsInfrastructure, externalServiceClients, "Contains")
Rel(eventRepository, postgresql, "Reads from and writes to")
Rel(eventMessagePublisher, kafka, "Publishes messages to")
Rel(eventQueryHandlers, redis, "Caches results in")
Rel(externalServiceClients, paymentProvider, "Makes API calls to", "HTTPS/JSON")
Rel(externalServiceClients, emailSystem, "Sends emails via", "SMTP")
@enduml