# skydoves/pokedex architecture

> Architecture diagram of the GitHub repository skydoves/pokedex, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/skydoves/pokedex
- Repository: https://github.com/skydoves/pokedex

## Overview

Pokedex is an Android Pokédex app: users browse a paged Pokémon list, open a Pokémon’s detail screen, and see information loaded from the API or served from local cache. The UI uses Activities and ViewModels; repositories coordinate network and Room data access, with domain models crossing those layers. The graph preserves the distinct list and detail paths. ViewModel and dependency-injection wiring is represented at the documented architectural level; their source was not sampled, so uncertain calls and navigation links are omitted.

Main entry points: [`core-data/src/main/kotlin/com/skydoves/pokedex/core/repository/MainRepositoryImpl.kt`](https://github.com/skydoves/pokedex/blob/main/core-data/src/main/kotlin/com/skydoves/pokedex/core/repository/MainRepositoryImpl.kt) (List repository), [`core-data/src/main/kotlin/com/skydoves/pokedex/core/repository/DetailRepositoryImpl.kt`](https://github.com/skydoves/pokedex/blob/main/core-data/src/main/kotlin/com/skydoves/pokedex/core/repository/DetailRepositoryImpl.kt) (Detail repository), [`app/src/main/kotlin/com/skydoves/pokedex/ui/main/MainActivity.kt`](https://github.com/skydoves/pokedex/blob/main/app/src/main/kotlin/com/skydoves/pokedex/ui/main/MainActivity.kt) (List screen), [`core-database/src/main/kotlin/com/skydoves/pokedex/core/database/PokemonDao.kt`](https://github.com/skydoves/pokedex/blob/main/core-database/src/main/kotlin/com/skydoves/pokedex/core/database/PokemonDao.kt) (List DAO)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["UI screens"]
  node_main_activity["List screen<br/>[MainActivity.kt]"]
  node_main_vm["List state<br/>[MainViewModel.kt]"]
  node_pokemon_adapter["List adapter<br/>[PokemonAdapter.kt]"]
  node_detail_activity["Detail screen<br/>[DetailActivity.kt]"]
  node_detail_vm["Detail state<br/>[DetailViewModel.kt]"]
end

subgraph group_data["Repository layer"]
  node_main_repository["List repository"]
  node_detail_repository["Detail repository"]
end

subgraph group_network["Network layer"]
  node_pokedex_client["API client<br/>[PokedexClient.kt]"]
  node_pokedex_service["REST service<br/>[PokedexService.kt]"]
end

subgraph group_storage["Local storage"]
  node_pokemon_dao["List DAO<br/>[PokemonDao.kt]"]
  node_pokemon_info_dao["Detail DAO<br/>[PokemonInfoDao.kt]"]
  node_room_db[("Room database<br/>[PokedexDatabase.kt]")]
  node_entity_mapper["Entity mapping<br/>[EntityMapper.kt]"]
end

node_user(("App user"))
node_pokemon_model["Pokémon models<br/>[Pokemon.kt]"]
node_pokemon_info_model["Detail model<br/>[PokemonInfo.kt]"]
node_remote_api{{"Pokémon API"}}

node_user -->|"opens app"| node_main_activity
node_main_activity -->|"binds state"| node_main_vm
node_main_activity -->|"binds list"| node_pokemon_adapter
node_detail_activity -->|"binds state"| node_detail_vm
node_main_vm -->|"requests pages"| node_main_repository
node_detail_vm -->|"requests details"| node_detail_repository
node_main_repository -->|"reads and writes"| node_pokemon_dao
node_main_repository -->|"fetches page"| node_pokedex_client
node_detail_repository -->|"reads and writes"| node_pokemon_info_dao
node_detail_repository -->|"fetches details"| node_pokedex_client
node_pokedex_client -->|"calls"| node_pokedex_service
node_pokedex_service -->|"requests data"| node_remote_api
node_pokemon_dao -->|"uses"| node_room_db
node_pokemon_info_dao -->|"uses"| node_room_db
node_main_repository -->|"emits list"| node_pokemon_model
node_detail_repository -->|"emits detail"| node_pokemon_info_model
node_pokemon_dao -->|"maps records"| node_entity_mapper
node_pokemon_info_dao -->|"maps records"| node_entity_mapper

click node_main_activity "https://github.com/skydoves/pokedex/blob/main/app/src/main/kotlin/com/skydoves/pokedex/ui/main/MainActivity.kt"
click node_main_vm "https://github.com/skydoves/pokedex/blob/main/app/src/main/kotlin/com/skydoves/pokedex/ui/main/MainViewModel.kt"
click node_pokemon_adapter "https://github.com/skydoves/pokedex/blob/main/app/src/main/kotlin/com/skydoves/pokedex/ui/main/PokemonAdapter.kt"
click node_detail_activity "https://github.com/skydoves/pokedex/blob/main/app/src/main/kotlin/com/skydoves/pokedex/ui/details/DetailActivity.kt"
click node_detail_vm "https://github.com/skydoves/pokedex/blob/main/app/src/main/kotlin/com/skydoves/pokedex/ui/details/DetailViewModel.kt"
click node_pokemon_model "https://github.com/skydoves/pokedex/blob/main/core-model/src/main/kotlin/com/skydoves/pokedex/core/model/Pokemon.kt"
click node_pokemon_info_model "https://github.com/skydoves/pokedex/blob/main/core-model/src/main/kotlin/com/skydoves/pokedex/core/model/PokemonInfo.kt"
click node_main_repository "https://github.com/skydoves/pokedex/blob/main/core-data/src/main/kotlin/com/skydoves/pokedex/core/repository/MainRepositoryImpl.kt"
click node_detail_repository "https://github.com/skydoves/pokedex/blob/main/core-data/src/main/kotlin/com/skydoves/pokedex/core/repository/DetailRepositoryImpl.kt"
click node_pokedex_client "https://github.com/skydoves/pokedex/blob/main/core-network/src/main/kotlin/com/skydoves/pokedex/core/network/service/PokedexClient.kt"
click node_pokedex_service "https://github.com/skydoves/pokedex/blob/main/core-network/src/main/kotlin/com/skydoves/pokedex/core/network/service/PokedexService.kt"
click node_pokemon_dao "https://github.com/skydoves/pokedex/blob/main/core-database/src/main/kotlin/com/skydoves/pokedex/core/database/PokemonDao.kt"
click node_pokemon_info_dao "https://github.com/skydoves/pokedex/blob/main/core-database/src/main/kotlin/com/skydoves/pokedex/core/database/PokemonInfoDao.kt"
click node_room_db "https://github.com/skydoves/pokedex/blob/main/core-database/src/main/kotlin/com/skydoves/pokedex/core/database/PokedexDatabase.kt"
click node_entity_mapper "https://github.com/skydoves/pokedex/blob/main/core-database/src/main/kotlin/com/skydoves/pokedex/core/database/entity/mapper/EntityMapper.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main_activity,node_main_vm,node_pokemon_adapter,node_detail_activity,node_detail_vm,node_user toneBlue
class node_main_repository,node_detail_repository toneAmber
class node_pokedex_client,node_pokedex_service,node_remote_api toneMint
class node_pokemon_dao,node_pokemon_info_dao,node_room_db,node_entity_mapper toneRose
class node_pokemon_model,node_pokemon_info_model toneIndigo
```

## Components

### UI screens

- [List screen](https://github.com/skydoves/pokedex/blob/main/app/src/main/kotlin/com/skydoves/pokedex/ui/main/MainActivity.kt): `app/src/main/kotlin/com/skydoves/pokedex/ui/main/MainActivity.kt`
- [List state](https://github.com/skydoves/pokedex/blob/main/app/src/main/kotlin/com/skydoves/pokedex/ui/main/MainViewModel.kt): `app/src/main/kotlin/com/skydoves/pokedex/ui/main/MainViewModel.kt`
- [List adapter](https://github.com/skydoves/pokedex/blob/main/app/src/main/kotlin/com/skydoves/pokedex/ui/main/PokemonAdapter.kt): `app/src/main/kotlin/com/skydoves/pokedex/ui/main/PokemonAdapter.kt`
- [Detail screen](https://github.com/skydoves/pokedex/blob/main/app/src/main/kotlin/com/skydoves/pokedex/ui/details/DetailActivity.kt): `app/src/main/kotlin/com/skydoves/pokedex/ui/details/DetailActivity.kt`
- [Detail state](https://github.com/skydoves/pokedex/blob/main/app/src/main/kotlin/com/skydoves/pokedex/ui/details/DetailViewModel.kt): `app/src/main/kotlin/com/skydoves/pokedex/ui/details/DetailViewModel.kt`

### Repository layer

- [List repository](https://github.com/skydoves/pokedex/blob/main/core-data/src/main/kotlin/com/skydoves/pokedex/core/repository/MainRepositoryImpl.kt): `core-data/src/main/kotlin/com/skydoves/pokedex/core/repository/MainRepositoryImpl.kt`
- [Detail repository](https://github.com/skydoves/pokedex/blob/main/core-data/src/main/kotlin/com/skydoves/pokedex/core/repository/DetailRepositoryImpl.kt): `core-data/src/main/kotlin/com/skydoves/pokedex/core/repository/DetailRepositoryImpl.kt`

### Network layer

- [API client](https://github.com/skydoves/pokedex/blob/main/core-network/src/main/kotlin/com/skydoves/pokedex/core/network/service/PokedexClient.kt): `core-network/src/main/kotlin/com/skydoves/pokedex/core/network/service/PokedexClient.kt`
- [REST service](https://github.com/skydoves/pokedex/blob/main/core-network/src/main/kotlin/com/skydoves/pokedex/core/network/service/PokedexService.kt): `core-network/src/main/kotlin/com/skydoves/pokedex/core/network/service/PokedexService.kt`

### Local storage

- [List DAO](https://github.com/skydoves/pokedex/blob/main/core-database/src/main/kotlin/com/skydoves/pokedex/core/database/PokemonDao.kt): `core-database/src/main/kotlin/com/skydoves/pokedex/core/database/PokemonDao.kt`
- [Detail DAO](https://github.com/skydoves/pokedex/blob/main/core-database/src/main/kotlin/com/skydoves/pokedex/core/database/PokemonInfoDao.kt): `core-database/src/main/kotlin/com/skydoves/pokedex/core/database/PokemonInfoDao.kt`
- [Room database](https://github.com/skydoves/pokedex/blob/main/core-database/src/main/kotlin/com/skydoves/pokedex/core/database/PokedexDatabase.kt): `core-database/src/main/kotlin/com/skydoves/pokedex/core/database/PokedexDatabase.kt`
- [Entity mapping](https://github.com/skydoves/pokedex/blob/main/core-database/src/main/kotlin/com/skydoves/pokedex/core/database/entity/mapper/EntityMapper.kt): `core-database/src/main/kotlin/com/skydoves/pokedex/core/database/entity/mapper/EntityMapper.kt`

### Other components

- **App user**
- [Pokémon models](https://github.com/skydoves/pokedex/blob/main/core-model/src/main/kotlin/com/skydoves/pokedex/core/model/Pokemon.kt): `core-model/src/main/kotlin/com/skydoves/pokedex/core/model/Pokemon.kt`
- [Detail model](https://github.com/skydoves/pokedex/blob/main/core-model/src/main/kotlin/com/skydoves/pokedex/core/model/PokemonInfo.kt): `core-model/src/main/kotlin/com/skydoves/pokedex/core/model/PokemonInfo.kt`
- **Pokémon API**

## Connections

- App user → List screen: opens app
- List screen → List state: binds state
- List screen → List adapter: binds list
- Detail screen → Detail state: binds state
- List state → List repository: requests pages
- Detail state → Detail repository: requests details
- List repository → List DAO: reads and writes
- List repository → API client: fetches page
- Detail repository → Detail DAO: reads and writes
- Detail repository → API client: fetches details
- API client → REST service: calls
- REST service → Pokémon API: requests data
- List DAO → Room database: uses
- Detail DAO → Room database: uses
- List repository → Pokémon models: emits list
- Detail repository → Detail model: emits detail
- List DAO → Entity mapping: maps records
- Detail DAO → Entity mapping: maps records
