# yeisiv/pokedex architecture

> Architecture diagram of the GitHub repository yeisiv/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/yeisiv/pokedex
- Repository: https://github.com/yeisiv/pokedex

## Overview

This is a browser-based Pokédex: startup loads Pokémon, region, and type data; the interface builds filter options, applies search and selected filters, and renders matching cards. Separate features provide active-filter chips and light/dark theme toggling. The supplied README is empty, so capabilities and connections here are based on the shown JavaScript excerpts and file tree; styling and page markup are not mapped as runtime interactions.

Main entry points: [`src/js/app.js`](https://github.com/yeisiv/pokedex/blob/main/src/js/app.js) (App startup), [`src/js/tema.js`](https://github.com/yeisiv/pokedex/blob/main/src/js/tema.js) (Theme toggle), [`src/js/render.js`](https://github.com/yeisiv/pokedex/blob/main/src/js/render.js) (Grid & options), [`src/js/filters.js`](https://github.com/yeisiv/pokedex/blob/main/src/js/filters.js) (Search & filters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup &amp; Data"]
  node_app["App startup<br/>[app.js]"]
  node_pokemon_data["Pokédex data"]
  node_region_data["Region data<br/>[regiones.json]"]
  node_type_data["Type data<br/>[tipos.json]"]
end

subgraph group_discovery["Browse &amp; Filter"]
  node_filters["Search &amp; filters<br/>[filters.js]"]
end

subgraph group_presentation["Interface &amp; Theme"]
  node_render["Grid &amp; options<br/>[render.js]"]
  node_theme["Theme toggle<br/>[tema.js]"]
end

node_sprite_host(("Sprite hosting"))
node_browser_theme(("System theme preference"))
node_browser_storage[("Browser local storage")]

node_app -->|"initializes"| node_theme
node_app -->|"fetches"| node_pokemon_data
node_app -->|"fetches"| node_region_data
node_app -->|"fetches"| node_type_data
node_app -->|"builds panels"| node_render
node_app -->|"passes data"| node_filters
node_filters -->|"renders results"| node_render
node_render -->|"loads sprites"| node_sprite_host
node_theme -->|"reads preference"| node_browser_theme
node_theme -->|"stores choice"| node_browser_storage

click node_app "https://github.com/yeisiv/pokedex/blob/main/src/js/app.js"
click node_pokemon_data "https://github.com/yeisiv/pokedex/blob/main/src/data/pokedex_completo.json"
click node_region_data "https://github.com/yeisiv/pokedex/blob/main/src/data/regiones.json"
click node_type_data "https://github.com/yeisiv/pokedex/blob/main/src/data/tipos.json"
click node_filters "https://github.com/yeisiv/pokedex/blob/main/src/js/filters.js"
click node_render "https://github.com/yeisiv/pokedex/blob/main/src/js/render.js"
click node_theme "https://github.com/yeisiv/pokedex/blob/main/src/js/tema.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_app,node_pokemon_data,node_region_data,node_type_data toneBlue
class node_filters,node_browser_storage toneAmber
class node_render,node_theme toneMint
class node_sprite_host,node_browser_theme toneIndigo
```

## Components

### Startup & Data

- [App startup](https://github.com/yeisiv/pokedex/blob/main/src/js/app.js): `src/js/app.js`
- [Pokédex data](https://github.com/yeisiv/pokedex/blob/main/src/data/pokedex_completo.json): `src/data/pokedex_completo.json`
- [Region data](https://github.com/yeisiv/pokedex/blob/main/src/data/regiones.json): `src/data/regiones.json`
- [Type data](https://github.com/yeisiv/pokedex/blob/main/src/data/tipos.json): `src/data/tipos.json`

### Browse & Filter

- [Search & filters](https://github.com/yeisiv/pokedex/blob/main/src/js/filters.js): `src/js/filters.js`

### Interface & Theme

- [Grid & options](https://github.com/yeisiv/pokedex/blob/main/src/js/render.js): `src/js/render.js`
- [Theme toggle](https://github.com/yeisiv/pokedex/blob/main/src/js/tema.js): `src/js/tema.js`

### Other components

- **Sprite hosting**
- **System theme preference**
- **Browser local storage**

## Connections

- App startup → Theme toggle: initializes (evidence: `src/js/app.js`)
- App startup → Pokédex data: fetches (evidence: `src/js/app.js`)
- App startup → Region data: fetches (evidence: `src/js/app.js`)
- App startup → Type data: fetches (evidence: `src/js/app.js`)
- App startup → Grid & options: builds panels (evidence: `src/js/app.js`)
- App startup → Search & filters: passes data (evidence: `src/js/app.js`)
- Search & filters → Grid & options: renders results (evidence: `src/js/filters.js`)
- Grid & options → Sprite hosting: loads sprites (evidence: `src/js/render.js`)
- Theme toggle → System theme preference: reads preference (evidence: `src/js/tema.js`)
- Theme toggle → Browser local storage: stores choice (evidence: `src/js/tema.js`)
