How nicosnicolaou16/pokedex_compose_xr works
Project Type & Purpose
• This is a single-module Android mobile application (app/) that serves as an XR-enabled Pokédex.
• Built with Jetpack Compose for UI, AndroidX XR for AR/VR functionality, MVVM + Repository for architecture, Hilt for DI, Retrofit for network, and Room for local persistence.
File Structure & Architectural Layers
• Top-level “app” module contains everything.
• Layer breakdown:
a. presentation/ – Compose screens, ViewModels, MainActivity
b. domain/ – repository interfaces, data models, network service interfaces, DI modules for network & error handling
c. data/ – repository implementations, mappers, Room database (entities, DAOs, database init, type converters), DI modules for database
e. utils/ – extensions, Resource & HandlingError wrappers, screen routing
Key Components
• UI Layer:
• MainActivity & Composable Screens (PokemonListScreen, PokemonDetailsScreen, GenericViews)
• Jetpack Compose & AndroidX XR UI sub-framework
• Presentation Layer:
• ViewModels (PokemonListViewModel, PokemonDetailsViewModel)
• UIState classes (loading, loaded, error)
• Domain Layer:
• Repository interfaces (PokemonListRepository, PokemonDetailsRepository)
• Network interfaces (PokemonService, MyNetworkManager)
• Models (PokemonResponse, PokemonDetailsDataModel, UI models)
• DI Modules (NetworkModules, PokemonModule, HandlingErrorModule)
• Data Layer:
• RepositoryImpl classes (PokemonListRepositoryImpl, PokemonDetailsRepositoryImpl)
• Mappers (PokemonDetailsMapper)
• Retrofit client & service bindings
• Room Database: MyRoomDatabase, Entities & DAOs
• TypeConverters
• DI Modules (MyRoomDatabaseModule)
• External Systems & Libraries:
• AndroidX XR Library (AR/VR runtime & UI extensions)
• Retrofit (HTTP client)
• Room (SQLite ORM)
• Coil (image loading)
• Hilt (DI)
• KSP (code generation)
• R8 (code shrinker)
Relationships & Data Flows
• UI → ViewModel: user events & state observers
• ViewModel → Repository interface (injected via Hilt)
• RepositoryImpl →
• Network path: Retrofit → PokemonService → maps JSON → domain models
• Cache path: Room DAOs → Entities ↔ domain models via mappers
• Domain models → ViewModels → UI models → Composables
• DI graph: Hilt modules wire MyNetworkManager & Retrofit service into repositories; MyRoomDatabaseModule provides DAOs.
• XR UI sub-system interacts with Compose UI components to render AR/VR objects.
Architectural Patterns & Principles
• MVVM + Repository: clear separation of UI, state-handling, domain logic, and data sources
• Dependency Injection (Hilt): loosely coupled modules
• Single Activity Compose with navigation between screens
• Offline support: Room local cache + network fetch
Essential Details to Capture
• Hilt DI graph connecting network & database to repositories
• Retrofit service endpoint (PokemonService) ↔ REST API
• Room database schema (Entities & DAOs)
• Flow of Pokémon data: remote fetch → map → cache → UI
• XR Compose integration point within UI layer