How imashnake0/animite works
Main Components
• App Container: Represent the main Android app module. This is where AnimiteApplication and the primary views (Activity/Fragment using Jetpack Compose) reside.
• Feature Modules: Include separate modules for Home, Media, Navigation, Profile, and Social. Each encapsulates its own UI screens (using Compose) and dedicated ViewModels following MVVM.
• API Integration Modules:
– Anilist API module: Contains GraphQL queries, repositories (e.g., AnilistMediaRepository, AnilistSearchRepository, and User repository) and custom data sanitation logic.
– MAL API module: Contains repositories and models that handle MyAnimeList API interactions.
– Preferences module: Manages user settings and app preferences via DataStore.
• Core Module: Contains common extensions, UI components (like progress indicators, layouts, shaders), constants, and helper functions.
• Dependency Injection: The modules are wired together using Hilt for DI, as seen from the Hilt-based components (e.g., AnilistApiModule and the NetworkModule in the MAL module).
Relationships and Data Flow
• The UI Layer (in the app and feature modules) interacts with ViewModels that apply MVVM.
• ViewModels interact with repository classes housed in the API modules (AniList, MAL, Preferences) to fetch or mutate data.
• The API modules directly handle network requests using Apollo Kotlin (for GraphQL) and standard HTTP libraries, with data sanitized and mapped to domain models.
• The Core module provides shared utilities and UI components accessible across both the feature and API modules.
• Dependency injection via Hilt connects these layers – UI components get ViewModel instances, which in turn depend on the respective repositories.
Architectural Patterns & Technologies
• MVVM is central. Clearly demarcate the View (Compose UI), ViewModel, and Model (repositories, data models from API modules) components.
• Modern Android development practices such as Jetpack Compose for dynamic UI rendering, Kotlin Coroutines for asynchronous operations, and Hilt for dependency injection should be highlighted.
• Use of Apollo Kotlin for GraphQL queries in the AniList API module, indicating that network communication and data retrieval follow a GraphQL-based strategy.