# cowglow/pokemon-api-ui architecture

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

- Interactive diagram: https://gitdiagram.com/cowglow/pokemon-api-ui
- Repository: https://github.com/cowglow/pokemon-api-ui

## Overview

This is a Pokémon catalog and collection web app. Users browse and search Pokémon, select one for detail views, and add or remove Pokémon from a locally persisted collection; settings manage the user name and onboarding state. The graph follows the documented-by-source Redux/Saga state and persistence structure. Several view components and saga wiring were not excerpted, so those feature branches are included from the source index, while uncertain connections are omitted.

Main entry points: [`src/App.tsx`](https://github.com/cowglow/pokemon-api-ui/blob/main/src/App.tsx) (App shell and routes), [`src/redux/reducers/collection.ts`](https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/reducers/collection.ts) (Collection state), [`src/pages/PokemonsPage.tsx`](https://github.com/cowglow/pokemon-api-ui/blob/main/src/pages/PokemonsPage.tsx) (Pokémon page), [`src/redux/reducers/pokemons.ts`](https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/reducers/pokemons.ts) (Catalog state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and pages"]
  node_app["App shell and routes<br/>[App.tsx]"]
  node_pokemonspage["Pokémon page<br/>[PokemonsPage.tsx]"]
  node_collectionpage["Collection page<br/>[CollectionPage.tsx]"]
  node_settingspage["Settings page<br/>[SettingsPage.tsx]"]
  node_layout["Shared layout<br/>[Layout.tsx]"]
end

subgraph group_catalog["Catalog experience"]
  node_list["Searchable catalog<br/>[PokemonList.tsx]"]
  node_detail["Selected Pokémon detail"]
  node_detailviews["Detail views"]
  node_collectioncard["Collection cards"]
  node_add["Add to collection"]
  node_remove["Remove dialog"]
  node_onboarding["Onboarding"]
  node_settings_form["Settings form<br/>[PokemonForm.tsx]"]
end

subgraph group_state["State and orchestration"]
  node_pokemonstate["Catalog state<br/>[pokemons.ts]"]
  node_collectionstate["Collection state<br/>[collection.ts]"]
  node_userstate["User state<br/>[user.ts]"]
  node_store["Redux store<br/>[store-config.ts]"]
  node_fetchlist["Fetch catalog"]
  node_fetchdetail["Fetch detail"]
  node_collection_sync["Collection sync"]
  node_user_sync["User sync"]
  node_skip_sync["Onboarding sync"]
end

subgraph group_persistence["Local persistence"]
  node_collection_storage[("Collection storage")]
  node_user_storage[("User storage<br/>[user-storage.ts]")]
end

subgraph group_domain["Pokémon data"]
  node_pokemonmodel["Catalog API model<br/>[pokemon.ts]"]
  node_detailmodel["Detail data model<br/>[PokemonType.ts]"]
  node_createpokemon["Detail normalization<br/>[create-pokemon.ts]"]
end

node_user(("User"))
node_pokemon_api["Pokémon API"]

node_user -->|"opens"| node_app
node_app -->|"renders"| node_layout
node_app -->|"routes to"| node_pokemonspage
node_app -->|"routes to"| node_collectionpage
node_app -->|"routes to"| node_settingspage
node_app -->|"starts fetch"| node_pokemonstate
node_app -->|"loads collection"| node_collection_storage
node_app -->|"hydrates"| node_collectionstate
node_app -->|"loads preferences"| node_user_storage
node_app -->|"hydrates"| node_userstate
node_pokemonspage -->|"renders"| node_list
node_pokemonspage -->|"renders"| node_detail
node_pokemonspage -->|"renders"| node_add
node_pokemonspage -->|"renders"| node_onboarding
node_collectionpage -->|"renders"| node_collectioncard
node_settingspage -.->|"renders"| node_settings_form
node_list -->|"reads and selects"| node_pokemonstate
node_list -->|"filters by"| node_collectionstate
node_detail -.->|"shows"| node_detailviews
node_detail -.->|"requests detail"| node_fetchdetail
node_add -->|"dispatches add"| node_collectionstate
node_add -->|"opens"| node_remove
node_collectioncard -->|"reads collection"| node_collectionstate
node_collectioncard -->|"opens"| node_remove
node_collectionpage -->|"reads collection"| node_collectionstate
node_settingspage -->|"reads and updates"| node_userstate
node_settingspage -->|"manages collection"| node_collectionstate
node_store -->|"combines"| node_pokemonstate
node_store -->|"combines"| node_collectionstate
node_store -->|"combines"| node_userstate
node_fetchlist -->|"requests catalog"| node_pokemon_api
node_fetchlist -->|"dispatches results"| node_pokemonstate
node_fetchdetail -->|"requests detail"| node_pokemon_api
node_fetchdetail -->|"normalizes response"| node_createpokemon
node_fetchdetail -->|"dispatches detail"| node_pokemonstate
node_createpokemon -->|"builds model"| node_detailmodel
node_collection_sync -->|"observes changes"| node_collectionstate
node_collection_sync -->|"persists collection"| node_collection_storage
node_user_sync -->|"observes changes"| node_userstate
node_user_sync -->|"persists name"| node_user_storage
node_skip_sync -->|"persists skip"| node_user_storage
node_pokemonmodel -->|"types results"| node_fetchlist
node_detailmodel -->|"types detail"| node_createpokemon

click node_app "https://github.com/cowglow/pokemon-api-ui/blob/main/src/App.tsx"
click node_pokemonspage "https://github.com/cowglow/pokemon-api-ui/blob/main/src/pages/PokemonsPage.tsx"
click node_collectionpage "https://github.com/cowglow/pokemon-api-ui/blob/main/src/pages/CollectionPage.tsx"
click node_settingspage "https://github.com/cowglow/pokemon-api-ui/blob/main/src/pages/SettingsPage.tsx"
click node_layout "https://github.com/cowglow/pokemon-api-ui/blob/main/src/ui/Layout.tsx"
click node_list "https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/PokemonList.tsx"
click node_detail "https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/SelectedPokemon.tsx"
click node_detailviews "https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/PokemonDetailTabs.tsx"
click node_collectioncard "https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/PokemonCollectionCard.tsx"
click node_add "https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/Fab/AddToCollection.tsx"
click node_remove "https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/RemoveFromCollectionDialog.tsx"
click node_onboarding "https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/OnboardingDialog.tsx"
click node_pokemonstate "https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/reducers/pokemons.ts"
click node_collectionstate "https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/reducers/collection.ts"
click node_userstate "https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/reducers/user.ts"
click node_store "https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/store-config.ts"
click node_fetchlist "https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/saga-handlers/fetchPokemonsHandler.ts"
click node_fetchdetail "https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/saga-handlers/fetchPokemonDetailHandler.ts"
click node_collection_sync "https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/saga-handlers/syncCollectionToLocalStorageHandler.ts"
click node_user_sync "https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/saga-handlers/syncUserNameToLocalStorageHandler.ts"
click node_skip_sync "https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/saga-handlers/syncUserSkippedToLocalStorageHandler.ts"
click node_collection_storage "https://github.com/cowglow/pokemon-api-ui/blob/main/src/lib/collection-storage.ts"
click node_user_storage "https://github.com/cowglow/pokemon-api-ui/blob/main/src/lib/user-storage.ts"
click node_pokemonmodel "https://github.com/cowglow/pokemon-api-ui/blob/main/src/types/pokemon.ts"
click node_detailmodel "https://github.com/cowglow/pokemon-api-ui/blob/main/src/lib/PokemonType.ts"
click node_createpokemon "https://github.com/cowglow/pokemon-api-ui/blob/main/src/lib/create-pokemon.ts"
click node_settings_form "https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/PokemonForm.tsx"

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_app,node_pokemonspage,node_collectionpage,node_settingspage,node_layout,node_user toneBlue
class node_list,node_detail,node_detailviews,node_collectioncard,node_add,node_remove,node_onboarding,node_settings_form toneAmber
class node_pokemonstate,node_collectionstate,node_userstate,node_store,node_fetchlist,node_fetchdetail,node_collection_sync,node_user_sync,node_skip_sync,node_pokemon_api toneMint
class node_collection_storage,node_user_storage toneRose
class node_pokemonmodel,node_detailmodel,node_createpokemon toneIndigo
```

## Components

### App and pages

- [App shell and routes](https://github.com/cowglow/pokemon-api-ui/blob/main/src/App.tsx): `src/App.tsx`
- [Pokémon page](https://github.com/cowglow/pokemon-api-ui/blob/main/src/pages/PokemonsPage.tsx): `src/pages/PokemonsPage.tsx`
- [Collection page](https://github.com/cowglow/pokemon-api-ui/blob/main/src/pages/CollectionPage.tsx): `src/pages/CollectionPage.tsx`
- [Settings page](https://github.com/cowglow/pokemon-api-ui/blob/main/src/pages/SettingsPage.tsx): `src/pages/SettingsPage.tsx`
- [Shared layout](https://github.com/cowglow/pokemon-api-ui/blob/main/src/ui/Layout.tsx): `src/ui/Layout.tsx`

### Catalog experience

- [Searchable catalog](https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/PokemonList.tsx): `src/components/PokemonList.tsx`
- [Selected Pokémon detail](https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/SelectedPokemon.tsx): `src/components/SelectedPokemon.tsx`
- [Detail views](https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/PokemonDetailTabs.tsx): `src/components/PokemonDetailTabs.tsx`
- [Collection cards](https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/PokemonCollectionCard.tsx): `src/components/PokemonCollectionCard.tsx`
- [Add to collection](https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/Fab/AddToCollection.tsx): `src/components/Fab/AddToCollection.tsx`
- [Remove dialog](https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/RemoveFromCollectionDialog.tsx): `src/components/RemoveFromCollectionDialog.tsx`
- [Onboarding](https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/OnboardingDialog.tsx): `src/components/OnboardingDialog.tsx`
- [Settings form](https://github.com/cowglow/pokemon-api-ui/blob/main/src/components/PokemonForm.tsx): `src/components/PokemonForm.tsx`

### State and orchestration

- [Catalog state](https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/reducers/pokemons.ts): `src/redux/reducers/pokemons.ts`
- [Collection state](https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/reducers/collection.ts): `src/redux/reducers/collection.ts`
- [User state](https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/reducers/user.ts): `src/redux/reducers/user.ts`
- [Redux store](https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/store-config.ts): `src/redux/store-config.ts`
- [Fetch catalog](https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/saga-handlers/fetchPokemonsHandler.ts): `src/redux/saga-handlers/fetchPokemonsHandler.ts`
- [Fetch detail](https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/saga-handlers/fetchPokemonDetailHandler.ts): `src/redux/saga-handlers/fetchPokemonDetailHandler.ts`
- [Collection sync](https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/saga-handlers/syncCollectionToLocalStorageHandler.ts): `src/redux/saga-handlers/syncCollectionToLocalStorageHandler.ts`
- [User sync](https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/saga-handlers/syncUserNameToLocalStorageHandler.ts): `src/redux/saga-handlers/syncUserNameToLocalStorageHandler.ts`
- [Onboarding sync](https://github.com/cowglow/pokemon-api-ui/blob/main/src/redux/saga-handlers/syncUserSkippedToLocalStorageHandler.ts): `src/redux/saga-handlers/syncUserSkippedToLocalStorageHandler.ts`

### Local persistence

- [Collection storage](https://github.com/cowglow/pokemon-api-ui/blob/main/src/lib/collection-storage.ts): `src/lib/collection-storage.ts`
- [User storage](https://github.com/cowglow/pokemon-api-ui/blob/main/src/lib/user-storage.ts): `src/lib/user-storage.ts`

### Pokémon data

- [Catalog API model](https://github.com/cowglow/pokemon-api-ui/blob/main/src/types/pokemon.ts): `src/types/pokemon.ts`
- [Detail data model](https://github.com/cowglow/pokemon-api-ui/blob/main/src/lib/PokemonType.ts): `src/lib/PokemonType.ts`
- [Detail normalization](https://github.com/cowglow/pokemon-api-ui/blob/main/src/lib/create-pokemon.ts): `src/lib/create-pokemon.ts`

### Other components

- **User**
- **Pokémon API**

## Connections

- User → App shell and routes: opens
- App shell and routes → Shared layout: renders (evidence: `src/App.tsx`)
- App shell and routes → Pokémon page: routes to (evidence: `src/App.tsx`)
- App shell and routes → Collection page: routes to (evidence: `src/App.tsx`)
- App shell and routes → Settings page: routes to (evidence: `src/App.tsx`)
- App shell and routes → Catalog state: starts fetch (evidence: `src/App.tsx`)
- App shell and routes → Collection storage: loads collection (evidence: `src/App.tsx`)
- App shell and routes → Collection state: hydrates (evidence: `src/App.tsx`)
- App shell and routes → User storage: loads preferences (evidence: `src/App.tsx`)
- App shell and routes → User state: hydrates (evidence: `src/App.tsx`)
- Pokémon page → Searchable catalog: renders (evidence: `src/pages/PokemonsPage.tsx`)
- Pokémon page → Selected Pokémon detail: renders (evidence: `src/pages/PokemonsPage.tsx`)
- Pokémon page → Add to collection: renders (evidence: `src/pages/PokemonsPage.tsx`)
- Pokémon page → Onboarding: renders (evidence: `src/pages/PokemonsPage.tsx`)
- Collection page → Collection cards: renders (evidence: `src/pages/CollectionPage.tsx`)
- Settings page → Settings form: renders
- Searchable catalog → Catalog state: reads and selects (evidence: `src/components/PokemonList.tsx`)
- Searchable catalog → Collection state: filters by (evidence: `src/components/PokemonList.tsx`)
- Selected Pokémon detail → Detail views: shows
- Selected Pokémon detail → Fetch detail: requests detail
- Add to collection → Collection state: dispatches add (evidence: `src/components/Fab/AddToCollection.tsx`)
- Add to collection → Remove dialog: opens (evidence: `src/components/Fab/AddToCollection.tsx`)
- Collection cards → Collection state: reads collection (evidence: `src/components/PokemonCollectionCard.tsx`)
- Collection cards → Remove dialog: opens (evidence: `src/components/PokemonCollectionCard.tsx`)
- Collection page → Collection state: reads collection (evidence: `src/pages/CollectionPage.tsx`)
- Settings page → User state: reads and updates (evidence: `src/pages/SettingsPage.tsx`)
- Settings page → Collection state: manages collection (evidence: `src/pages/SettingsPage.tsx`)
- Redux store → Catalog state: combines (evidence: `src/redux/store-config.ts`)
- Redux store → Collection state: combines (evidence: `src/redux/store-config.ts`)
- Redux store → User state: combines (evidence: `src/redux/store-config.ts`)
- Fetch catalog → Pokémon API: requests catalog (evidence: `src/redux/saga-handlers/fetchPokemonsHandler.ts`)
- Fetch catalog → Catalog state: dispatches results (evidence: `src/redux/saga-handlers/fetchPokemonsHandler.ts`)
- Fetch detail → Pokémon API: requests detail (evidence: `src/redux/saga-handlers/fetchPokemonDetailHandler.ts`)
- Fetch detail → Detail normalization: normalizes response (evidence: `src/redux/saga-handlers/fetchPokemonDetailHandler.ts`)
- Fetch detail → Catalog state: dispatches detail (evidence: `src/redux/saga-handlers/fetchPokemonDetailHandler.ts`)
- Detail normalization → Detail data model: builds model (evidence: `src/lib/create-pokemon.ts`)
- Collection sync → Collection state: observes changes (evidence: `src/redux/saga-handlers/syncCollectionToLocalStorageHandler.ts`)
- Collection sync → Collection storage: persists collection (evidence: `src/redux/saga-handlers/syncCollectionToLocalStorageHandler.ts`)
- User sync → User state: observes changes (evidence: `src/redux/saga-handlers/syncUserNameToLocalStorageHandler.ts`)
- User sync → User storage: persists name (evidence: `src/redux/saga-handlers/syncUserNameToLocalStorageHandler.ts`)
- Onboarding sync → User storage: persists skip (evidence: `src/redux/saga-handlers/syncUserSkippedToLocalStorageHandler.ts`)
- Catalog API model → Fetch catalog: types results (evidence: `src/redux/saga-handlers/fetchPokemonsHandler.ts`)
- Detail data model → Detail normalization: types detail (evidence: `src/redux/saga-handlers/fetchPokemonDetailHandler.ts`)
