# alexanderthebored/backend-test architecture

> Architecture diagram of the GitHub repository alexanderthebored/backend-test, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alexanderthebored/backend-test
- Repository: https://github.com/alexanderthebored/backend-test

## Overview

##### Project type and purpose
- **Type**: Static, front-end–only web application with local CLI tools for asset ingestion
- **Purpose**: Display a grid of manga titles and serve a chapter-by-chapter reader in the browser, backed by local JSON metadata and image assets

##### Main components
a. **Client (Browser)**
- index.html (landing page)
- mangareader.html (reader UI)
- Components: book-card.js/css, logo.css
- styles/main.css
b. **Static Files**
- data/manga.json (metadata store)
- assets/covers (cover images)
- assets/manga (chapter images)
c. **CLI Tools** (Node scripts in tools/)
- batch-download-manga.js
- download-chapter.js
- generate-manga-json.js
- mangadex-link.js
d. **External Service**
- MangaDex API (source for images and metadata)

##### Relationships & data flows
- Browser loads `index.html` → fetches `manga.json` → renders book-card components → pulls cover images
- User clicks a card → `mangareader.html` → loads chapter images from assets
- CLI tools invoke the MangaDex API to populate `assets/` and update `data/manga.json`

## Diagram (Mermaid)

```mermaid
graph TD
  subgraph "Client (Browser)"
    Browser["Browser"]:::client
    Index["index.html"]:::client
    Reader["mangareader.html"]:::client
    BookCardHTML["book-card.html"]:::client
    BookCardJS["book-card.js"]:::client
    BookCardCSS["book-card.css"]:::client
    LogoHTML["logo.html"]:::client
    LogoCSS["logo.css"]:::client
    HeaderHTML["header.html"]:::client
    HeaderCSS["header.css"]:::client
    Styles["styles/main.css"]:::client
  end

  subgraph "Static Files"
    DataJSON["data/manga.json"]:::static
    Covers["assets/covers"]:::static
    MangaPages["assets/manga"]:::static
  end

  subgraph "CLI Tools (Node scripts)"
    BatchDL["batch-download-manga.js"]:::cli
    ChapterDL["download-chapter.js"]:::cli
    GenJSON["generate-manga-json.js"]:::cli
    MDLink["mangadex-link.js"]:::cli
  end

  subgraph "External Service"
    API["MangaDex API"]:::external
  end

  Browser -->|"loads"| Index
  Browser -->|"loads"| Reader
  Index -->|"initializes"| BookCardHTML
  Index -->|"initializes"| LogoHTML
  Index -->|"initializes"| HeaderHTML
  Index -->|"loads stylesheet"| Styles
  Index -->|"fetches metadata"| DataJSON
  BookCardHTML -->|"loads cover"| Covers
  Reader -->|"fetches metadata"| DataJSON
  Reader -->|"loads pages"| MangaPages

  BatchDL -->|"fetches"| API
  ChapterDL -->|"fetches"| API
  GenJSON -->|"writes"| DataJSON
  MDLink -->|"generates links"| BatchDL
  BatchDL -->|"populates"| Covers
  ChapterDL -->|"populates"| MangaPages

  classDef client fill:#f2ffe6,stroke:#2b7a0b,stroke-width:1px
  classDef static fill:#e6f2ff,stroke:#0b3d7a,stroke-width:1px
  classDef cli fill:#fff4e6,stroke:#7a3d0b,stroke-width:1px
  classDef external fill:#ffe6f2,stroke:#7a0b2b,stroke-width:1px

  click Index "https://github.com/alexanderthebored/backend-test/blob/main/index.html"
  click Reader "https://github.com/alexanderthebored/backend-test/blob/main/mangareader.html"
  click BookCardHTML "https://github.com/alexanderthebored/backend-test/blob/main/components/book-card/book-card.html"
  click BookCardJS "https://github.com/alexanderthebored/backend-test/blob/main/components/book-card/book-card.js"
  click BookCardCSS "https://github.com/alexanderthebored/backend-test/blob/main/components/book-card/book-card.css"
  click LogoHTML "https://github.com/alexanderthebored/backend-test/blob/main/components/logo/logo.html"
  click LogoCSS "https://github.com/alexanderthebored/backend-test/blob/main/components/logo/logo.css"
  click HeaderHTML "https://github.com/alexanderthebored/backend-test/blob/main/components/header/header.html"
  click HeaderCSS "https://github.com/alexanderthebored/backend-test/blob/main/components/header/header.css"
  click Styles "https://github.com/alexanderthebored/backend-test/blob/main/styles/main.css"
  click DataJSON "https://github.com/alexanderthebored/backend-test/blob/main/data/manga.json"
  click Covers "https://github.com/alexanderthebored/backend-test/tree/main/assets/covers"
  click MangaPages "https://github.com/alexanderthebored/backend-test/tree/main/assets/manga"
  click BatchDL "https://github.com/alexanderthebored/backend-test/blob/main/tools/batch-download-manga.js"
  click ChapterDL "https://github.com/alexanderthebored/backend-test/blob/main/tools/download-chapter.js"
  click GenJSON "https://github.com/alexanderthebored/backend-test/blob/main/tools/generate-manga-json.js"
  click MDLink "https://github.com/alexanderthebored/backend-test/blob/main/tools/mangadex-link.js"
```
