# darrenmlouw/pokemon-browser architecture

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

- Interactive diagram: https://gitdiagram.com/darrenmlouw/pokemon-browser
- Repository: https://github.com/darrenmlouw/pokemon-browser

## Overview

Pokemon Browser is a WPF/MVVM desktop app for browsing the first 151 Pokémon, filtering the list, and viewing selected Pokémon details. Startup configures services and opens the window; the main view model loads and filters the list, requests details on selection, and coordinates cached sprite/artwork loading. Separate branches cover theme selection and persisted preferences. The README documents the UI capabilities; sampled excerpts show the service, startup, theme, and view-model relationships, while some bindings and image-loader internals were not sampled.

Main entry points: [`src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs`](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs) (PokeAPI service), [`src/PokemonBrowser.Presentation.Wpf/ViewModels/MainViewModel.cs`](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/ViewModels/MainViewModel.cs) (Browser view model), [`src/PokemonBrowser.Application/Services/IPokemonService.cs`](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Application/Services/IPokemonService.cs) (Pokemon service contract), [`src/PokemonBrowser.Presentation.Wpf/Services/ThemeService.cs`](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/ThemeService.cs) (Theme service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["WPF presentation"]
  node_startup["App startup<br/>[App.xaml.cs]"]
  node_window["Main window<br/>[MainWindow.xaml]"]
  node_mainvm["Browser view model<br/>[MainViewModel.cs]"]
  node_listvm["List item model"]
  node_detailsvm["Details view model"]
  node_observable["Observable base"]
end

subgraph group_application["Application and domain"]
  node_pokemonservice["Pokemon service contract<br/>[IPokemonService.cs]"]
  node_serviceerror["Service errors"]
  node_summary["Pokemon summary<br/>[PokemonSummary.cs]"]
  node_details["Pokemon details<br/>[PokemonDetails.cs]"]
  node_stat["Base stat<br/>[PokemonStat.cs]"]
end

subgraph group_integration["PokeAPI integration"]
  node_di["Infrastructure registration"]
  node_poke["PokeAPI service"]
  node_listdto["List response DTO"]
  node_detailsdto["Details response DTO"]
end

subgraph group_appearance["Theme and images"]
  node_themeinterface["Theme contract<br/>[IThemeService.cs]"]
  node_theme["Theme service<br/>[ThemeService.cs]"]
  node_themeenum["Theme choice<br/>[AppTheme.cs]"]
  node_settings["Theme settings store"]
  node_spriteinterface["Image loader contract"]
  node_sprite["Cached image loader"]
end

node_user(("Desktop user"))
node_api{{"PokeAPI"}}

node_user -.->|"uses"| node_window
node_startup -->|"registers"| node_di
node_startup -->|"initializes"| node_theme
node_startup -->|"opens"| node_window
node_window -.->|"binds"| node_mainvm
node_mainvm -->|"requests list and details"| node_pokemonservice
node_mainvm -->|"creates"| node_listvm
node_mainvm -->|"creates"| node_detailsvm
node_mainvm -->|"loads artwork"| node_spriteinterface
node_mainvm -->|"applies theme"| node_themeinterface
node_mainvm -->|"inherits"| node_observable
node_listvm -->|"inherits"| node_observable
node_detailsvm -->|"inherits"| node_observable
node_pokemonservice -->|"returns"| node_summary
node_pokemonservice -->|"returns"| node_details
node_details -->|"contains"| node_stat
node_di -->|"registers implementation"| node_poke
node_poke -->|"implements"| node_pokemonservice
node_poke -->|"requests list and details"| node_api
node_poke -->|"parses list"| node_listdto
node_poke -->|"parses details"| node_detailsdto
node_poke -->|"raises"| node_serviceerror
node_poke -->|"maps list entries"| node_summary
node_poke -->|"maps details"| node_details
node_poke -->|"maps stats"| node_stat
node_themeinterface -->|"implemented by"| node_theme
node_theme -->|"loads and saves"| node_settings
node_theme -->|"selects"| node_themeenum
node_di -->|"registers"| node_sprite
node_sprite -->|"implements"| node_spriteinterface

click node_startup "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/App.xaml.cs"
click node_window "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/MainWindow.xaml"
click node_mainvm "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/ViewModels/MainViewModel.cs"
click node_listvm "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/ViewModels/PokemonListItemViewModel.cs"
click node_detailsvm "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/ViewModels/PokemonDetailsViewModel.cs"
click node_observable "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Mvvm/ObservableObject.cs"
click node_pokemonservice "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Application/Services/IPokemonService.cs"
click node_serviceerror "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Application/Services/PokemonServiceException.cs"
click node_summary "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Domain/Models/PokemonSummary.cs"
click node_details "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Domain/Models/PokemonDetails.cs"
click node_stat "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Domain/Models/PokemonStat.cs"
click node_di "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Infrastructure/DependencyInjection.cs"
click node_poke "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs"
click node_listdto "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Infrastructure/Dto/PokemonListResponseDto.cs"
click node_detailsdto "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Infrastructure/Dto/PokemonDetailsDto.cs"
click node_themeinterface "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/IThemeService.cs"
click node_theme "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/ThemeService.cs"
click node_themeenum "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/AppTheme.cs"
click node_settings "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/ThemeSettingsStore.cs"
click node_spriteinterface "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/ISpriteImageLoader.cs"
click node_sprite "https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/SpriteImageLoader.cs"

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_startup,node_window,node_mainvm,node_listvm,node_detailsvm,node_observable,node_user toneBlue
class node_pokemonservice,node_serviceerror,node_summary,node_details,node_stat toneAmber
class node_di,node_poke,node_listdto,node_detailsdto,node_api toneMint
class node_themeinterface,node_theme,node_themeenum,node_settings,node_spriteinterface,node_sprite toneRose
```

## Components

### WPF presentation

- [App startup](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/App.xaml.cs): `src/PokemonBrowser.Presentation.Wpf/App.xaml.cs`
- [Main window](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/MainWindow.xaml): `src/PokemonBrowser.Presentation.Wpf/MainWindow.xaml`
- [Browser view model](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/ViewModels/MainViewModel.cs): `src/PokemonBrowser.Presentation.Wpf/ViewModels/MainViewModel.cs`
- [List item model](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/ViewModels/PokemonListItemViewModel.cs): `src/PokemonBrowser.Presentation.Wpf/ViewModels/PokemonListItemViewModel.cs`
- [Details view model](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/ViewModels/PokemonDetailsViewModel.cs): `src/PokemonBrowser.Presentation.Wpf/ViewModels/PokemonDetailsViewModel.cs`
- [Observable base](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Mvvm/ObservableObject.cs): `src/PokemonBrowser.Presentation.Wpf/Mvvm/ObservableObject.cs`

### Application and domain

- [Pokemon service contract](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Application/Services/IPokemonService.cs): `src/PokemonBrowser.Application/Services/IPokemonService.cs`
- [Service errors](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Application/Services/PokemonServiceException.cs): `src/PokemonBrowser.Application/Services/PokemonServiceException.cs`
- [Pokemon summary](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Domain/Models/PokemonSummary.cs): `src/PokemonBrowser.Domain/Models/PokemonSummary.cs`
- [Pokemon details](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Domain/Models/PokemonDetails.cs): `src/PokemonBrowser.Domain/Models/PokemonDetails.cs`
- [Base stat](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Domain/Models/PokemonStat.cs): `src/PokemonBrowser.Domain/Models/PokemonStat.cs`

### PokeAPI integration

- [Infrastructure registration](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Infrastructure/DependencyInjection.cs): `src/PokemonBrowser.Infrastructure/DependencyInjection.cs`
- [PokeAPI service](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs): `src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs`
- [List response DTO](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Infrastructure/Dto/PokemonListResponseDto.cs): `src/PokemonBrowser.Infrastructure/Dto/PokemonListResponseDto.cs`
- [Details response DTO](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Infrastructure/Dto/PokemonDetailsDto.cs): `src/PokemonBrowser.Infrastructure/Dto/PokemonDetailsDto.cs`

### Theme and images

- [Theme contract](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/IThemeService.cs): `src/PokemonBrowser.Presentation.Wpf/Services/IThemeService.cs`
- [Theme service](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/ThemeService.cs): `src/PokemonBrowser.Presentation.Wpf/Services/ThemeService.cs`
- [Theme choice](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/AppTheme.cs): `src/PokemonBrowser.Presentation.Wpf/Services/AppTheme.cs`
- [Theme settings store](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/ThemeSettingsStore.cs): `src/PokemonBrowser.Presentation.Wpf/Services/ThemeSettingsStore.cs`
- [Image loader contract](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/ISpriteImageLoader.cs): `src/PokemonBrowser.Presentation.Wpf/Services/ISpriteImageLoader.cs`
- [Cached image loader](https://github.com/darrenmlouw/pokemon-browser/blob/master/src/PokemonBrowser.Presentation.Wpf/Services/SpriteImageLoader.cs): `src/PokemonBrowser.Presentation.Wpf/Services/SpriteImageLoader.cs`

### Other components

- **Desktop user**
- **PokeAPI**

## Connections

- Desktop user → Main window: uses (evidence: `README.md`)
- App startup → Infrastructure registration: registers (evidence: `src/PokemonBrowser.Presentation.Wpf/App.xaml.cs`)
- App startup → Theme service: initializes (evidence: `src/PokemonBrowser.Presentation.Wpf/App.xaml.cs`)
- App startup → Main window: opens (evidence: `src/PokemonBrowser.Presentation.Wpf/App.xaml.cs`)
- Main window → Browser view model: binds (evidence: `README.md`)
- Browser view model → Pokemon service contract: requests list and details (evidence: `src/PokemonBrowser.Presentation.Wpf/ViewModels/MainViewModel.cs`)
- Browser view model → List item model: creates (evidence: `src/PokemonBrowser.Presentation.Wpf/ViewModels/MainViewModel.cs`)
- Browser view model → Details view model: creates (evidence: `src/PokemonBrowser.Presentation.Wpf/ViewModels/MainViewModel.cs`)
- Browser view model → Image loader contract: loads artwork (evidence: `src/PokemonBrowser.Presentation.Wpf/ViewModels/MainViewModel.cs`)
- Browser view model → Theme contract: applies theme (evidence: `src/PokemonBrowser.Presentation.Wpf/ViewModels/MainViewModel.cs`)
- Browser view model → Observable base: inherits (evidence: `src/PokemonBrowser.Presentation.Wpf/ViewModels/MainViewModel.cs`)
- List item model → Observable base: inherits (evidence: `src/PokemonBrowser.Presentation.Wpf/ViewModels/PokemonListItemViewModel.cs`)
- Details view model → Observable base: inherits (evidence: `src/PokemonBrowser.Presentation.Wpf/ViewModels/PokemonDetailsViewModel.cs`)
- Pokemon service contract → Pokemon summary: returns (evidence: `src/PokemonBrowser.Application/Services/IPokemonService.cs`)
- Pokemon service contract → Pokemon details: returns (evidence: `src/PokemonBrowser.Application/Services/IPokemonService.cs`)
- Pokemon details → Base stat: contains (evidence: `src/PokemonBrowser.Domain/Models/PokemonDetails.cs`)
- Infrastructure registration → PokeAPI service: registers implementation (evidence: `src/PokemonBrowser.Infrastructure/DependencyInjection.cs`)
- PokeAPI service → Pokemon service contract: implements (evidence: `src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs`)
- PokeAPI service → PokeAPI: requests list and details (evidence: `src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs`)
- PokeAPI service → List response DTO: parses list (evidence: `src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs`)
- PokeAPI service → Details response DTO: parses details (evidence: `src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs`)
- PokeAPI service → Service errors: raises (evidence: `src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs`)
- PokeAPI service → Pokemon summary: maps list entries (evidence: `src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs`)
- PokeAPI service → Pokemon details: maps details (evidence: `src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs`)
- PokeAPI service → Base stat: maps stats (evidence: `src/PokemonBrowser.Infrastructure/Services/PokeApiPokemonService.cs`)
- Theme contract → Theme service: implemented by (evidence: `src/PokemonBrowser.Presentation.Wpf/Services/ThemeService.cs`)
- Theme service → Theme settings store: loads and saves (evidence: `src/PokemonBrowser.Presentation.Wpf/Services/ThemeService.cs`)
- Theme service → Theme choice: selects (evidence: `src/PokemonBrowser.Presentation.Wpf/Services/ThemeService.cs`)
- Infrastructure registration → Cached image loader: registers (evidence: `src/PokemonBrowser.Presentation.Wpf/App.xaml.cs`)
- Cached image loader → Image loader contract: implements (evidence: `src/PokemonBrowser.Presentation.Wpf/Services/SpriteImageLoader.cs`)
