# crowonslaught/js-cardfight-vanguard-library architecture

> Architecture diagram of the GitHub repository crowonslaught/js-cardfight-vanguard-library, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/crowonslaught/js-cardfight-vanguard-library
- Repository: https://github.com/crowonslaught/js-cardfight-vanguard-library

## Overview

This is a small TypeScript client library for the Cardfight Vanguard API. A consumer imports the public exports and calls card-search, single-card, or set retrieval functions; those functions make HTTP requests and return API data or an error object. Card search also serializes query parameters through a helper. The source excerpts show these calls and exports; set and card capabilities are documented in the README. The external API is represented as a single service because its implementation is outside this repository.

Main entry points: [`src/index.ts`](https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/index.ts) (Exported functions), [`src/services/getCards.ts`](https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/services/getCards.ts) (Search cards), [`src/services/getSets.ts`](https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/services/getSets.ts) (List sets), [`src/helpers/utils.ts`](https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/helpers/utils.ts) (Query serializer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public API"]
  node_entry["Exported functions<br/>[index.ts]"]
end

subgraph group_retrieval["Data retrieval"]
  node_cards["Search cards<br/>[getCards.ts]"]
  node_card["Fetch card<br/>[getCards.ts]"]
  node_sets["List sets<br/>[getSets.ts]"]
  node_query["Query serializer<br/>[utils.ts]"]
end

node_consumer(("Library consumer"))
node_remote{{"Vanguard API"}}

node_consumer -->|"imports"| node_entry
node_entry -->|"exports"| node_cards
node_entry -->|"exports"| node_card
node_entry -->|"exports"| node_sets
node_cards -->|"serializes params"| node_query
node_cards -->|"requests cards"| node_remote
node_card -->|"requests card"| node_remote
node_sets -->|"requests sets"| node_remote

click node_entry "https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/index.ts"
click node_cards "https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/services/getCards.ts"
click node_card "https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/services/getCards.ts"
click node_sets "https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/services/getSets.ts"
click node_query "https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/helpers/utils.ts"

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_entry toneBlue
class node_cards,node_card,node_sets,node_query toneAmber
class node_consumer toneIndigo
class node_remote toneMint
```

## Components

### Public API

- [Exported functions](https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/index.ts): `src/index.ts`

### Data retrieval

- [Search cards](https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/services/getCards.ts): `src/services/getCards.ts`
- [Fetch card](https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/services/getCards.ts): `src/services/getCards.ts`
- [List sets](https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/services/getSets.ts): `src/services/getSets.ts`
- [Query serializer](https://github.com/crowonslaught/js-cardfight-vanguard-library/blob/master/src/helpers/utils.ts): `src/helpers/utils.ts`

### Other components

- **Library consumer**
- **Vanguard API**

## Connections

- Library consumer → Exported functions: imports (evidence: `README.md`)
- Exported functions → Search cards: exports (evidence: `src/index.ts`)
- Exported functions → Fetch card: exports (evidence: `src/index.ts`)
- Exported functions → List sets: exports (evidence: `src/index.ts`)
- Search cards → Query serializer: serializes params (evidence: `src/services/getCards.ts`)
- Search cards → Vanguard API: requests cards (evidence: `src/services/getCards.ts`)
- Fetch card → Vanguard API: requests card (evidence: `src/services/getCards.ts`)
- List sets → Vanguard API: requests sets (evidence: `src/services/getSets.ts`)
