# vrleonel/pokedex architecture

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

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

## Overview

Pokedex is a browser-based Pokémon lookup app. Users can search by name or number, or describe a Pokémon by voice; description lookup asks DeepSeek through OpenRouter to identify it, then the search component fetches Pokémon and evolution data from PokéAPI and renders the result. It also presents pronunciation data and can speak the name, with voice and behavior settings stored in browser local storage. The graph reflects the shown calls; the separate OpenRouter helper is present but no caller is evidenced.

Main entry points: [`src/components/PokemonSearch.js`](https://github.com/vrleonel/pokedex/blob/main/src/components/PokemonSearch.js) (Search and Results), [`src/utils/speech.js`](https://github.com/vrleonel/pokedex/blob/main/src/utils/speech.js) (Speech Utilities), [`src/components/ModalConfig/index.js`](https://github.com/vrleonel/pokedex/blob/main/src/components/ModalConfig/index.js) (Config Modal), [`src/utils/localStorage.js`](https://github.com/vrleonel/pokedex/blob/main/src/utils/localStorage.js) (Browser Storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["App and Search"]
  node_entry["React Entry<br/>[index.js]"]
  node_app["App Shell<br/>[App.js]"]
  node_search["Search and Results<br/>[PokemonSearch.js]"]
  node_config["Config Modal<br/>[index.js]"]
end

subgraph group_lookup["Lookup Services"]
  node_pronunciations["Pronunciation Data<br/>[pronunciations.js]"]
  node_deepseek["DeepSeek Client<br/>[deepseek.js]"]
  node_openrouter_helper["OpenRouter Helper<br/>[openrouter.js]"]
end

subgraph group_prefs["Speech and Settings"]
  node_local_storage[("Browser Storage<br/>[localStorage.js]")]
  node_speech["Speech Utilities<br/>[speech.js]"]
end

node_browser(("User"))
node_voice_input(("Browser Speech Input"))
node_pokeapi{{"PokéAPI"}}
node_openrouter{{"OpenRouter API"}}
node_speech_synthesis{{"Browser Speech Synthesis"}}

node_entry -->|"renders"| node_app
node_app -->|"renders"| node_search
node_browser -->|"searches"| node_search
node_voice_input -->|"provides transcript"| node_search
node_search -->|"identifies description"| node_deepseek
node_deepseek -->|"requests completion"| node_openrouter
node_search -->|"fetches Pokémon and evolutions"| node_pokeapi
node_search -->|"reads pronunciation"| node_pronunciations
node_search -->|"renders"| node_config
node_search -->|"reads and saves settings"| node_local_storage
node_config -->|"reads and saves settings"| node_local_storage
node_config -->|"loads available voices"| node_speech
node_search -->|"speaks pronunciation"| node_speech
node_speech -->|"reads voice settings"| node_local_storage
node_speech -->|"speaks text"| node_speech_synthesis
node_openrouter_helper -->|"posts prompt"| node_openrouter

click node_entry "https://github.com/vrleonel/pokedex/blob/main/src/index.js"
click node_app "https://github.com/vrleonel/pokedex/blob/main/src/App.js"
click node_search "https://github.com/vrleonel/pokedex/blob/main/src/components/PokemonSearch.js"
click node_config "https://github.com/vrleonel/pokedex/blob/main/src/components/ModalConfig/index.js"
click node_pronunciations "https://github.com/vrleonel/pokedex/blob/main/src/data/pronunciations.js"
click node_deepseek "https://github.com/vrleonel/pokedex/blob/main/src/services/deepseek.js"
click node_openrouter_helper "https://github.com/vrleonel/pokedex/blob/main/src/services/openrouter.js"
click node_local_storage "https://github.com/vrleonel/pokedex/blob/main/src/utils/localStorage.js"
click node_speech "https://github.com/vrleonel/pokedex/blob/main/src/utils/speech.js"

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_entry,node_app,node_search,node_config,node_browser,node_voice_input,node_speech_synthesis toneBlue
class node_pronunciations,node_deepseek,node_openrouter_helper toneAmber
class node_local_storage,node_speech,node_pokeapi,node_openrouter toneMint
```

## Components

### App and Search

- [React Entry](https://github.com/vrleonel/pokedex/blob/main/src/index.js): `src/index.js`
- [App Shell](https://github.com/vrleonel/pokedex/blob/main/src/App.js): `src/App.js`
- [Search and Results](https://github.com/vrleonel/pokedex/blob/main/src/components/PokemonSearch.js): `src/components/PokemonSearch.js`
- [Config Modal](https://github.com/vrleonel/pokedex/blob/main/src/components/ModalConfig/index.js): `src/components/ModalConfig/index.js`

### Lookup Services

- [Pronunciation Data](https://github.com/vrleonel/pokedex/blob/main/src/data/pronunciations.js): `src/data/pronunciations.js`
- [DeepSeek Client](https://github.com/vrleonel/pokedex/blob/main/src/services/deepseek.js): `src/services/deepseek.js`
- [OpenRouter Helper](https://github.com/vrleonel/pokedex/blob/main/src/services/openrouter.js): `src/services/openrouter.js`

### Speech and Settings

- [Browser Storage](https://github.com/vrleonel/pokedex/blob/main/src/utils/localStorage.js): `src/utils/localStorage.js`
- [Speech Utilities](https://github.com/vrleonel/pokedex/blob/main/src/utils/speech.js): `src/utils/speech.js`

### Other components

- **User**
- **Browser Speech Input**
- **PokéAPI**
- **OpenRouter API**
- **Browser Speech Synthesis**

## Connections

- React Entry → App Shell: renders (evidence: `src/index.js`)
- App Shell → Search and Results: renders (evidence: `src/App.js`)
- User → Search and Results: searches (evidence: `src/components/PokemonSearch.js`)
- Browser Speech Input → Search and Results: provides transcript (evidence: `src/components/PokemonSearch.js`)
- Search and Results → DeepSeek Client: identifies description (evidence: `src/components/PokemonSearch.js`)
- DeepSeek Client → OpenRouter API: requests completion (evidence: `src/services/deepseek.js`)
- Search and Results → PokéAPI: fetches Pokémon and evolutions (evidence: `src/components/PokemonSearch.js`)
- Search and Results → Pronunciation Data: reads pronunciation (evidence: `src/components/PokemonSearch.js`)
- Search and Results → Config Modal: renders (evidence: `src/components/PokemonSearch.js`)
- Search and Results → Browser Storage: reads and saves settings (evidence: `src/components/PokemonSearch.js`)
- Config Modal → Browser Storage: reads and saves settings (evidence: `src/components/ModalConfig/index.js`)
- Config Modal → Speech Utilities: loads available voices (evidence: `src/components/ModalConfig/index.js`)
- Search and Results → Speech Utilities: speaks pronunciation (evidence: `src/components/PokemonSearch.js`)
- Speech Utilities → Browser Storage: reads voice settings (evidence: `src/utils/speech.js`)
- Speech Utilities → Browser Speech Synthesis: speaks text (evidence: `src/utils/speech.js`)
- OpenRouter Helper → OpenRouter API: posts prompt (evidence: `src/services/openrouter.js`)
