# tiagozip/asn-data architecture

> Architecture diagram of the GitHub repository tiagozip/asn-data, 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/tiagozip/asn-data
- Repository: https://github.com/tiagozip/asn-data

## Overview

This repository is a static ASN directory: clients fetch per-ASN PeeringDB records and can fetch corresponding website favicons. Weekly refreshes retrieve PeeringDB data, update changed JSON files, and fetch favicon images for changed networks with websites. The README also describes resolving the record’s logo field to PeeringDB’s media host. The refresh implementation is sampled; static hosting behavior and the documented media URL handling are represented only at the level supported by the README.

Main entry points: [`build.js`](https://github.com/tiagozip/asn-data/blob/main/build.js) (Refresh process), [`asn`](https://github.com/tiagozip/asn-data/tree/main/asn) (ASN records), [`logos`](https://github.com/tiagozip/asn-data/tree/main/logos) (Favicon images)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_refresh["Data refresh"]
  node_builder["Refresh process<br/>[build.js]"]
end

subgraph group_catalog["Static catalog"]
  node_asn_files["ASN records"]
  node_logo_files["Favicon images"]
end

node_scheduler(("Weekly trigger"))
node_peeringdb["PeeringDB API"]
node_favicon_service["Favicon service"]
node_static_host["Static hosting"]
node_client(("Directory client"))
node_media_host["PeeringDB media"]

node_scheduler -->|"starts weekly"| node_builder
node_builder -->|"fetches records"| node_peeringdb
node_builder -->|"updates JSON"| node_asn_files
node_builder -->|"requests icons"| node_favicon_service
node_builder -->|"writes icons"| node_logo_files
node_static_host -->|"serves files"| node_asn_files
node_static_host -->|"serves files"| node_logo_files
node_client -->|"requests record or icon"| node_static_host
node_client -.->|"may resolve logo URL"| node_media_host

click node_builder "https://github.com/tiagozip/asn-data/blob/main/build.js"
click node_asn_files "https://github.com/tiagozip/asn-data/tree/main/asn"
click node_logo_files "https://github.com/tiagozip/asn-data/tree/main/logos"

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_builder,node_client toneBlue
class node_asn_files,node_logo_files toneAmber
class node_scheduler,node_favicon_service,node_static_host,node_media_host toneIndigo
class node_peeringdb toneMint
```

## Components

### Data refresh

- [Refresh process](https://github.com/tiagozip/asn-data/blob/main/build.js): `build.js`

### Static catalog

- [ASN records](https://github.com/tiagozip/asn-data/tree/main/asn): `asn`
- [Favicon images](https://github.com/tiagozip/asn-data/tree/main/logos): `logos`

### Other components

- **Weekly trigger**
- **PeeringDB API**
- **Favicon service**
- **Static hosting**
- **Directory client**
- **PeeringDB media**

## Connections

- Weekly trigger → Refresh process: starts weekly
- Refresh process → PeeringDB API: fetches records
- Refresh process → ASN records: updates JSON
- Refresh process → Favicon service: requests icons
- Refresh process → Favicon images: writes icons
- Static hosting → ASN records: serves files
- Static hosting → Favicon images: serves files
- Directory client → Static hosting: requests record or icon
- Directory client → PeeringDB media: may resolve logo URL
