How chanubc/photos-lrucache works
Project type and purpose
• This is a single-module Android application (Kotlin, Jetpack Compose) whose primary purpose is to load, display, and cache images using an LRU-based two-level cache (memory + disk) before falling back to network download. It follows Google’s recommended Android App Architecture (MVI + MVVM, Repository pattern, Observer pattern).
File structure
• Top-level “app” module with standard Android Gradle layout.
• Under app/src/main/java/com/chanu/photocache: two main packages:
• core – contains common base classes (MVI constructs), data layer (cache, network, repository abstractions & DI), models, design system UI, navigation types
• feature – three feature packages (main/NavHost, home list screen, detail screen) holding Composables, ViewModels, intents/states, navigation
• DI modules under core/data/di and core/network/di using Hilt
• Cache layer under core/data/cache (MemoryCache, DiskCache, BitmapFetcher)
• Paging source under core/data/paging
• Network layer under core/network (Retrofit services, DTOs, modules)
• Compose UI under core/designsystem + feature/* screens
• Build scripts (Gradle Kotlin DSL), ProGuard rules, test folders
README for additional insights
• Confirms architectural decisions: MVI + MVVM, Repository + Observer patterns, layering (UI vs Data), Hilt DI, Paging3, Retrofit2+OkHttp, kotlinx-serialization, Timber logging
• Describes key flows (image load order: memory → disk → network) and custom behaviors (thumbnail, blur/grayscale, zoom, retry, error handling)