From 91444aec529e5db545434001f37525985bde26d9 Mon Sep 17 00:00:00 2001 From: elpatron Date: Mon, 22 Jun 2026 14:15:36 +0200 Subject: [PATCH] Update README with demo link, trend charts, combat, and deploy docs. Co-authored-by: Cursor --- README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5617c42..000a686 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,24 @@ # Idle Fantasy Save Viewer -A web viewer for backups of the Android game **Idle Fantasy**. Parses `fantasyidler_save.json` and displays skills, inventory, quests, and combat stats in a dark dashboard — with filters, item grouping, and history comparison via SQLite. +A web viewer for backups of the Android game **Idle Fantasy**. Parses `fantasyidler_save.json` and displays skills, inventory, quests, and combat stats in a dark dashboard — with filters, item grouping, snapshot history in SQLite, and **trend sparklines** for inventory, skills, and combat (from the second snapshot onward). + +**[Live demo](https://if-viewer.elpatron.me/)** — try the viewer in your browser (create a personal link, no account required). ## Features -- **Dashboard** with character, coins, skills, inventory, equipment, quests, and combat -- **Inventory** with text search, category filters, sorting, grouped tables, and quantity sparklines +- **Dashboard** — character, coins, slayer task, skills, inventory, equipment, quests, and combat at a glance +- **Inventory** — text search, category filters, sorting, grouped tables, equipped-item highlighting, quantity sparklines (click to enlarge) +- **Skills** — sortable table with level/XP progress and per-skill level sparklines +- **Combat** — enemy kills and dungeon runs (tables with trend sparklines), recent activity, active sessions +- **History** — coins and total level over time, top-skills chart, snapshot comparison (inventory/skill deltas), delete snapshots - **Goals** — item and skill targets in groups (absolute or relative), progress/ETA, completion on import - **Global search** across items, skills, and goals; deep links to tabs (`#overview`, `#goals`, …) -- **SQLite history** — import multiple backups, compare snapshots, coins/level/skill charts, delete snapshots - **Import summary** — dashboard card with changes since the previous snapshot (coins, level, top deltas) - **Viewer backup** — export/import the viewer SQLite database (snapshots, history, goals) - **Import** via CLI or browser upload - **Multi-user** without login — each player gets their own viewer via a secret link -- **Docker** — ready to run behind nginx Proxy Manager +- **PWA** — install hint and per-viewer service worker for home-screen / standalone use +- **Docker** — ready to run behind nginx Proxy Manager (includes container health check) - **i18n** — English as default/fallback, German optional; automatic browser language or manual selection in the sidebar ## Requirements @@ -64,6 +69,16 @@ docker compose logs -f docker compose down ``` +### Deploy to production + +For a git-based rollout to a remote Docker host (push → pull → `docker compose up --build` → wait for health check): + +```bash +bash scripts/deploy.sh +``` + +Configure via environment variables: `DEPLOY_HOST` (default `root@10.0.0.5`), `DEPLOY_DIR`, `DEPLOY_SERVICE`, `DEPLOY_HEALTH_RETRIES`, `DEPLOY_HEALTH_INTERVAL`. Requires a clean working tree, an upstream branch, and SSH access. The remote script lives in `scripts/deploy-remote.sh`. + ### More options ```powershell @@ -84,6 +99,26 @@ python app.py --host 0.0.0.0 --no-browser Sidebar at the bottom: **Import backup** — selects a `.json` file. Duplicates (same file hash) are skipped. After a successful import, a summary card on the overview tab shows changes compared to the previous snapshot. +Import multiple backups over time to unlock **trend charts** (sparklines appear from the second snapshot onward). + +### Trend charts + +Per-item, per-skill, and per-combat-entry mini charts in the **Inventory**, **Skills**, and **Combat** tabs: + +- Sparkline in the **Trend** column when at least two snapshots exist and the value changed at least twice +- Click a sparkline to open a larger Chart.js modal with the full time series +- **History** tab: aggregate charts for coins, total level, and top skills over time; pick two snapshots to compare inventory and skill deltas + +Timeline data is derived from stored snapshots (`/api/inventory/timeline`, `/api/skills/timeline`, `/api/combat/timeline`). + +### Combat + +The **Combat** tab shows: + +- **Enemy kills** and **dungeon runs** — sorted tables with kill/run counts and optional trend sparklines +- **Recent activity** and **active sessions** from the latest save +- Slayer task progress on the overview tab (when present in the save) + ### Goals Create targets from the **Inventory** or **Skills** tab (+ button per row), or manage them under **Goals**: @@ -203,18 +238,22 @@ idle-fantasy-viewer/ ├── viewers.py # Viewer IDs and isolation ├── parser.py # Parse and normalize saves ├── categories.py # Item categories (heuristics) -├── db.py # SQLite snapshots, diff, timeline, goals +├── db.py # SQLite snapshots, diff, timelines, goals ├── test_db_goals.py # Smoke tests for goals/import helpers ├── Dockerfile ├── docker-compose.yml ├── requirements.txt +├── scripts/ +│ ├── deploy.sh # Push + remote Docker deploy +│ └── deploy-remote.sh # Runs on the server (git pull, compose) ├── static/ │ ├── vendor/ # chart.umd.min.js (bundled) │ ├── i18n.js # Locale loading, t(), en fallback │ ├── locales/ # en.json, de.json │ ├── landing.js # Landing page +│ ├── pwa.js # PWA install hint, service worker │ └── app.js # Dashboard UI -├── templates/ # HTML +├── templates/ # HTML (incl. optional Plausible analytics partial) └── data/ # viewers/*.db (gitignored) ``` @@ -230,7 +269,8 @@ idle-fantasy-viewer/ | `GET /v//api/snapshots//diff/` | Compare two snapshots | | `GET /v//api/timeline` | Time series for coins/level charts | | `GET /v//api/inventory/timeline` | Per-item quantity series for sparklines | -| `GET /v//api/skills/timeline` | Per-skill level series for history charts | +| `GET /v//api/skills/timeline` | Per-skill level series for sparklines and history chart | +| `GET /v//api/combat/timeline` | Per-enemy kill and dungeon-run series for sparklines | | `GET /v//api/goals` | Structured goals (groups + ungrouped) | | `GET /v//api/goals/overview` | Open/completed/total goal counts | | `POST /v//api/goals` | Create item or skill goal (`goal_type`, `mode`, `group_id`) | @@ -271,6 +311,10 @@ python test_db_goals.py Smoke tests for relative/skill goals, import change summaries, skill timeline, and snapshot deletion. +## Analytics (optional) + +The demo at [if-viewer.elpatron.me](https://if-viewer.elpatron.me/) may include [Plausible](https://plausible.io/) analytics via `templates/_analytics.html` (privacy-friendly, no cookies). Self-hosted instances can omit or replace this partial; CSP in `security.py` allows `plausible.elpatron.me` when enabled. Client events use tagged `plausible()` calls in `app.js` (e.g. viewer create, import, snapshot delete). + ## License Private project — use at your own risk.