# redward42/pokedex architecture

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

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

## Overview

Pokedex Randomizer lets a user request a random Pokémon, view its image and attributes, and ban attribute values so subsequent results exclude matches. The main flow retries random PokéAPI requests until it finds an allowed Pokémon, then updates the displayed result and session history. Users can also remove values from the ban list; clicking a ban-worthy displayed value adds it and triggers another search. Most behavior lives in one React component, so several nodes share its exact source path. The graph reflects the sampled source and README; it does not infer unsampled implementation details.

Main entry points: [`src/App.tsx`](https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx) (Random selection), [`src/main.tsx`](https://github.com/RedWARd42/Pokedex/blob/main/src/main.tsx) (React entry), [`public/pokePlink.mp3`](https://github.com/RedWARd42/Pokedex/blob/main/public/pokePlink.mp3) (Click sound)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_entry["React entry<br/>[main.tsx]"]
  node_app["Randomizer UI<br/>[App.tsx]"]
  node_controls["Result controls<br/>[App.tsx]"]
  node_sound["Click sound<br/>[pokePlink.mp3]"]
end

subgraph group_discovery["Pokémon discovery"]
  node_randomizer["Random selection<br/>[App.tsx]"]
  node_pokemon_api["PokéAPI"]
  node_ban_filter["Ban filtering<br/>[App.tsx]"]
end

subgraph group_session["Session controls"]
  node_current_result["Current result<br/>[App.tsx]"]
  node_ban_list["Ban list<br/>[App.tsx]"]
  node_history["Session history<br/>[App.tsx]"]
end

node_user(("User"))

node_entry -->|"renders"| node_app
node_user -->|"clicks"| node_controls
node_controls -->|"requests result"| node_randomizer
node_controls -->|"plays"| node_sound
node_randomizer -->|"fetches Pokémon"| node_pokemon_api
node_pokemon_api -->|"returns JSON"| node_randomizer
node_randomizer -->|"checks candidate"| node_ban_filter
node_ban_filter -->|"reads bans"| node_ban_list
node_randomizer -->|"sets allowed result"| node_current_result
node_randomizer -->|"appends result"| node_history
node_app -->|"displays"| node_current_result
node_app -->|"displays"| node_history
node_app -->|"displays"| node_ban_list
node_app -->|"adds or removes"| node_ban_list
node_ban_list -->|"triggers search"| node_randomizer

click node_entry "https://github.com/RedWARd42/Pokedex/blob/main/src/main.tsx"
click node_app "https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx"
click node_controls "https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx"
click node_randomizer "https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx"
click node_ban_filter "https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx"
click node_current_result "https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx"
click node_ban_list "https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx"
click node_history "https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx"
click node_sound "https://github.com/RedWARd42/Pokedex/blob/main/public/pokePlink.mp3"

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_controls,node_sound,node_user toneBlue
class node_randomizer,node_pokemon_api,node_ban_filter toneAmber
class node_current_result,node_ban_list,node_history toneMint
```

## Components

### App runtime

- [React entry](https://github.com/RedWARd42/Pokedex/blob/main/src/main.tsx): `src/main.tsx`
- [Randomizer UI](https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx): `src/App.tsx`
- [Result controls](https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx): `src/App.tsx`
- [Click sound](https://github.com/RedWARd42/Pokedex/blob/main/public/pokePlink.mp3): `public/pokePlink.mp3`

### Pokémon discovery

- [Random selection](https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx): `src/App.tsx`
- **PokéAPI**
- [Ban filtering](https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx): `src/App.tsx`

### Session controls

- [Current result](https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx): `src/App.tsx`
- [Ban list](https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx): `src/App.tsx`
- [Session history](https://github.com/RedWARd42/Pokedex/blob/main/src/App.tsx): `src/App.tsx`

### Other components

- **User**

## Connections

- React entry → Randomizer UI: renders (evidence: `src/main.tsx`)
- User → Result controls: clicks (evidence: `README.md`)
- Result controls → Random selection: requests result (evidence: `src/App.tsx`)
- Result controls → Click sound: plays (evidence: `src/App.tsx`)
- Random selection → PokéAPI: fetches Pokémon (evidence: `src/App.tsx`)
- PokéAPI → Random selection: returns JSON (evidence: `src/App.tsx`)
- Random selection → Ban filtering: checks candidate (evidence: `src/App.tsx`)
- Ban filtering → Ban list: reads bans (evidence: `src/App.tsx`)
- Random selection → Current result: sets allowed result (evidence: `src/App.tsx`)
- Random selection → Session history: appends result (evidence: `src/App.tsx`)
- Randomizer UI → Current result: displays (evidence: `src/App.tsx`)
- Randomizer UI → Session history: displays (evidence: `src/App.tsx`)
- Randomizer UI → Ban list: displays (evidence: `src/App.tsx`)
- Randomizer UI → Ban list: adds or removes (evidence: `src/App.tsx`)
- Ban list → Random selection: triggers search (evidence: `src/App.tsx`)
