# mar-7th/starrailres architecture

> Architecture diagram of the GitHub repository mar-7th/starrailres, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mar-7th/starrailres
- Repository: https://github.com/mar-7th/starrailres

## Overview

##### Main Components
- Resource Assets:
- Image Folder: Contains various game images including character portraits, previews, and simulated event images.
- Guide Folder: Contains tutorial images which may assist in understanding or utilizing the resource data.
- Index Files:
- index_new: Holds the detailed and current game data in a language-specific structure. Each language subdirectory (e.g., en, cn, jp, etc.) comprises various JSON files for paths, elements, characters, skills, promotions, relics, and items.
- index_min: Holds compressed versions of the same indexes for potentially lighter-weight use cases.
- Metadata and Configurations:
- info.json and other files like LICENSE, .gitignore, README.md, which explain the project and provide guidelines and meta-information.
- External References:
- Link to the Dimbreath/StarRailData repository, indicating the project’s external data source for game data. This source information might be noted externally or as a dependency.

##### Relationship and Interaction Representation
- Index_new and index_min as nodes that “reference” or “point to” data used throughout the application. Each language subdirectory within these indexes can be abstracted as components containing specific JSON files. You might consider grouping these JSON files under a “Language Node” where you list items such as:
– paths.json (命途)
– elements.json (元素)
– properties.json (属性)
– characters.json (角色基本信息)
– character_ranks.json, character_skills.json, character_promotions.json, etc.
– light_cone and relic related JSON files.

##### Architectural Patterns and Design Principles
- Separation of static assets from dynamic content, even though all resources are file-based.
- Structured approach to localization: having directories in both index_new and index_min segregated by language clearly shows the support for multiple locales.

##### Relevant Technologies, Frameworks, or Libraries
- Primarily, the project revolves around JSON data and static assets. While there’s no runtime backend indicated, note the use of JSON for structured data, which may later be consumed by other tools or applications.
- Mention that since it’s a static repository, any integration with external systems (for example, frontends that display these resources) would treat these folders as consistent, read-only data sources.

##### Essential Elements to Incorporate
- Clear labels on every node (asset folders, index directories, individual language subdirectories, meta files).

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["StarRailRes Repository"]:::repository

    %% Resource Assets Subgraph
    subgraph "Resource Assets"
        ICON["Icon Folder"]:::icon
        IMAGE["Image Folder"]:::image
        GUIDE["Guide Folder"]:::guide
    end

    %% Index Files Subgraph
    subgraph "Index Files"
        subgraph "Full Game Data (index_new)"
            INDEX_NEW["index_new"]:::fullData
            subgraph "Languages"
                EN1["en JSON Files"]:::lang
                CN1["cn JSON Files"]:::lang
                JP1["jp JSON Files"]:::lang
            end
            INDEX_NEW --> EN1
            INDEX_NEW --> CN1
            INDEX_NEW --> JP1
        end
        subgraph "Compressed Game Data (index_min)"
            INDEX_MIN["index_min"]:::compData
            subgraph "Languages"
                EN2["en JSON Files"]:::lang
                CN2["cn JSON Files"]:::lang
                JP2["jp JSON Files"]:::lang
            end
            INDEX_MIN --> EN2
            INDEX_MIN --> CN2
            INDEX_MIN --> JP2
        end
    end

    %% Metadata and Configurations Subgraph
    subgraph "Metadata & Configurations"
        M1["info.json"]:::meta
        M2["LICENSE"]:::meta
        M3[".gitignore"]:::meta
        M4["README.md"]:::meta
    end

    %% External Data Source
    EXT["Game Data Source (Dimbreath/StarRailData)"]:::external

    %% Top-Level Connections from Repository
    A --> ICON
    A --> INDEX_NEW
    A --> M1

    %% External Data Source referencing Index Data
    EXT -.-> INDEX_NEW
    EXT -.-> INDEX_MIN

    %% Example references from language data to resource assets
    EN1 -->|"references"| ICON
    CN1 -->|"references"| IMAGE
    JP1 -->|"references"| GUIDE
    EN2 -->|"references"| ICON
    CN2 -->|"references"| IMAGE
    JP2 -->|"references"| GUIDE

    %% Click Events for Component Mapping
    click ICON "https://github.com/mar-7th/starrailres/tree/master/icon/"
    click IMAGE "https://github.com/mar-7th/starrailres/tree/master/image/"
    click INDEX_NEW "https://github.com/mar-7th/starrailres/tree/master/index_new/"
    click INDEX_MIN "https://github.com/mar-7th/starrailres/tree/master/index_min/"
    click M1 "https://github.com/mar-7th/starrailres/blob/master/info.json"
    click M2 "https://github.com/mar-7th/starrailres/tree/master/LICENSE"
    click M3 "https://github.com/mar-7th/starrailres/blob/master/.gitignore"
    click M4 "https://github.com/mar-7th/starrailres/blob/master/README.md"

    %% Styles
    classDef repository fill:#f9f,stroke:#333,stroke-width:2px;
    classDef icon fill:#aaf,stroke:#333,stroke-width:2px;
    classDef image fill:#aaf,stroke:#333,stroke-width:2px;
    classDef guide fill:#aaf,stroke:#333,stroke-width:2px;
    classDef fullData fill:#c9f,stroke:#333,stroke-width:2px;
    classDef compData fill:#9cf,stroke:#333,stroke-width:2px;
    classDef lang fill:#efe,stroke:#333,stroke-width:2px;
    classDef meta fill:#ff9,stroke:#333,stroke-width:2px;
    classDef external fill:#f99,stroke:#333,stroke-width:2px;
```
