How vishnu32510/whosthatdog works
And List the Main Components
• User Interface (UI) Layer: This is built using Jetpack Compose. It includes:
• MainActivity and various screens (HomeScreen, BreedsScreen, BreedsImagesScreen, LoginScreen, SignupScreen).
• Composable UI components (e.g., BottomNavigationBar, CustomTextField, HeaderText, LoadingErrorPage, ShowImage, etc.).
• Theme and styling files (under the “ui/theme” directory).
• ViewModel Layer: Contains ViewModels (HomeViewModel, BreedsViewModel, BreedImagesViewModel) that hold UI state and manage business logic.
• Model Layer: Represents data models (BreedImagesModel, BreedsListModel, RandomImageModel) which mirror the JSON responses from the API.
• Service/Networking Layer: Implements networking using Retrofit. Key files include ApiServices.kt and RetrofitClient.kt.
• Utility and Helpers: Includes utility functions (like StringExtentions.kt) aiding operations across the application.
Relationships and Data Flow
• UI Layer interacts with the ViewModel:
• User actions in composables trigger functions in the ViewModel.
• The ViewModel holds state using StateFlow and interacts with the repository/services.
• ViewModels request data using the Networking Layer:
• They call methods in ApiServices (which use Retrofit for network calls).
• Data models are used to represent and store this fetched information.
• Network data flows back into the ViewModel:
• Processed asynchronously using Coroutines and Flow.
• UI components observe state changes and update accordingly.
• The application’s resource files and theme settings dictate brand look and feel.
Architectural Patterns and Design Principles
• MVVM Architecture: Separates concerns between UI (composables), ViewModels (state and business logic), and data/model layers.
• Asynchronous Data Handling: Utilizes Coroutines and Flow to handle network calls and UI updates.
• Separation of Concerns: Each layer has a clear responsibility from data fetching to UI presentation.
• Modularization: The directory structure clearly separates endpoints (like services, ui, viewmodel, models, etc.) making the system highly maintainable.
Relevant Technologies and Frameworks
• Language: Kotlin
• UI Framework: Jetpack Compose, with Composable components (LazyColumn, Material Design elements, etc.).
• Networking: Retrofit (with Gson for JSON processing)
• Asynchronous Processing: Kotlin Coroutines and Flow
• Architectural Pattern: MVVM
• Additional: Material 3 design, custom themes, and resources for the Android ecosystem.