How shawn120/planen-android works
Main Components
• User Interface (UI) Layer:
• MainActivity and its associated fragments (Today, Month, Profile, AddPlan, GoogleCalendar) and dialogs.
• XML layouts, menus, and resource files.
• ViewModel Layer:
• ViewModel classes (e.g., MonthViewModel, ProfileViewModel, TaskViewModel) that support the MVVM architecture.
• Data Layer:
• Local database operations are defined in classes like AppDatabase, TaskItemDao, and various repository classes (e.g., HolidayRepository, TaskItemLocalRepository).
• Network/Service Layer:
• API integration components that handle external data, such as HolidayService for Nager public holiday API and OAuthService / GoogleTokenResponse for Google sign-in.
• Utility Components:
• Helper classes like Constants, CoroutinesExtension, and definitions for TaskType.
• Build/Configuration/Deployment:
• Gradle build files (build.gradle.kts, gradle.properties, settings.gradle.kts) and configuration files (credentials.json, proguard rules).
Depicting Relationships & Interactions
• UI components to the corresponding ViewModels (e.g., TodayFragment connects to TaskViewModel, MonthFragment connects to MonthViewModel).
• The ViewModels communicate with Repository components that encapsulate data-fetching logic.
• The Repository layer accesses the local database via DAOs (e.g., TaskItemDao) and also interfaces with the external API services (e.g., HolidayService, OAuthService).
• Where initialization happens (loading holidays on app startup) and how the OAuth sign-in integrates directly with the UI (ProfileFragment) via the network layer.
• Build and deployment nodes like Gradle and configurations which underlie the entire app.
Architectural Patterns & Design Principles
• MVVM Pattern: Clearly separate UI (activities/fragments), business logic (ViewModels), and data (repositories, database, external APIs).
• Modularity: The clearly segmented folders for UI, data, and util indicate an architecture favoring separation of concerns.
• Local Persistence: Emphasize the use of an SQLite database (through Room, inferred by AppDatabase and DAOs) for offline data storage.
• External API Integration: Clearly show dependency edges from the data repositories to external API services such as for holiday data and OAuth.