# naexys/anime-requester architecture

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

- Interactive diagram: https://gitdiagram.com/naexys/anime-requester
- Repository: https://github.com/naexys/anime-requester

## Overview

anime-requester is a browser-based anime discovery app. A user enters through the landing page, proceeds to the search page, selects title, ID, rank, or genre criteria, and sees matching anime cards backed by Kitsu. Genre choices are preloaded and cached for the session; the app also provides a session-persisted theme toggle. The excerpts show search dispatch, API formatting, and rendering, but not the HTML wiring, so page-to-script relationships are left out where they cannot be verified.

Main entry points: [`JS/search.js`](https://github.com/naexys/anime-requester/blob/main/JS/search.js) (Search controls), [`JS/api.js`](https://github.com/naexys/anime-requester/blob/main/JS/api.js) (API requests), [`JS/registration.js`](https://github.com/naexys/anime-requester/blob/main/JS/registration.js) (Genre preload), [`HTML/home.html`](https://github.com/naexys/anime-requester/blob/main/HTML/home.html) (Search page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and navigation"]
  node_landing["Landing page<br/>[index.html]"]
  node_registration["Genre preload<br/>[registration.js]"]
  node_home["Search page<br/>[home.html]"]
  node_search_guard["Page guard<br/>[script.js]"]
end

subgraph group_discovery["Anime discovery"]
  node_search["Search controls<br/>[search.js]"]
  node_name_search["Title search<br/>[api.js]"]
  node_id_search["ID lookup<br/>[api.js]"]
  node_rank_search["Rank lookup<br/>[api.js]"]
  node_genre_search["Genre filtering<br/>[api.js]"]
  node_genre_list["Genre listing<br/>[api.js]"]
end

subgraph group_data["API and session data"]
  node_api_request["API requests<br/>[api.js]"]
  node_anime_format["Anime formatting<br/>[api.js]"]
  node_kitsu{{"Kitsu API"}}
  node_genre_cache[("Genre session cache<br/>[search.js]")]
end

subgraph group_presentation["Presentation"]
  node_card_list["Result cards<br/>[showcard.js]"]
  node_single_card["Single anime card<br/>[showcard.js]"]
  node_theme["Theme toggle<br/>[theme.js]"]
  node_styling["Page styling<br/>[style.css]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_landing
node_registration -->|"loads genres"| node_genre_list
node_registration -->|"caches genres"| node_genre_cache
node_registration -->|"redirects to"| node_home
node_home -.->|"hosts search"| node_search
node_search_guard -->|"loads module"| node_search
node_search_guard -->|"checks cache"| node_genre_cache
node_search -->|"reads genres"| node_genre_cache
node_search -->|"calls for titles"| node_name_search
node_search -->|"calls for IDs"| node_id_search
node_search -->|"calls for ranks"| node_rank_search
node_search -->|"calls genre filters"| node_genre_search
node_search -->|"renders results"| node_card_list
node_search -->|"renders one result"| node_single_card
node_registration -->|"requests genres via"| node_api_request
node_name_search -->|"requests data via"| node_api_request
node_id_search -->|"requests data via"| node_api_request
node_rank_search -->|"requests data via"| node_api_request
node_genre_search -->|"requests data via"| node_api_request
node_api_request -->|"fetches from"| node_kitsu
node_name_search -->|"formats results"| node_anime_format
node_id_search -->|"formats result"| node_anime_format
node_rank_search -->|"formats result"| node_anime_format
node_genre_search -->|"formats results"| node_anime_format
node_genre_list -->|"requests categories via"| node_api_request
node_theme -.->|"persists theme separately"| node_genre_cache
node_home -.->|"uses styles"| node_styling

click node_landing "https://github.com/naexys/anime-requester/blob/main/index.html"
click node_registration "https://github.com/naexys/anime-requester/blob/main/JS/registration.js"
click node_home "https://github.com/naexys/anime-requester/blob/main/HTML/home.html"
click node_search "https://github.com/naexys/anime-requester/blob/main/JS/search.js"
click node_search_guard "https://github.com/naexys/anime-requester/blob/main/JS/script.js"
click node_name_search "https://github.com/naexys/anime-requester/blob/main/JS/api.js"
click node_id_search "https://github.com/naexys/anime-requester/blob/main/JS/api.js"
click node_rank_search "https://github.com/naexys/anime-requester/blob/main/JS/api.js"
click node_genre_search "https://github.com/naexys/anime-requester/blob/main/JS/api.js"
click node_genre_list "https://github.com/naexys/anime-requester/blob/main/JS/api.js"
click node_api_request "https://github.com/naexys/anime-requester/blob/main/JS/api.js"
click node_anime_format "https://github.com/naexys/anime-requester/blob/main/JS/api.js"
click node_genre_cache "https://github.com/naexys/anime-requester/blob/main/JS/search.js"
click node_card_list "https://github.com/naexys/anime-requester/blob/main/JS/showcard.js"
click node_single_card "https://github.com/naexys/anime-requester/blob/main/JS/showcard.js"
click node_theme "https://github.com/naexys/anime-requester/blob/main/JS/theme.js"
click node_styling "https://github.com/naexys/anime-requester/blob/main/CSS/style.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_landing,node_registration,node_home,node_search_guard toneBlue
class node_search,node_name_search,node_id_search,node_rank_search,node_genre_search,node_genre_list toneAmber
class node_api_request,node_anime_format,node_kitsu,node_genre_cache toneMint
class node_card_list,node_single_card,node_theme,node_styling toneRose
class node_visitor toneIndigo
```

## Components

### Entry and navigation

- [Landing page](https://github.com/naexys/anime-requester/blob/main/index.html): `index.html`
- [Genre preload](https://github.com/naexys/anime-requester/blob/main/JS/registration.js): `JS/registration.js`
- [Search page](https://github.com/naexys/anime-requester/blob/main/HTML/home.html): `HTML/home.html`
- [Page guard](https://github.com/naexys/anime-requester/blob/main/JS/script.js): `JS/script.js`

### Anime discovery

- [Search controls](https://github.com/naexys/anime-requester/blob/main/JS/search.js): `JS/search.js`
- [Title search](https://github.com/naexys/anime-requester/blob/main/JS/api.js): `JS/api.js`
- [ID lookup](https://github.com/naexys/anime-requester/blob/main/JS/api.js): `JS/api.js`
- [Rank lookup](https://github.com/naexys/anime-requester/blob/main/JS/api.js): `JS/api.js`
- [Genre filtering](https://github.com/naexys/anime-requester/blob/main/JS/api.js): `JS/api.js`
- [Genre listing](https://github.com/naexys/anime-requester/blob/main/JS/api.js): `JS/api.js`

### API and session data

- [API requests](https://github.com/naexys/anime-requester/blob/main/JS/api.js): `JS/api.js`
- [Anime formatting](https://github.com/naexys/anime-requester/blob/main/JS/api.js): `JS/api.js`
- **Kitsu API**
- [Genre session cache](https://github.com/naexys/anime-requester/blob/main/JS/search.js): `JS/search.js`

### Presentation

- [Result cards](https://github.com/naexys/anime-requester/blob/main/JS/showcard.js): `JS/showcard.js`
- [Single anime card](https://github.com/naexys/anime-requester/blob/main/JS/showcard.js): `JS/showcard.js`
- [Theme toggle](https://github.com/naexys/anime-requester/blob/main/JS/theme.js): `JS/theme.js`
- [Page styling](https://github.com/naexys/anime-requester/blob/main/CSS/style.css): `CSS/style.css`

### Other components

- **Visitor**

## Connections

- Visitor → Landing page: opens (evidence: `README.md`)
- Genre preload → Genre listing: loads genres (evidence: `JS/registration.js`)
- Genre preload → Genre session cache: caches genres (evidence: `JS/registration.js`)
- Genre preload → Search page: redirects to (evidence: `JS/registration.js`)
- Search page → Search controls: hosts search
- Page guard → Search controls: loads module (evidence: `JS/script.js`)
- Page guard → Genre session cache: checks cache (evidence: `JS/script.js`)
- Search controls → Genre session cache: reads genres (evidence: `JS/search.js`)
- Search controls → Title search: calls for titles (evidence: `JS/search.js`)
- Search controls → ID lookup: calls for IDs (evidence: `JS/search.js`)
- Search controls → Rank lookup: calls for ranks (evidence: `JS/search.js`)
- Search controls → Genre filtering: calls genre filters (evidence: `JS/search.js`)
- Search controls → Result cards: renders results (evidence: `JS/search.js`)
- Search controls → Single anime card: renders one result (evidence: `JS/search.js`)
- Genre preload → API requests: requests genres via (evidence: `JS/api.js`)
- Title search → API requests: requests data via (evidence: `JS/api.js`)
- ID lookup → API requests: requests data via (evidence: `JS/api.js`)
- Rank lookup → API requests: requests data via (evidence: `JS/api.js`)
- Genre filtering → API requests: requests data via (evidence: `JS/api.js`)
- API requests → Kitsu API: fetches from (evidence: `JS/api.js`)
- Title search → Anime formatting: formats results (evidence: `JS/api.js`)
- ID lookup → Anime formatting: formats result (evidence: `JS/api.js`)
- Rank lookup → Anime formatting: formats result (evidence: `JS/api.js`)
- Genre filtering → Anime formatting: formats results (evidence: `JS/api.js`)
- Genre listing → API requests: requests categories via (evidence: `JS/api.js`)
- Theme toggle → Genre session cache: persists theme separately
- Search page → Page styling: uses styles
