How dinesh2811/mynotes works
Main Architectural Layers
• User Interface (UI) Layer: This includes all the Android activities (MainActivity, AddNote, EditNote) along with various layouts, XML drawable resources, and UI components (NavigationDrawer, ToolbarMain, FancySnackbar, etc.).
• Presentation and Business Logic Layer: This is mainly represented by the ViewModel (NotesViewModel) and related helper classes in the “app” package, making use of LiveData and Coroutines for state management and asynchronous operations.
• Data Persistence Layer: The Room Database components (NotesDatabase, NotesDao, Note model, LocalDateTimeConverter) handle local data storage. This layer also underpins the backup/restore functionality mentioned in the README.
• External Services/Utilities: Components for AES 256-bit encryption, backup services, and integrations with external libraries (e.g., Gson for JSON handling, ZXing for QR code features) should be represented here.
Deciding on Component Details and Interactions
• Presentation Layer: Show the ViewModel (NotesViewModel) and any associated components (like LiveData and Coroutine support) that handle user events and coordinate with the data layer.
• Data Layer: Illustrate the Room Database with its DAO (NotesDao) and data models (Note, converters). Emphasize the data flow from Room to the ViewModel.
• Backup/Encryption Module: Given the emphasis on AES 256-bit encryption for backups, include a separate component or module (possibly part of the app package as a helper or utility class) dedicated to encryption, backup, and restore processes.
• Third-Party Libraries: Although these may not have dedicated modules in the file tree, include them as external dependencies (e.g., Gson for JSON, ZXing for QR code scanning) that interact with the overall system at relevant points.
Architectural Patterns and Design Principles
• MVVM Pattern: Since the project leverages ViewModel and LiveData, denote the separation between view (activities and layouts), view model (NotesViewModel), and model (Room Database, encryption components).
• Decoupling and Asynchronous Data Handling: Highlight the use of Coroutines that ensure the UI stays responsive while handling data operations (especially during database queries or backup encryption tasks).