# nitrosaccharose/star-rail-rater architecture

> Architecture diagram of the GitHub repository nitrosaccharose/star-rail-rater, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nitrosaccharose/star-rail-rater
- Repository: https://github.com/nitrosaccharose/star-rail-rater

## Overview

星铁评分器 is an in-development Honkai: Star Rail relic-reading tool. Its visible workflow captures the game screen, navigates relic inventory entries, recognizes relic details with OCR, and validates the resulting records. The README names scoring as the product goal, but the sampled source does not establish a scoring stage or its wiring. The tree contains text data files that may support domain lookups, but their contents and use are not evidenced here.

Main entry points: [`main.py`](https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py) (Relic detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game_io["Game interaction"]
  node_inventory_scan["Inventory scan<br/>[main.py]"]
  node_screen_capture["Screen capture<br/>[main.py]"]
  node_window_control["Window control<br/>[main.py]"]
  node_list_navigation["List navigation<br/>[main.py]"]
end

subgraph group_recognition["Image recognition"]
  node_image_processing["Image processing<br/>[main.py]"]
  node_ocr["OCR recognition<br/>[main.py]"]
  node_relic_detection["Relic detection<br/>[main.py]"]
end

subgraph group_relic_data["Relic processing"]
  node_relic_matching["Name matching<br/>[main.py]"]
  node_record_assembly["Record assembly<br/>[main.py]"]
  node_record_validation["Record validation<br/>[main.py]"]
  node_name_data["Name data<br/>[词条.txt]"]
  node_relic_data_file["Relic data<br/>[遗器.txt]"]
end

node_player(("Player"))
node_game["Game window"]
node_ocr_engine["PaddleOCR"]

node_inventory_scan -->|"captures screens"| node_screen_capture
node_inventory_scan -->|"navigates inventory"| node_list_navigation
node_inventory_scan -->|"controls window"| node_window_control
node_window_control -->|"foregrounds window"| node_game
node_list_navigation -->|"clicks and scrolls"| node_game
node_screen_capture -->|"captures display"| node_game
node_inventory_scan -->|"processes captures"| node_relic_detection
node_relic_detection -->|"prepares regions"| node_image_processing
node_relic_detection -->|"recognizes fields"| node_ocr
node_image_processing -->|"supplies images"| node_ocr
node_ocr -->|"invokes OCR"| node_ocr_engine
node_relic_detection -->|"matches names"| node_relic_matching
node_relic_detection -->|"assembles results"| node_record_assembly
node_record_assembly -->|"validates records"| node_record_validation
node_player -->|"uses tool"| node_inventory_scan

click node_inventory_scan "https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py"
click node_screen_capture "https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py"
click node_window_control "https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py"
click node_list_navigation "https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py"
click node_image_processing "https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py"
click node_ocr "https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py"
click node_relic_detection "https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py"
click node_relic_matching "https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py"
click node_record_assembly "https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py"
click node_record_validation "https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py"
click node_name_data "https://github.com/nitrosaccharose/star-rail-rater/blob/master/%E8%AF%8D%E6%9D%A1.txt"
click node_relic_data_file "https://github.com/nitrosaccharose/star-rail-rater/blob/master/%E9%81%97%E5%99%A8.txt"

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_inventory_scan,node_screen_capture,node_window_control,node_list_navigation toneBlue
class node_image_processing,node_ocr,node_relic_detection toneAmber
class node_relic_matching,node_record_assembly,node_record_validation,node_name_data,node_relic_data_file toneMint
class node_player,node_game,node_ocr_engine toneIndigo
```

## Components

### Game interaction

- [Inventory scan](https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py): `main.py`
- [Screen capture](https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py): `main.py`
- [Window control](https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py): `main.py`
- [List navigation](https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py): `main.py`

### Image recognition

- [Image processing](https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py): `main.py`
- [OCR recognition](https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py): `main.py`
- [Relic detection](https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py): `main.py`

### Relic processing

- [Name matching](https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py): `main.py`
- [Record assembly](https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py): `main.py`
- [Record validation](https://github.com/nitrosaccharose/star-rail-rater/blob/master/main.py): `main.py`
- [Name data](https://github.com/nitrosaccharose/star-rail-rater/blob/master/%E8%AF%8D%E6%9D%A1.txt): `词条.txt`
- [Relic data](https://github.com/nitrosaccharose/star-rail-rater/blob/master/%E9%81%97%E5%99%A8.txt): `遗器.txt`

### Other components

- **Player**
- **Game window**
- **PaddleOCR**

## Connections

- Inventory scan → Screen capture: captures screens
- Inventory scan → List navigation: navigates inventory
- Inventory scan → Window control: controls window
- Window control → Game window: foregrounds window
- List navigation → Game window: clicks and scrolls
- Screen capture → Game window: captures display
- Inventory scan → Relic detection: processes captures
- Relic detection → Image processing: prepares regions
- Relic detection → OCR recognition: recognizes fields
- Image processing → OCR recognition: supplies images
- OCR recognition → PaddleOCR: invokes OCR
- Relic detection → Name matching: matches names
- Relic detection → Record assembly: assembles results
- Record assembly → Record validation: validates records
- Player → Inventory scan: uses tool
