How lucasomac/pokedex works
Project Type and Purpose
• This is a multi-module Android application (“app” module) plus a standalone “attributes” library module.
• It implements a Pokédex client using Kotlin, Android SDK (Material Design), Clean Architecture layers (presentation, domain, data, framework), and consumes the external PokeAPI.
High-Level Architecture Overview
• App module: the executable Android application
• Presentation layer: Activities, Fragments, ViewModels, UI adapters, and navigation graph
• Domain layer: Entities, Repository interfaces, UseCase interfaces and implementations, paging source
• Data layer: Retrofit API definitions (PokemonApi), Response models, Repository implementations, DataSource interfaces
• Framework layer: DataSourceImpl, dependency-injection module (PokedexModule)
• Attributes module: reusable UI component library for displaying Pokémon attributes (cards, components)
Main Components and Their Relationships
• Presentation
• UI Components (Activity/Fragments) ←─ observes LiveData/State from → ViewModel
• ViewModel ── invokes → UseCase
• Domain
• UseCase ── depends on → Repository interface
• Repository interface ←─ implemented by → RepositoryImpl in Data layer
• Data
• RepositoryImpl ── delegates to → PokedexDataSource (interface)
• PokedexDataSourceImpl (Framework) ── calls → PokemonApi (Retrofit) → External PokeAPI
• PagingSource for infinite scroll in domain/data/source
• Models mapping: JSON response → domain Entities
• Framework/DI
• PokedexModule wires Retrofit, DataSourceImpl, RepositoryImpl, UseCaseImpl, ViewModels
• Attributes module
• Provides UI cards and components → consumed by app/ui
Architectural Patterns and Principles
• Clean Architecture: strict separation of layers; direction of dependency inward
• Dependency Injection: PokedexModule centralizes component wiring
• Repository pattern + DataSource abstraction for remote data
• Paging 3 for list pagination
• MVVM in Presentation: Fragments/Activities + ViewModels + LiveData/State