How ideepaknishadd/passwordmanager works
Project Type and Purpose
• Mobile application (Android) for secure local password storage and management.
• Built with Jetpack Compose (UI) & Kotlin, follows MVVM (Model-View-ViewModel) pattern.
File Structure
• Top-level module: app (Gradle/Kotlin DSL).
• src/main/java/com/deepaknishad/passwordmanager broken into sub-packages:
• ui (Compose screens & theme)
• viewmodel (PasswordViewModel)
• data (Room: Entity, DAO, Database)
• model (data classes)
• util (EncryptionUtil, PasswordGenerator, PasswordStrengthMeter)
• res folder with Compose assets (drawable, xml, values).
• androidTest & test packages for instrumentation and unit tests.
• Configuration: AndroidManifest.xml, ProGuard rules, backup/data extraction XML, Gradle scripts.
README for Insights
• Architecture: MVVM, Kotlin Coroutines & Flow for reactive updates.
• Security: AES encryption via Android Keystore, Biometric & device-credential authentication.
• Local storage: Room DB for credentials, DataStore or xml rules for backup.
• UI: Jetpack Compose bottom sheets for add/edit/delete dialogs, strength meter, toggle visibility, password generator.
Main Components & Their Interactions
a. Presentation Layer
• Compose Screens (Home, Add/Edit, Details, Delete dialogs)
• Theme & UI toolkit
• Biometric prompt (via AndroidX Biometric API)
b. ViewModel Layer
• PasswordViewModel orchestrates UI state
• Exposes StateFlow/LiveData of password list, selected item, authentication state
• Receives UI events (add/edit/delete, visibility toggle)
c. Data Layer
• Repository abstraction (could be implicit inside ViewModel)
• Room Database (PasswordDatabase)
• DAO (PasswordDao) for CRUD operations
• Entities (PasswordEntity) ↔ Domain models (Password)
d. Security & Utilities
• EncryptionUtil: encrypts/decrypts using Android Keystore
• PasswordGenerator: creates random passwords
• PasswordStrengthMeter: rates password strength
e. External Services
• Android Keystore (system service)
• Android Biometric & device-credential authentication
• OS file storage & Backup mechanisms (via xml rules)
Architectural Patterns & Principles
• MVVM: clear separation of UI, state management (ViewModel), and data persistence.
• Single Source of Truth: Room DB holds credential records.
• Reactive UI Updates: coroutines + Flow to push DB changes to Compose.
• Dependency Flow: UI → ViewModel → Data/Utils → External services.