feat(core+frontend): add P2P sync infrastructure with WebSocket support

- **Core Updates:**
  - Implemented `P2pSyncService` interface with platform-specific WebSocket implementations (`JvmP2pSyncService` and no-op for JS).
  - Developed `SyncEvent` sealed class hierarchy to handle peer synchronization events (e.g., `PingEvent`, `PongEvent`, `DataChangedEvent`, etc.).

- **Frontend Integration:**
  - Introduced `SyncManager` to manage peer discovery and synchronization, coupled with `NetworkDiscoveryService`.
  - Updated dependency injection to include `syncModule` for platform-specific sync service initialization.
  - Enhanced `BewerbViewModel` to support new sync capabilities, including observing sync events and UI updates for connected peers.

- **Backend Enhancements:**
  - Added ZNS-specific fields (`zns_nummer`, `zns_abteilung`) to Bewerb table for idempotent imports.
  - Introduced import ZNS logic to handle duplicates and align with SyncManager updates.

- **UI Improvements:**
  - Enhanced `TurnierBewerbeTab` with updated dialogs (ZNS imports, sync status) and dynamic previews.
  - Improved network syncing feedback and error handling in frontend components.

- **DB Changes:**
  - Added migration for new column fields in the Bewerb table with relevant indexing for ZNS import optimizations.
This commit is contained in:
2026-04-10 10:54:56 +02:00
parent 6b6965bbbb
commit 8726129b96
21 changed files with 454 additions and 18 deletions
+4
View File
@@ -139,10 +139,13 @@ ktor-client-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-
ktor-client-auth = { module = "io.ktor:ktor-client-auth", version.ref = "ktor" }
ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" }
ktor-client-mock = { module = "io.ktor:ktor-client-mock", version.ref = "ktor" }
ktor-client-websockets = { module = "io.ktor:ktor-client-websockets-jvm", version.ref = "ktor" }
ktor-client-websockets-common = { module = "io.ktor:ktor-client-websockets", version.ref = "ktor" }
# Engines
ktor-client-cio = { module = "io.ktor:ktor-client-cio-jvm", version.ref = "ktor" } # JVM/Desktop
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" } # JS/Wasm
# ktor-client-websockets-common = { module = "io.ktor:ktor-client-websockets", version.ref = "ktor" }
# ==============================================================================
# === FRONTEND: DEPENDENCY INJECTION (KOIN) ===
@@ -213,6 +216,7 @@ ktor-server-swagger = { module = "io.ktor:ktor-server-swagger", version.ref = "k
ktor-server-tests = { module = "io.ktor:ktor-server-tests-jvm", version.ref = "ktor" }
ktor-server-testHost = { module = "io.ktor:ktor-server-test-host-jvm", version.ref = "ktor" }
ktor-server-routing-openapi = { module = "io.ktor:ktor-server-routing-openapi", version.ref = "ktor" }
ktor-server-websockets = { module = "io.ktor:ktor-server-websockets-jvm", version.ref = "ktor" }
# ==============================================================================
# === BACKEND: PERSISTENCE & INFRA ===