# shineii86/anilist architecture

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

- Interactive diagram: https://gitdiagram.com/shineii86/anilist
- Repository: https://github.com/shineii86/anilist

## Overview

1. This repository is a client-side, static single-page application. The core runtime is the browser; there is no custom backend, database, or server-side rendering layer in the repo.

2. `index.html` is the entry point and shell. It provides the DOM structure the app renders into, while `style.css` supplies the full visual system and `app.js` drives all behavior.

3. `app.js` is the main orchestrator. It appears to own navigation/state, UI rendering, search/filter interactions, anime detail views, list management, and integration with the AniList API.

4. The main external dependency is the AniList GraphQL API at `https://graphql.anilist.co`. Data flows from user actions in the browser to GraphQL queries, then back into DOM rendering for homepage discovery, search results, anime detail pages, recommendations, characters, and staff.

5. Client-side persistence is a major boundary. The app uses `localStorage` for user-specific and session-like state such as theme preference, cached API responses, saved filters/search history, and personal list data like watching/completed/planning statuses, ratings, and notes.

6. The UI layer is entirely CSS-driven and responsive. `style.css` contains the design system, theme variables for light/dark modes, component styles for anime cards/buttons/grids, and breakpoint rules for mobile, tablet, desktop, and wide screens.

7. Static assets are isolated under `assets/`, mainly images such as the logo and placeholders. They support branding and presentation only; they are not a separate application subsystem.

8. The app is optimized around performance-sensitive browser features: debounced search, lazy-loaded images, incremental content loading, and a small client-side cache with TTL. That means most heavy work happens in the browser after initial page load, not on a server.

9. Deployment is static hosting oriented. `vercel.json` supports Vercel deployment, and the repo also includes a GitHub Pages workflow under `.github/workflows/`, so the app can be published without any application server.

10. `package.json` and the README indicate developer tooling rather than a build pipeline: npm scripts for serving, linting, formatting, and deployment support. Architecturally, that means the repo is “source files + browser execution + external API,” with tooling wrapped around it.

11. For an architecture diagram, the key boundaries are: browser UI/state on one side; AniList GraphQL API on the other; `localStorage` as the persistence layer; and static hosting/CDN as the delivery layer. Everything else in the repo supports those flows.

Main entry points: [`app.js`](https://github.com/shineii86/anilist/blob/main/app.js) (App Logic), [`vercel.json`](https://github.com/shineii86/anilist/blob/main/vercel.json) (Static Host), [`index.html`](https://github.com/shineii86/anilist/blob/main/index.html) (App Shell), [`style.css`](https://github.com/shineii86/anilist/blob/main/style.css) (UI System)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client App"]
  node_browser(("Browser<br/>runtime"))
  node_index_html["App Shell<br/>entry html<br/>[index.html]"]
  node_app_js["App Logic<br/>spa controller<br/>[app.js]"]
  node_style_css["UI System<br/>styles<br/>[style.css]"]
  node_ui_render["Rendering<br/>ui layer<br/>[app.js]"]
  node_nav_state["Navigation<br/>state flow<br/>[app.js]"]
  node_search_flow["Search Flow<br/>interaction<br/>[app.js]"]
  node_anime_views["Anime Views<br/>detail flow<br/>[app.js]"]
  node_list_mgmt["List Manager<br/>personal data<br/>[app.js]"]
end

subgraph group_state["Client State"]
  node_local_storage[("localStorage<br/>persistence")]
  node_api_cache["API Cache<br/>ttl cache"]
end

subgraph group_external["External Services"]
  node_anilist_api{{"AniList API<br/>graphql service"}}
end

subgraph group_delivery["Deployment"]
  node_static_host["Static Host<br/>hosting<br/>[vercel.json]"]
  node_gh_pages["Pages Workflow<br/>ci deploy"]
  node_package_json["Tooling<br/>npm scripts<br/>[package.json]"]
end

subgraph group_assets["Assets"]
  node_assets_images["Brand Assets<br/>images"]
end

node_browser -->|"loads"| node_index_html
node_index_html -->|"boots"| node_app_js
node_index_html -->|"styles"| node_style_css
node_app_js -->|"manages"| node_nav_state
node_app_js -->|"drives"| node_search_flow
node_app_js -->|"renders"| node_ui_render
node_app_js -->|"shows"| node_anime_views
node_app_js -->|"updates"| node_list_mgmt
node_nav_state -->|"persists"| node_local_storage
node_search_flow -->|"uses"| node_api_cache
node_list_mgmt -->|"persists"| node_local_storage
node_app_js -->|"queries"| node_anilist_api
node_api_cache -->|"refreshes"| node_anilist_api
node_app_js -->|"uses"| node_assets_images
node_style_css -->|"skins"| node_index_html
node_static_host -->|"serves"| node_index_html
node_static_host -->|"serves"| node_app_js
node_static_host -->|"serves"| node_style_css
node_static_host -->|"serves"| node_assets_images
node_gh_pages -->|"publishes"| node_static_host
node_package_json -->|"supports"| node_app_js

click node_index_html "https://github.com/shineii86/anilist/blob/main/index.html"
click node_app_js "https://github.com/shineii86/anilist/blob/main/app.js"
click node_style_css "https://github.com/shineii86/anilist/blob/main/style.css"
click node_ui_render "https://github.com/shineii86/anilist/blob/main/app.js"
click node_nav_state "https://github.com/shineii86/anilist/blob/main/app.js"
click node_search_flow "https://github.com/shineii86/anilist/blob/main/app.js"
click node_anime_views "https://github.com/shineii86/anilist/blob/main/app.js"
click node_list_mgmt "https://github.com/shineii86/anilist/blob/main/app.js"
click node_static_host "https://github.com/shineii86/anilist/blob/main/vercel.json"
click node_gh_pages "https://github.com/shineii86/anilist/blob/main/.github/workflows/jekyll-gh-pages.yml"
click node_assets_images "https://github.com/shineii86/anilist/tree/main/assets/images"
click node_package_json "https://github.com/shineii86/anilist/blob/main/package.json"

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_browser,node_index_html,node_app_js,node_style_css,node_ui_render,node_nav_state,node_search_flow,node_anime_views,node_list_mgmt toneBlue
class node_local_storage,node_api_cache toneAmber
class node_anilist_api toneMint
class node_static_host,node_gh_pages,node_package_json toneRose
class node_assets_images toneIndigo
```

## Components

### Client App

Browser-executed SPA shell, logic, and presentation.

- **Browser**: runtime · Executes the single-page app and owns rendering, events, and navigation.
- [App Shell](https://github.com/shineii86/anilist/blob/main/index.html): entry html · Root document that provides the mounting structure for the SPA. · `index.html`
- [App Logic](https://github.com/shineii86/anilist/blob/main/app.js): spa controller · Main orchestrator for navigation, search, detail views, lists, and API integration. · `app.js`
- [UI System](https://github.com/shineii86/anilist/blob/main/style.css): styles · Responsive visual system, theme variables, and component styling. · `style.css`
- [Rendering](https://github.com/shineii86/anilist/blob/main/app.js): ui layer · Homepage discovery, search results, anime details, recommendations, characters, and staff views. · `app.js`
- [Navigation](https://github.com/shineii86/anilist/blob/main/app.js): state flow · Client-side routing and view-state transitions. · `app.js`
- [Search Flow](https://github.com/shineii86/anilist/blob/main/app.js): interaction · Debounced search, filters, and incremental content loading. · `app.js`
- [Anime Views](https://github.com/shineii86/anilist/blob/main/app.js): detail flow · Anime detail pages and related content sections. · `app.js`
- [List Manager](https://github.com/shineii86/anilist/blob/main/app.js): personal data · Watching, completed, planning statuses, ratings, and notes handling. · `app.js`

### Client State

Local persistence and browser-side runtime state.

- **localStorage**: persistence · Browser persistence for theme, cached responses, filters, history, and user list data.
- **API Cache**: ttl cache · Client-side cached API responses with expiration.

### External Services

Third-party data API used by the app.

- **AniList API**: graphql service · External GraphQL endpoint providing anime, recommendations, characters, and staff data.

### Deployment

Static hosting and publish configuration.

- [Static Host](https://github.com/shineii86/anilist/blob/main/vercel.json): hosting · Deployment target for the static SPA without an application server. · `vercel.json`
- [Pages Workflow](https://github.com/shineii86/anilist/blob/main/.github/workflows/jekyll-gh-pages.yml): ci deploy · GitHub Pages publication workflow. · `.github/workflows/jekyll-gh-pages.yml`
- [Tooling](https://github.com/shineii86/anilist/blob/main/package.json): npm scripts · Developer scripts for serving, linting, formatting, and deployment support. · `package.json`

### Assets

Static image resources for branding and placeholders.

- [Brand Assets](https://github.com/shineii86/anilist/tree/main/assets/images): images · Logo and placeholder images used by the UI. · `assets/images`

## Connections

- Browser → App Shell: loads · The browser loads the entry document.
- App Shell → App Logic: boots · The shell mounts the SPA logic.
- App Shell → UI System: styles · The document pulls in the visual system.
- App Logic → Navigation: manages · Main controller owns navigation and view state.
- App Logic → Search Flow: drives · Search and filter interactions are handled in the app layer.
- App Logic → Rendering: renders · App logic produces the visible homepage and content views.
- App Logic → Anime Views: shows · Detail pages and related sections are coordinated by the app.
- App Logic → List Manager: updates · User list edits and notes are managed client-side.
- Navigation → localStorage: persists · Theme and session-like state are saved in browser storage.
- Search Flow → API Cache: uses · Search and discovery responses are cached locally.
- List Manager → localStorage: persists · Personal list data is stored in browser storage.
- App Logic → AniList API: queries · GraphQL requests fetch discovery and detail data.
- API Cache → AniList API: refreshes · Cached data is replenished from the remote API.
- App Logic → Brand Assets: uses · Branding and placeholders support presentation.
- UI System → App Shell: skins · Styles define the responsive UI shell and components.
- Static Host → App Shell: serves · Static hosting delivers the SPA entry file.
- Static Host → App Logic: serves · Hosting delivers the application bundle as source.
- Static Host → UI System: serves · Hosting delivers the stylesheet.
- Static Host → Brand Assets: serves · Hosting delivers static image assets.
- Pages Workflow → Static Host: publishes · Workflow publishes the static site.
- Tooling → App Logic: supports · Tooling supports development and deployment of the client app.
