How ayito/popis-alerta works
Purpose and Current Scope
Popis Alerta is an Android app intended to support non-invasive in-home monitoring using a dedicated phone near a critical room. The implemented code is an early technical foundation: a Compose UI, navigation, local access-event persistence, and initial tests. Sensor detection, event history presentation, report sharing, and alerts are explicitly future work.
Runtime and Entry Points
The app is a Kotlin Android application built with Gradle, requiring JDK 21 and Android SDK Platform 36. Android launches the activity declared in app/src/main/AndroidManifest.xml; app/src/main/java/org/popisalerta/app/MainActivity.kt hosts the Compose application. Module and dependency boundaries are defined by app/build.gradle.kts and root build.gradle.kts.
Application Composition and Navigation
app/src/main/java/org/popisalerta/app/MainActivity.kt establishes the top-level Compose runtime and theme. app/src/main/java/org/popisalerta/app/Navigation.kt defines screen routing, while app/src/main/java/org/popisalerta/app/NavigationKeys.kt centralizes route identifiers. This is the principal UI control-flow boundary: activity startup leads into navigation, which selects composable screens.
Main Screen State Layer
The currently implemented feature surface is the main screen:
• app/src/main/java/org/popisalerta/app/ui/main/MainScreen.kt
• app/src/main/java/org/popisalerta/app/ui/main/MainScreenViewModel.kt
The ViewModel owns UI-facing state and coordinates user actions with persistence-oriented dependencies. The screen renders that state through Jetpack Compose rather than XML layouts, separating presentation from state/control logic.
Local Access Event Persistence
Access events are modeled and stored locally through a Room-style data stack:
• app/src/main/java/org/popisalerta/app/data/local/AccessEntity.kt
• app/src/main/java/org/popisalerta/app/data/local/AccessDao.kt
• app/src/main/java/org/popisalerta/app/data/local/AccessDatabase.kt
AccessEntity is the storage representation, AccessDao is the database access boundary, and AccessDatabase owns local database configuration. No network service or remote backend is represented in the repository.
Repository and Logging Boundary
app/src/main/java/org/popisalerta/app/data/DataRepository.kt abstracts data operations above the DAO/database layer. app/src/main/java/org/popisalerta/app/data/AccessRepositoryProvider.kt supplies repository access to higher layers. app/src/main/java/org/popisalerta/app/AppAccessLogger.kt is the app-level event logging entry point, likely intended to be called by future sensor-monitoring code before data reaches the repository/database.
The expected future flow is: native sensor input → access-event interpretation → AppAccessLogger/repository → Room persistence → ViewModel → Compose UI. Sensor integration is not yet present.
Important Future Integration Boundaries
Native Android sensors (light, motion, and experimental audio), Android’s native share sheet, and alerting mechanisms are product goals but have no implementation paths in the current tree. Their likely architectural insertion point is upstream of AppAccessLogger.kt; persisted records would remain behind DataRepository.kt, preserving the UI from direct sensor or storage coupling.
UI System and Validation
The visual system is centralized in app/src/main/java/org/popisalerta/app/theme/Theme.kt with related color/type definitions. Unit and instrumentation coverage target the major boundaries: logging, ViewModel/UI state, repository behavior, and activity rendering. Tests exist under app/src/test and app/src/androidTest, indicating both JVM and device/emulator execution paths.
Main entry points: DataRepository.kt Data repository · MainActivity.kt Main activity · Navigation.kt Navigation · AndroidManifest.xml App manifest
Components 16
Android runtime
- Android OS
- App manifest
app/src/main/AndroidManifest.xml - Main activity
app/src/main/java/org/popisalerta/app/MainActivity.kt
Compose UI
- Navigation
app/src/main/java/org/popisalerta/app/Navigation.kt - Navigation keys
app/src/main/java/org/popisalerta/app/NavigationKeys.kt - App theme
app/src/main/java/org/popisalerta/app/theme/Theme.kt - Main screen
app/src/main/java/org/popisalerta/app/ui/main/MainScreen.kt - Main screen ViewModel
app/src/main/java/org/popisalerta/app/ui/main/MainScreenViewModel.kt
Local data
- App access logger · Intended insertion point for access-event producers.
app/src/main/java/org/popisalerta/app/AppAccessLogger.kt - Repository provider
app/src/main/java/org/popisalerta/app/data/AccessRepositoryProvider.kt - Data repository
app/src/main/java/org/popisalerta/app/data/DataRepository.kt - Access DAO
app/src/main/java/org/popisalerta/app/data/local/AccessDao.kt - Access database
app/src/main/java/org/popisalerta/app/data/local/AccessDatabase.kt - Access entity
app/src/main/java/org/popisalerta/app/data/local/AccessEntity.kt
Future integrations
Planned boundaries without current implementation.
- Native sensor input · Light, motion, and experimental audio detection are not implemented.
- Sharing and alerts · Report sharing and alerts are not implemented.
Connections 15
- Android OS → App manifest: launches
- App manifest → Main activity: declares
- Main activity → App theme: applies
- Main activity → Navigation: hosts
- Navigation → Navigation keys: uses
- Navigation → Main screen: routes to
- Main screen → Main screen ViewModel: renders state and actions
- Main screen ViewModel → Repository provider: obtains repository
- Repository provider → Data repository: supplies
- App access logger → Data repository: records events
- Data repository → Access DAO: persists and reads
- Access DAO → Access database: accesses
- Access database → Access entity: stores
- Native sensor input → App access logger: future access events
- Data repository → Sharing and alerts: future persisted records