How vitorpamplona/amethyst works
Main Architectural Components
• User Interface Layer: Represent the Amethyst app’s UI built using Jetpack Compose along with Android Activity/Fragment components.
• Repository/Model Layer: Show components that store and manage “Notes” (events) and “User” objects in an in-memory persistent repository. These classes also use observable patterns to update viewmodels as events come in.
• Service/Network Layer: Illustrate the service layer responsible for assembling Nostr filters, keeping persistent connections to Nostr relays, and transferring events from the network to the repository.
• Key Management/Security: Include the component that interacts with the Android KeyStore to securely store the user’s private and public keys.
• Additional Modules: Optionally represent “ammolite” (for relay management and possibly a lighter client component), “commons” (for shared utilities), and “benchmark” (for performance testing) as supplementary blocks which interact with the overall system.
Relationships and Communication
• Optionally, connect “ammolite” with the network/relay stack to indicate its role in relay communications.
Architectural Patterns and Design Principles
• Separation of concerns by grouping components into boundaries such as UI, Domain/Repository, and Network/Service.
• MVVM/reactive data flow by showing how ViewModels subscribe to updates from the Repository.
Key Technologies/Frameworks
• That the platform is Android running on Java 17+ and Kotlin.
• Use of LiveData/Flow for reactive state updates.
• Integration with Android KeyStore for secure key management.
• Mention of Gradle as the build and dependency management system.