~/projects-hub/projects/prima-focus
Active
Prima Focus icon
ProductivityMobileAndroidDesktop
Kotlin MultiplatformJetpack ComposeJetpack GlanceRoom Database v6HMAC-SHA256 LAN ProtocolP2P Nearby Connections

Prima Focus

Local-first cross-platform application (native Android and Java desktop companion) focused on productivity through a predictive priority system, Jetpack Glance widgets, and P2P/LAN sync.

The Problem

Analysis paralysis and lack of focus when facing long, overwhelming to-do lists, plus the friction of needing to open the app just to view or complete priority tasks.

The Solution

A local-first productivity suite (native Android and desktop companion) featuring authenticated LAN sync with HMAC-SHA256 and PIN hashing, Room Database v6, predictive 'Today Task' scoring, Glance widgets, and clock-drift resilient LWW resolution.

Key Learnings

  • Cryptographic LAN Synchronization: Embedded HTTP desktop sync server (port 8765) with 6-digit PIN hashing, per-request HMAC-SHA256 payload signatures, and brute-force mitigation.
  • Room Database v6 Persistence & Clock Drift: Migration to Room v6 with automated 30-day tombstone garbage collection and clock-drift resilient LWW conflict resolution.
  • Modular Kotlin Multiplatform Architecture: Shared domain core (:shared) across native Android and desktop companion with non-regressive task completion.
  • Interactive Android Widgets: Home screen widgets built with Jetpack Glance supporting dynamic sizing and 1-tap task completion from the launcher.

Modular KMP Architecture & Room v6 Persistence

Prima Focus is a local-first cross-platform productivity suite built with strict architectural boundaries:

  • Shared Domain Core KMP (:shared): Pure Kotlin domain module encapsulating predictive priority scoring and deterministic Last-Write-Wins (LWW) conflict resolution resilient to device clock drift.
  • Native Android (:app) & Room v6: Declarative Jetpack Compose UI with adaptive tablet layouts and relational persistence in Room v6 supporting soft-delete tombstones and automated 30-day cleanup.

Cryptographic LAN/P2P Sync & Glance Widgets

  • HMAC-SHA256 Authenticated LAN Sync: Local network synchronization between mobile and desktop companion (DesktopSyncServer, port 8765) secured via 6-digit pairing PIN and per-request cryptographic HMAC signatures.
  • Jetpack Glance Widgets & Nearby P2P: Interactive home screen widgets for instantaneous task completion and host/client mode selection for offline P2P sync via Google Nearby Connections.

Note: The full source code, multi-module KMP architecture, and official release packages are publicly available in the main repository under a Source-Available license.