# d-joz/pokedex architecture

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

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

## Overview

#### Purpose and Entry Points
This is a static Pokémon gallery intended for GitHub Pages. `index.html` is the primary gallery entry point; individual type pages such as `fire.html`, `water.html`, and `psychic.html` provide filtered or themed views. Styling is loaded from `style.css`, `card.css`, and `colors.css`.

#### Generated Static-Site Model
The published site is pre-rendered HTML rather than an application with a server or client data layer. Pokémon card markup is repeated/generated into static pages, allowing direct hosting with no runtime API calls. Key outputs include:
- `index.html`
- `fire.html`
- `dragon.html`

#### Shared Presentation Layer
CSS separates global page layout, card structure, and palette/type colors:
- `style.css` defines overall document and gallery presentation.
- `card.css` defines reusable Pokémon card visuals.
- `colors.css` centralizes color choices, likely including type-associated colors.

This establishes a boundary between generated content markup and reusable visual design.

#### Data Acquisition and Local Dataset
Generation source data is stored locally in `script/pokemons.json`. `script/generate_data.js` is the data-ingestion stage intended to fetch Pokémon information from PokeAPI, likely handling the multiple requests and rate-limit pacing described in the README.

External dependency:
- PokeAPI (`https://pokeapi.co/`) during offline/build-time data collection.

No external API dependency is required when visitors load the published pages.

#### Page Generation Pipeline
`script/generate_page.js` is the build stage that transforms local Pokémon data into static HTML pages. It is driven by templates:
- `script/index_template.html`
- `script/type_template.html`
- `script/card_template.html`

The likely flow is: PokeAPI → `script/generate_data.js` → `script/pokemons.json` → `script/generate_page.js` + templates → root-level HTML gallery/type pages.

#### Templates and Content Boundaries
The generator/template directory is intentionally separate from deployable page assets:
- `script/card_template.html` supplies the repeated card unit.
- `script/index_template.html` supplies the all-Pokémon page shell.
- `script/type_template.html` supplies type-page shells.

`script/backup.html` appears to be a saved/generated reference artifact rather than a primary runtime entry point. `bug.html` and the other root type pages are generated site deliverables.

#### Runtime and Deployment
The site runtime is a browser serving plain HTML and CSS; it has no indicated framework, package manager, backend, or database. Build scripts are JavaScript and the README explicitly suggests Deno, though the repository does not expose runtime metadata. Deployment target is GitHub Pages, with `index.html` required as the hosting entry point.

Main entry points: [`script/generate_page.js`](https://github.com/d-joz/pokedex/blob/main/script/generate_page.js) (Page generator), [`index.html`](https://github.com/d-joz/pokedex/blob/main/index.html) (Main gallery), [`fire.html`](https://github.com/d-joz/pokedex/blob/main/fire.html) (Type galleries), [`style.css`](https://github.com/d-joz/pokedex/blob/main/style.css) (Global styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Offline generation"]
  node_data_generator["Data generator<br/>Deno script<br/>[generate_data.js]"]
  node_pokemon_data[("Pokémon dataset<br/>JSON data<br/>[pokemons.json]")]
  node_page_generator["Page generator<br/>Deno script<br/>[generate_page.js]"]
end

subgraph group_templates["Templates"]
  node_index_template["Gallery template<br/>HTML template"]
  node_type_template["Type-page template<br/>HTML template<br/>[type_template.html]"]
  node_card_template["Card template<br/>HTML template<br/>[card_template.html]"]
end

subgraph group_site["Published static site"]
  node_index_page["Main gallery<br/>static HTML<br/>[index.html]"]
  node_type_pages["Type galleries<br/>static HTML<br/>[fire.html]"]
  node_dragon_page["Dragon gallery<br/>static HTML<br/>[dragon.html]"]
  node_global_css["Global styles<br/>CSS<br/>[style.css]"]
  node_card_css["Card styles<br/>CSS<br/>[card.css]"]
  node_color_css["Type colors<br/>CSS<br/>[colors.css]"]
end

node_pokeapi{{"PokeAPI<br/>external API"}}
node_browser(("Browser<br/>static-site runtime"))
node_github_pages{{"GitHub Pages<br/>static hosting"}}

node_pokeapi -->|"build-time fetch"| node_data_generator
node_data_generator -->|"writes"| node_pokemon_data
node_pokemon_data -->|"input"| node_page_generator
node_index_template -->|"page shell"| node_page_generator
node_type_template -->|"type shells"| node_page_generator
node_card_template -->|"card markup"| node_page_generator
node_page_generator -->|"generates"| node_index_page
node_page_generator -->|"generates"| node_type_pages
node_page_generator -->|"generates"| node_dragon_page
node_global_css -->|"styles"| node_index_page
node_card_css -->|"styles"| node_index_page
node_color_css -->|"styles"| node_index_page
node_global_css -->|"styles"| node_type_pages
node_card_css -->|"styles"| node_type_pages
node_color_css -->|"styles"| node_type_pages
node_index_page -->|"deployed"| node_github_pages
node_type_pages -->|"deployed"| node_github_pages
node_dragon_page -->|"deployed"| node_github_pages
node_github_pages -->|"serves"| node_browser

click node_data_generator "https://github.com/d-joz/pokedex/blob/main/script/generate_data.js"
click node_pokemon_data "https://github.com/d-joz/pokedex/blob/main/script/pokemons.json"
click node_page_generator "https://github.com/d-joz/pokedex/blob/main/script/generate_page.js"
click node_index_template "https://github.com/d-joz/pokedex/blob/main/script/index_template.html"
click node_type_template "https://github.com/d-joz/pokedex/blob/main/script/type_template.html"
click node_card_template "https://github.com/d-joz/pokedex/blob/main/script/card_template.html"
click node_index_page "https://github.com/d-joz/pokedex/blob/main/index.html"
click node_type_pages "https://github.com/d-joz/pokedex/blob/main/fire.html"
click node_dragon_page "https://github.com/d-joz/pokedex/blob/main/dragon.html"
click node_global_css "https://github.com/d-joz/pokedex/blob/main/style.css"
click node_card_css "https://github.com/d-joz/pokedex/blob/main/card.css"
click node_color_css "https://github.com/d-joz/pokedex/blob/main/colors.css"

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_data_generator,node_pokemon_data,node_page_generator toneBlue
class node_index_template,node_type_template,node_card_template toneAmber
class node_index_page,node_type_pages,node_dragon_page,node_global_css,node_card_css,node_color_css toneMint
class node_pokeapi,node_browser,node_github_pages toneNeutral
```

## Components

### Offline generation

Local data collection and static-page generation.

- [Data generator](https://github.com/d-joz/pokedex/blob/main/script/generate_data.js): Deno script · Fetches and prepares Pokémon records. · `script/generate_data.js`
- [Pokémon dataset](https://github.com/d-joz/pokedex/blob/main/script/pokemons.json): JSON data · Local source data for page generation. · `script/pokemons.json`
- [Page generator](https://github.com/d-joz/pokedex/blob/main/script/generate_page.js): Deno script · Renders dataset records into static HTML. · `script/generate_page.js`

### Templates

Reusable HTML shells and card markup.

- [Gallery template](https://github.com/d-joz/pokedex/blob/main/script/index_template.html): HTML template · `script/index_template.html`
- [Type-page template](https://github.com/d-joz/pokedex/blob/main/script/type_template.html): HTML template · `script/type_template.html`
- [Card template](https://github.com/d-joz/pokedex/blob/main/script/card_template.html): HTML template · Repeated Pokémon card markup. · `script/card_template.html`

### Published static site

Files deployed for browser-only rendering.

- [Main gallery](https://github.com/d-joz/pokedex/blob/main/index.html): static HTML · GitHub Pages entry point. · `index.html`
- [Type galleries](https://github.com/d-joz/pokedex/blob/main/fire.html): static HTML · Generated filtered or themed pages. · `fire.html`
- [Dragon gallery](https://github.com/d-joz/pokedex/blob/main/dragon.html): static HTML · One generated type-page output. · `dragon.html`
- [Global styles](https://github.com/d-joz/pokedex/blob/main/style.css): CSS · Document and gallery layout. · `style.css`
- [Card styles](https://github.com/d-joz/pokedex/blob/main/card.css): CSS · Reusable card presentation. · `card.css`
- [Type colors](https://github.com/d-joz/pokedex/blob/main/colors.css): CSS · Shared palette and type-associated colors. · `colors.css`

### Other components

- **PokeAPI**: external API · Used only during offline data collection.
- **Browser**: static-site runtime · Renders HTML and CSS with no runtime API calls.
- **GitHub Pages**: static hosting · Deploys the generated site.

## Connections

- PokeAPI → Data generator: build-time fetch
- Data generator → Pokémon dataset: writes
- Pokémon dataset → Page generator: input
- Gallery template → Page generator: page shell
- Type-page template → Page generator: type shells
- Card template → Page generator: card markup
- Page generator → Main gallery: generates
- Page generator → Type galleries: generates
- Page generator → Dragon gallery: generates
- Global styles → Main gallery: styles
- Card styles → Main gallery: styles
- Type colors → Main gallery: styles
- Global styles → Type galleries: styles
- Card styles → Type galleries: styles
- Type colors → Type galleries: styles
- Main gallery → GitHub Pages: deployed
- Type galleries → GitHub Pages: deployed
- Dragon gallery → GitHub Pages: deployed
- GitHub Pages → Browser: serves
