Files
tft/README.md
2026-09-07 07:44:09 +02:00

51 lines
1.3 KiB
Markdown

# TFT-Simulator
Trainings-Tool: TFT-Runden schnell simulieren, 1 Spieler vs. 7 Bots.
Kampf = deterministische DPS-Simulation (`sim/combat.py`) auf Unit-Profilen aus
exakten Community-Dragon-Werten (`model/statsheet.py`: eHP und DPS je Unit).
`model/score.py` liefert daraus die angezeigte Boardstärke und die Kalibrierung.
Hinweis: die aus Matchdaten gelernten Gewichte (`model/learn.py`) landen im
Artifact, werden vom Scorer aber derzeit **nicht** gelesen.
## Setup
```sh
cd backend
uv sync
uv run pytest
```
## Pipeline
```sh
uv run python -m tft.cli fetch-static # Community Dragon, kein Key nötig
uv run python -m tft.cli crawl # braucht RIOT_API_KEY in .env
uv run python -m tft.cli extract
uv run python -m tft.cli build-artifact
uv run python -m tft.cli calibrate
uv run python -m tft.cli refresh # crawl + extract + build-artifact (für Cron)
```
Riot-Dev-Key: https://developer.riotgames.com (24h gültig), in `backend/.env` als `RIOT_API_KEY=...`.
Täglicher Refresh per Cron (Key muss gültig sein):
```
15 6 * * * cd /home/arbeit/projects/tft/backend && uv run python -m tft.cli refresh >> ../data/refresh.log 2>&1
```
## Server
```sh
uv run uvicorn tft.api.app:app --reload --port 8123
```
## Frontend
```sh
cd frontend
npm install
npm run dev # Proxy /api -> localhost:8123
```