# base0005/cst8209_project2 architecture

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

- Interactive diagram: https://gitdiagram.com/base0005/cst8209_project2
- Repository: https://github.com/base0005/cst8209_project2

## Overview

This is a browser-based Pokémon catalog: users choose a type, and the page displays matching Pokémon cards and a count. The sampled handlers filter the local catalog and build card details in the DOM; the catalog also supplies sprite and Pokémon-page URLs. The event-handler excerpt is partial, so the graph summarizes the repeated type-filtering behavior without assuming how the HTML loads the script.

Main entry points: [`index.html`](https://github.com/base0005/cst8209_project2/blob/main/index.html) (Page markup), [`index.js`](https://github.com/base0005/cst8209_project2/blob/main/index.js) (Type filter and renderer), [`style.css`](https://github.com/base0005/cst8209_project2/blob/main/style.css) (Page styles), [`pokedex.js`](https://github.com/base0005/cst8209_project2/blob/main/pokedex.js) (Pokémon catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Page interface"]
  node_page["Page markup<br/>[index.html]"]
  node_styles["Page styles<br/>[style.css]"]
end

subgraph group_runtime["Catalog runtime"]
  node_app["Type filter and renderer<br/>[index.js]"]
end

subgraph group_data["Catalog data"]
  node_catalog[("Pokémon catalog<br/>[pokedex.js]")]
end

node_visitor(("Visitor"))
node_sprites(("Sprite host"))
node_pokemon(("Pokémon pages"))

node_visitor -->|"uses"| node_page
node_visitor -->|"selects type"| node_app
node_app -->|"reads entries"| node_catalog
node_app -->|"renders cards"| node_page
node_styles -->|"styles"| node_page
node_page -.->|"loads sprites"| node_sprites
node_page -.->|"opens links"| node_pokemon

click node_page "https://github.com/base0005/cst8209_project2/blob/main/index.html"
click node_styles "https://github.com/base0005/cst8209_project2/blob/main/style.css"
click node_app "https://github.com/base0005/cst8209_project2/blob/main/index.js"
click node_catalog "https://github.com/base0005/cst8209_project2/blob/main/pokedex.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_page,node_styles toneBlue
class node_app toneAmber
class node_catalog toneMint
class node_visitor,node_sprites,node_pokemon toneIndigo
```

## Components

### Page interface

- [Page markup](https://github.com/base0005/cst8209_project2/blob/main/index.html): `index.html`
- [Page styles](https://github.com/base0005/cst8209_project2/blob/main/style.css): `style.css`

### Catalog runtime

- [Type filter and renderer](https://github.com/base0005/cst8209_project2/blob/main/index.js): `index.js`

### Catalog data

- [Pokémon catalog](https://github.com/base0005/cst8209_project2/blob/main/pokedex.js): `pokedex.js`

### Other components

- **Visitor**
- **Sprite host**
- **Pokémon pages**

## Connections

- Visitor → Page markup: uses
- Visitor → Type filter and renderer: selects type
- Type filter and renderer → Pokémon catalog: reads entries
- Type filter and renderer → Page markup: renders cards
- Page styles → Page markup: styles
- Page markup → Sprite host: loads sprites
- Page markup → Pokémon pages: opens links
