How nyangzzi/withconimal works
Project type and purpose
• This is a Kotlin‐based Android mobile application (“With Conimal”) that uses Jetpack Compose for UI, implements an MVVM/domain‐driven architecture, persists favorite animals locally via Room, and retrieves animal adoption data from the “국가동물보호정보시스템 구조동물 조회 서비스” public API.
File structure
• Top‐level: build and Gradle files, /app module.
• Under app/src/main/java/com/nyangzzi/withconimal:
• data layer (DAO, database, network adapters, repository implementations, DI modules)
• domain layer (models, repository interfaces, use-cases)
• presentation layer (ViewModels, UI Composable screens and components, navigation graph)
• Testing folders: unit tests and instrumentation tests.
• Resources: Drawables, layout‐agnostic XML, strings, themes.
README for additional insights
• Confirms use of Kotlin 1.9, minSdk 28, targetSdk 34, JVM 17.
• Relies on an external REST API (public data portal) with an API key.
• Core feature: list and detail screens for adoptable animals, plus favorites management.
Main components and their interactions
a. Presentation Layer
• Composable UI screens and components
• FeedViewModel, FavoriteViewModel, etc.
• Navigation (NavGraph)
b. Domain Layer
• Use-cases (SearchAnimalUseCase, AddFavoriteAnimalUseCase, etc.)
• Business models (network models, DB models, common domain models)
c. Data Layer
• Network: Retrofit service (SearchAnimalService, custom ResultCallAdapterFactory)
• Local DB: Room (FavoriteAnimalDatabase, FavoriteAnimalDao)
• Repository implementations (NetworkRepositoryImpl, DataBaseRepositoryImpl)
• DI Modules (DataBaseModule, RepositoryProvideModule)
d. External Services
• Public REST API (data.go.kr)
e. Local Persistence
• SQLite via Room
Data flow:
UI event → ViewModel → UseCase → Repository → either Remote API or Local DB → returns data to UseCase → ViewModel → UI.
Architectural patterns and design principles
• MVVM: clear separation between UI, state management (ViewModel), and business logic (Use-Cases).
• Clean Architecture: layers (presentation, domain, data) with dependency inversion (domain interfaces implemented in data).
• Dependency Injection: Hilt or Dagger modules for repositories and DB.
• Repository Pattern: abstracts data sources.
• Paging (Compose PagingSource for feed).
Essential details to capture
• Entry points (MainActivity → NavGraph)
• ViewModels’ connection to Compose UI
• Use-Case orchestration
• Repository switching between network and local cache
• Retrofit adapters and Room DAOs
• API key injection and error‐wrapping (ResultWrapper)