# tariq-2/rdr2collectorsmap architecture

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

- Interactive diagram: https://gitdiagram.com/tariq-2/rdr2collectorsmap
- Repository: https://github.com/tariq-2/rdr2collectorsmap

## Overview

RDR2CollectorsMap is a browser-based Red Dead Online collectibles map. The main user journey is to open the map and use its map, item, cycle, and route features to locate collectibles; the README identifies the product but does not document these interactions in detail. The tree shows supporting data and feature modules, while the sampled source is mostly development utilities, so internal connections are omitted or marked unverified rather than inferred as confirmed calls.

Main entry points: [`assets/js/map.js`](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/map.js) (Map runtime), [`assets/js/marker.js`](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/marker.js) (Map markers), [`data/items.json`](https://github.com/tariq-2/rdr2collectorsmap/blob/master/data/items.json) (Collectible data), [`dev/route-generator-nn-algorithm.js`](https://github.com/tariq-2/rdr2collectorsmap/blob/master/dev/route-generator-nn-algorithm.js) (Nearest-neighbor route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Map experience"]
  node_collectors_map["Collectors map<br/>[index.html]"]
  node_map_runtime["Map runtime<br/>[map.js]"]
  node_map_layers["Map layers<br/>[layers.js]"]
  node_map_markers["Map markers<br/>[marker.js]"]
  node_menu_settings["Menu and settings<br/>[menu.js]"]
  node_image_cache["Image cache<br/>[service-worker.js]"]
end

subgraph group_features["Map features"]
  node_item_catalog["Item catalog<br/>[items.js]"]
  node_inventory["Inventory<br/>[inventory.js]"]
  node_rdo_inventory["RDO inventory<br/>[rdo-inventory.js]"]
  node_treasures["Treasure locations<br/>[treasures.js]"]
  node_nazar["Madam Nazar<br/>[nazar.js]"]
  node_legendary_animals["Legendary animals<br/>[legendary.js]"]
  node_cycles["Collection cycles<br/>[cycles.js]"]
  node_routes["Routes<br/>[routes.js]"]
  node_language["Localization<br/>[language.js]"]
end

subgraph group_content["Map content"]
  node_collectible_data["Collectible data<br/>[items.json]"]
  node_cycle_data["Cycle data<br/>[cycles.json]"]
  node_treasure_data["Treasure data<br/>[treasures.json]"]
  node_map_geojson["Map geography"]
  node_translations["Translations"]
end

subgraph group_utilities["Route and data utilities"]
  node_nearest_route["Nearest-neighbor route"]
  node_tsp_route["TSP route"]
  node_coordinate_port["Coordinate conversion"]
  node_video_port["Video data conversion"]
end

node_visitor(("Map user"))

node_visitor -->|"opens"| node_collectors_map
node_collectors_map -.->|"uses"| node_map_runtime
node_map_runtime -.->|"uses"| node_map_layers
node_map_runtime -.->|"uses"| node_map_markers
node_menu_settings -.->|"configures"| node_map_runtime
node_item_catalog -.->|"loads"| node_collectible_data
node_cycles -.->|"loads"| node_cycle_data
node_treasures -.->|"loads"| node_treasure_data
node_map_layers -.->|"loads"| node_map_geojson
node_language -.->|"loads"| node_translations
node_nearest_route -->|"routes visible markers"| node_map_markers
node_nearest_route -->|"draws route"| node_map_runtime
node_tsp_route -->|"orders visible markers"| node_map_markers
node_tsp_route -->|"draws route"| node_map_runtime
node_coordinate_port -.->|"formats coordinates"| node_collectible_data
node_video_port -.->|"converts item data"| node_collectible_data
node_image_cache -->|"caches image requests"| node_visitor

click node_collectors_map "https://github.com/tariq-2/rdr2collectorsmap/blob/master/index.html"
click node_map_runtime "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/map.js"
click node_map_layers "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/layers.js"
click node_map_markers "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/marker.js"
click node_menu_settings "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/menu.js"
click node_item_catalog "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/items.js"
click node_inventory "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/inventory.js"
click node_rdo_inventory "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/rdo-inventory.js"
click node_treasures "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/treasures.js"
click node_nazar "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/nazar.js"
click node_legendary_animals "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/legendary.js"
click node_cycles "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/cycles.js"
click node_routes "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/routes.js"
click node_language "https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/language.js"
click node_collectible_data "https://github.com/tariq-2/rdr2collectorsmap/blob/master/data/items.json"
click node_cycle_data "https://github.com/tariq-2/rdr2collectorsmap/blob/master/data/cycles.json"
click node_treasure_data "https://github.com/tariq-2/rdr2collectorsmap/blob/master/data/treasures.json"
click node_map_geojson "https://github.com/tariq-2/rdr2collectorsmap/tree/master/data/geojson"
click node_translations "https://github.com/tariq-2/rdr2collectorsmap/tree/master/langs"
click node_nearest_route "https://github.com/tariq-2/rdr2collectorsmap/blob/master/dev/route-generator-nn-algorithm.js"
click node_tsp_route "https://github.com/tariq-2/rdr2collectorsmap/blob/master/dev/route-generator-tsp-algorithm.js"
click node_coordinate_port "https://github.com/tariq-2/rdr2collectorsmap/blob/master/dev/port-source-coords-to-website-coords.js"
click node_video_port "https://github.com/tariq-2/rdr2collectorsmap/blob/master/dev/port-video-old-to-new.js"
click node_image_cache "https://github.com/tariq-2/rdr2collectorsmap/blob/master/service-worker.js"

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_collectors_map,node_map_runtime,node_map_layers,node_map_markers,node_menu_settings,node_image_cache,node_visitor toneBlue
class node_item_catalog,node_inventory,node_rdo_inventory,node_treasures,node_nazar,node_legendary_animals,node_cycles,node_routes,node_language toneAmber
class node_collectible_data,node_cycle_data,node_treasure_data,node_map_geojson,node_translations toneMint
class node_nearest_route,node_tsp_route,node_coordinate_port,node_video_port toneRose
```

## Components

### Map experience

- [Collectors map](https://github.com/tariq-2/rdr2collectorsmap/blob/master/index.html): `index.html`
- [Map runtime](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/map.js): `assets/js/map.js`
- [Map layers](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/layers.js): `assets/js/layers.js`
- [Map markers](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/marker.js): `assets/js/marker.js`
- [Menu and settings](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/menu.js): `assets/js/menu.js`
- [Image cache](https://github.com/tariq-2/rdr2collectorsmap/blob/master/service-worker.js): `service-worker.js`

### Map features

- [Item catalog](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/items.js): `assets/js/items.js`
- [Inventory](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/inventory.js): `assets/js/inventory.js`
- [RDO inventory](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/rdo-inventory.js): `assets/js/rdo-inventory.js`
- [Treasure locations](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/treasures.js): `assets/js/treasures.js`
- [Madam Nazar](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/nazar.js): `assets/js/nazar.js`
- [Legendary animals](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/legendary.js): `assets/js/legendary.js`
- [Collection cycles](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/cycles.js): `assets/js/cycles.js`
- [Routes](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/routes.js): `assets/js/routes.js`
- [Localization](https://github.com/tariq-2/rdr2collectorsmap/blob/master/assets/js/language.js): `assets/js/language.js`

### Map content

- [Collectible data](https://github.com/tariq-2/rdr2collectorsmap/blob/master/data/items.json): `data/items.json`
- [Cycle data](https://github.com/tariq-2/rdr2collectorsmap/blob/master/data/cycles.json): `data/cycles.json`
- [Treasure data](https://github.com/tariq-2/rdr2collectorsmap/blob/master/data/treasures.json): `data/treasures.json`
- [Map geography](https://github.com/tariq-2/rdr2collectorsmap/tree/master/data/geojson): `data/geojson`
- [Translations](https://github.com/tariq-2/rdr2collectorsmap/tree/master/langs): `langs`

### Route and data utilities

- [Nearest-neighbor route](https://github.com/tariq-2/rdr2collectorsmap/blob/master/dev/route-generator-nn-algorithm.js): `dev/route-generator-nn-algorithm.js`
- [TSP route](https://github.com/tariq-2/rdr2collectorsmap/blob/master/dev/route-generator-tsp-algorithm.js): `dev/route-generator-tsp-algorithm.js`
- [Coordinate conversion](https://github.com/tariq-2/rdr2collectorsmap/blob/master/dev/port-source-coords-to-website-coords.js): `dev/port-source-coords-to-website-coords.js`
- [Video data conversion](https://github.com/tariq-2/rdr2collectorsmap/blob/master/dev/port-video-old-to-new.js): `dev/port-video-old-to-new.js`

### Other components

- **Map user**

## Connections

- Map user → Collectors map: opens (evidence: `README.md`)
- Collectors map → Map runtime: uses
- Map runtime → Map layers: uses
- Map runtime → Map markers: uses
- Menu and settings → Map runtime: configures
- Item catalog → Collectible data: loads
- Collection cycles → Cycle data: loads
- Treasure locations → Treasure data: loads
- Map layers → Map geography: loads
- Localization → Translations: loads
- Nearest-neighbor route → Map markers: routes visible markers (evidence: `dev/route-generator-nn-algorithm.js`)
- Nearest-neighbor route → Map runtime: draws route (evidence: `dev/route-generator-nn-algorithm.js`)
- TSP route → Map markers: orders visible markers (evidence: `dev/route-generator-tsp-algorithm.js`)
- TSP route → Map runtime: draws route (evidence: `dev/route-generator-tsp-algorithm.js`)
- Coordinate conversion → Collectible data: formats coordinates
- Video data conversion → Collectible data: converts item data
- Image cache → Map user: caches image requests (evidence: `service-worker.js`)
