Commit graph

9 commits

Author SHA1 Message Date
Jens Reinemann
e3bcddac70 chore: update publish tooling and Android messaging integration 2026-05-18 15:13:49 +02:00
Jens Reinemann
c39bc5e485 feat: foreground service for background message notifications 2026-05-18 13:45:06 +02:00
Jens Reinemann
24c6fac0f8 feat(messaging): push notifications for incoming messages (#104)
- Add NotificationHelper with channel creation, grouped notifications,
  and deep-link PendingIntent into chat
- Trigger notification from MessageRepositoryImpl on WebSocket NewMessage
- Active-chat suppression in ChatViewModel (no notification for current chat)
- Deep-link from notification tap: MainActivity handles intent extras,
  MainScreen navigates to correct Chat screen
- Add POST_NOTIFICATIONS permission to AndroidManifest
- Add notification icon drawable (ic_notification_message)
- Add unit tests for notification suppression logic
- Fix pre-existing test compilation (SyncServiceImplTest missing authEventBus)
2026-05-18 09:39:39 +02:00
Jens Reinemann
a5f89e6a69 rename: Krisenvorrat -> Bollwerk
- Package: de.krisenvorrat.* -> de.bollwerk.*
- Klassen: KrisenvorratApp/Database/Theme -> Bollwerk*
- ApplicationId: de.bollwerk.app
- Server: BOLLWERK_* Env-Vars, bollwerk HOCON-Config
- Docker: bollwerk-server/db/backup Container-Namen
- Room DB: bollwerk.db, SharedPrefs: bollwerk_secure_prefs
- Export-Dateien: bollwerk_export/inventar
- UI-Strings, HTML, Admin-UI: alle auf Bollwerk
- Docs, Skills, README angepasst
- Alle Tests gruen, Build erfolgreich
2026-05-17 17:44:02 +02:00
Jens Reinemann
dfa4b37eda feat(update): Update-Dialog, Installation & App-Start-Integration (#85)
- AndroidManifest: REQUEST_INSTALL_PACKAGES Permission hinzugefuegt
- file_paths.xml: cache/update/ Pfad fuer FileProvider ergaenzt
- UpdateUiState: Sealed UI-State (Hidden, Checking, Available, Downloading,
  ReadyToInstall, Error)
- UpdateViewModel: State-Management fuer Update-Check beim App-Start,
  APK-Download mit Fortschrittsanzeige, Installation via FileProvider
- UpdateBanner: Nicht-blockierender animierter Banner mit Versionsanzeige,
  Download-Button, LinearProgressIndicator, Dismiss-Moeglichkeit
- MainScreen: UpdateBanner ueber dem NavGraph integriert
- ApkInstaller Interface + Impl: Testbare Abstraktion fuer APK-Installation
- RepositoryModule: ApkInstaller DI-Binding registriert
- 7 Unit Tests fuer UpdateViewModel (Update verfuegbar, kein Update,
  nicht konfiguriert, Fehler, Download-Fortschritt, Download-Fehler, Dismiss)
- Alle 441 Tests gruen

Closes #85
2026-05-17 05:13:11 +02:00
Jens Reinemann
cb576349e0 feat(server): add LAN dev-server integration & end-to-end sync tests
Start scripts (PS1 + Shell), Dockerfile, E2E sync tests, and README
documentation for Phase 2 LAN server deployment.

New files:
- start-server.ps1 / start-server.sh: one-command server startup with
  auto-build, LAN-IP detection, and configurable API key
- Dockerfile: multi-stage build (Gradle → JRE Alpine) for container
  deployment with volume mount for persistent data
- .dockerignore: excludes app/, .git, build artifacts from Docker context
- EndToEndSyncTest.kt: 7 E2E tests covering full push/pull sync cycle,
  multi-client overwrite, empty DB pull, multiple round-trips, and auth
  rejection for unauthenticated requests
- README.md: project overview, build instructions, and complete Phase 2
  server setup docs (4 start options, LAN setup, API reference, security)

Changed files:
- AndroidManifest.xml: added usesCleartextTraffic=true for HTTP in LAN

Closes #46
2026-05-14 21:45:33 +02:00
Jens Reinemann
215790d68e feat(app): add Ktor HTTP client and SyncService for inventory sync
domain/model/SyncError.kt:
- Sealed class with ConnectionError, Timeout, AuthError, ServerError,
  NotConfigured, Unknown subtypes for typed error handling

domain/repository/SyncService.kt:
- Interface with downloadInventory() and uploadInventory() returning
  Result<InventoryDto> for clean error propagation

data/sync/SyncServiceImpl.kt:
- Ktor Client implementation using OkHttp engine
- GET /api/inventory and PUT /api/inventory endpoints
- X-API-Key header authentication matching server contract
- Server URL and API key read from SettingsRepository
- withContext(Dispatchers.IO) for network calls
- Catches SocketTimeoutException, ConnectException specifically

di/NetworkModule.kt:
- Hilt module providing singleton HttpClient with OkHttp engine
- ContentNegotiation with kotlinx.serialization JSON
- Configurable connect/read/write timeouts (10s/30s/30s)
- Binds SyncServiceImpl to SyncService interface

Dependencies:
- ktor-client-core, ktor-client-okhttp,
  ktor-client-content-negotiation, ktor-client-mock (test)
- ktor-serialization-kotlinx-json (shared with server)
- INTERNET permission added to AndroidManifest.xml

Tests: 9 tests with Ktor MockEngine covering success, 401, 500,
missing config, trailing slash URL normalization

Closes #44
2026-05-14 21:14:40 +02:00
Jens Reinemann
8193445939 feat(settings): add JSON/Markdown export via Share Intent
Implement export functionality in the Settings screen allowing users to
share their inventory data as JSON (via FileProvider + ACTION_SEND with
EXTRA_STREAM) or Markdown (via ACTION_SEND with EXTRA_TEXT).

Key changes:
- ShareContent sealed interface for export events (Json with URI,
  Markdown with text)
- SettingsViewModel: exportJson() writes to cache file and creates
  FileProvider URI; exportMarkdown() provides text directly
- SettingsUiState: isExporting, shareContent, exportError fields
- SettingsScreen: LaunchedEffect consumes share events and opens
  Android Share Sheet via Intent.createChooser
- FileProvider registered in AndroidManifest with cache-path config
- MockK added as test dependency for FileProvider static mocking
- 8 new unit tests covering export success, failure, and state cleanup

Closes #37
2026-05-14 03:26:15 +02:00
Jens Reinemann
040f007cd5 feat: Android-Projekt-Gerüst anlegen (#13)
- Gradle Kotlin DSL (settings.gradle.kts, build.gradle.kts)
- Version Catalog (libs.versions.toml) mit Compose BOM, Hilt, Room,
  Navigation Compose, kotlinx.serialization
- App-Modul (app/build.gradle.kts), minSdk 26, compileSdk 35
- AndroidManifest.xml mit KrisenvorratApp + MainActivity
- KrisenvorratApp (@HiltAndroidApp)
- MainActivity (@AndroidEntryPoint, Jetpack Compose + Material3)
- KrisenvorratTheme (ui/theme/Theme.kt)
- MVVM-Paketstruktur: data/, domain/, presentation/, di/
- Adaptive Launcher-Icons (mipmap-anydpi-v26)
- Gradle Wrapper 8.11.1 (gradlew, gradlew.bat, gradle-wrapper.jar)
2026-05-13 15:24:39 +02:00