* MP-19 Refactoring: Einführung der "Registry" & "Masterdata" Trennung … * MP-19 Refactoring: Frontend Tabula Rasa * MP-19 Refactoring: Frontend Tabula Rasa * refactoring: * MP-20 fix(docker/clients): include `:domains` module in web/desktop b… * MP-20 fix(web-app build): resolve JS compile error and add dev/prod b… * MP-20 fix(web-app): remove vendor.js reference and harden JS bootstra… * MP-20 fixing: clients * MP-20 fixing: clients
4.4 KiB
4.4 KiB
Meldestelle Clients – Architekturübersicht (aktualisiert)
Ziele
- Öffentliche Willkommensseite mit Links zu Ping-Service, Keycloak Login/Registrierung
- Einfache Auth-Status-Seite („Du bist als … angemeldet“)
- Bereinigung der Legacy-UI (altes Präsentations-Layer entfernt)
- Bereitstellung als Docker-Container:
web-app(Kotlin/JS) unddesktop-app(VNC/noVNC)
Module und Struktur
clients/app: Einstieg der Anwendung (Compose Multiplatform)MainApp.kt: Start-Routing, ComposablesWelcomeScreen,LoginScreen,AuthStatusScreen- Verwendet:
ping-feature(PingScreen),auth-feature(Login viaAuthApiClient)
clients/shared: Gemeinsame Domain/Data/DI +AppConfigAppConfig: Basis-URLs und Keycloak-Client-Konfiguration
clients/shared/common-ui: generische UI-Bausteine (Legacy-Teile neutralisiert)layout/MainLayout.kt,components/NotificationCard.kt,screens/DashboardScreen.kt→ bewusst geleert
clients/auth-feature: Login-API gegen Keycloak (Password Grant)clients/ping-feature: Ping-Screen und ViewModel, greift auf Ping-Service zu
Navigation (vereinfacht)
- Start:
AppScreen.Home→WelcomeScreen AppScreen.Ping→PingScreenAppScreen.Login→LoginScreenAppScreen.Profile→AuthStatusScreen
Keycloak-Konfiguration
Quelle: docker/core/keycloak/meldestelle-realm.json und docs/reference/ports-and-urls.md
- Realm:
meldestelle - Öffentlicher Client:
web-app(PKCE; für Browser) - Keycloak URL (lokal):
http://localhost:8180 - AppConfig nutzt:
KEYCLOAK_URL=http://localhost:8180,KEYCLOAK_REALM=meldestelle,KEYCLOAK_CLIENT_ID=web-app
Authentifizierungs-Flow (PKCE)
- Flow: Authorization Code Flow mit PKCE (S256)
- Redirect-URI (lokal):
http://localhost:4000/(Root, Query-Parameter werden vom Client ausgewertet) - Ablauf:
- Button „Login“ → PKCE-Start (Code Verifier/Challenge werden generiert) und Redirect zu Keycloak
/auth - Keycloak leitet zurück auf
http://localhost:4000/?code=...&state=... - Client tauscht
code+code_verifieram/token-Endpoint gegen Tokens AuthTokenManagerspeichert Access-Token (in-memory), UI zeigt Status „Du bist als … angemeldet“
- Button „Login“ → PKCE-Start (Code Verifier/Challenge werden generiert) und Redirect zu Keycloak
Hinweis: Password-Grant wird nicht mehr genutzt; für Desktop (JVM) bleibt bei Bedarf der lokale Login-Screen als Fallback vorhanden.
Ports und URLs (lokal)
Quelle: docs/reference/ports-and-urls.md
- API Gateway:
http://localhost:8081 - Keycloak:
http://localhost:8180 - Ping Service:
http://localhost:8082 - Web App:
http://localhost:4000 - Desktop App: VNC
5901, noVNChttp://localhost:6080
Docker
Web-App (Kotlin/JS, kein WASM)
- Dockerfile:
dockerfiles/clients/web-app/Dockerfile - Build: Gradle
:clients:app:jsBrowserDistribution→ statische Dateien via Nginx - Compose:
- Hardcoded: Service
web-appmit Port4000:4000incompose.hardcoded.yaml - Variablen: Service
web-appmit${WEB_APP_PORT}incompose.yaml(Wert in.env)
- Hardcoded: Service
Downloads (Desktop-Installer, Platzhalter):
- Verzeichnis:
dockerfiles/clients/web-app/downloads/→ wird nach/usr/share/nginx/html/downloads/kopiert - URL:
http://localhost:4000/downloads/ - Alternativ: per Compose ein Host-Verzeichnis auf
/usr/share/nginx/html/downloadsmounten
Desktop-App (VNC/noVNC)
- Dockerfile:
dockerfiles/clients/desktop-app/Dockerfile - Build: Gradle
:clients:app:createDistributable→ Desktop Runtime - Runtime: Ubuntu +
xvfb+x11vnc+noVNC+supervisord - Compose:
- Hardcoded: Service
desktop-app5901/6080 incompose.hardcoded.yaml - Variablen: Service
desktop-appmit${DESKTOP_APP_VNC_PORT}und${DESKTOP_APP_NOVNC_PORT}incompose.yaml(Werte in.env)
- Hardcoded: Service
Bereinigung (Altlasten)
- Entfernt/neutralisiert: Altes Präsentations-Layer (abhängig von
presentation.state/actions)clients/shared/common-ui/components/NotificationCard.kt→ geleertclients/shared/common-ui/layout/MainLayout.kt→ geleertclients/shared/common-ui/screens/DashboardScreen.kt→ geleert
Konfigurationsquelle
- Einheitliche Werte/Ports:
docker/versions.toml(Clients:web-app=4000,desktop-app-vnc=5901,desktop-app-novnc=6080) - Compose-Variablen:
.envund.env.template
Nächste Schritte
- Optional: Umstellung Login auf Authorization Code Flow (PKCE) für Browser
- Optional: Willkommensseite visuell ausbauen (Branding)
- Optional: Bereitstellung der Desktop-Installer über
web-appDownload-Link