diff --git a/README.md b/README.md index 7217d7d..3f9ab56 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,12 @@ A web viewer for backups of the Android game **Idle Fantasy**. Parses `fantasyid ## Features - **Dashboard** with character, coins, skills, inventory, equipment, quests, and combat -- **Inventory** with text search, category filters, sorting, and grouped tables -- **SQLite history** — import multiple backups, compare snapshots, coins/level charts +- **Inventory** with text search, category filters, sorting, grouped tables, and quantity sparklines +- **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 export** — download the viewer SQLite database from the sidebar - **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 @@ -78,7 +82,25 @@ python app.py --host 0.0.0.0 --no-browser ### Import backups in the browser -Sidebar at the bottom: **Import backup** — selects a `.json` file. Duplicates (same file hash) are skipped. +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. + +### Goals + +Create targets from the **Inventory** or **Skills** tab (+ button per row), or manage them under **Goals**: + +- **Item goals** — absolute (reach total quantity) or relative (gain since creation) +- **Skill goals** — target level, absolute or relative +- **Groups** — organize goals, rename groups, clear completed entries +- **Progress** — missing quantity, ETA based on import history (items), completion banner on import +- Open goals are marked with 🎯 in inventory and skills tables + +### Navigation + +Tabs support URL hashes for bookmarking, e.g. `http://127.0.0.1:5000/v//#goals`. The global search field above the KPI row jumps to matching items, skills, or goals. + +### Export viewer database + +Sidebar: **Export viewer** — downloads `idle-fantasy-viewer-.db` (SQLite backup of all snapshots and goals). ## Multi-user (no login) @@ -171,7 +193,8 @@ 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 +├── db.py # SQLite snapshots, diff, timeline, goals +├── test_db_goals.py # Smoke tests for goals/import helpers ├── Dockerfile ├── docker-compose.yml ├── requirements.txt @@ -193,8 +216,20 @@ idle-fantasy-viewer/ | `POST /api/viewers` | Create a new viewer (rate limited) | | `GET /v//api/snapshot/latest` | Latest save for the viewer | | `GET /v//api/snapshots` | All snapshots | +| `DELETE /v//api/snapshots/` | Delete a snapshot (last one cannot be removed) | | `GET /v//api/snapshots//diff/` | Compare two snapshots | -| `GET /v//api/timeline` | Time series for charts | +| `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/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`) | +| `DELETE /v//api/goals/` | Delete a completed goal | +| `GET /v//api/goal-groups` | List goal groups | +| `POST /v//api/goal-groups` | Create a goal group | +| `PATCH /v//api/goal-groups/` | Rename a goal group | +| `DELETE /v//api/goal-groups/` | Delete a goal group (goals become ungrouped) | +| `GET /v//api/export` | Download viewer SQLite database | | `POST /v//api/import` | JSON file upload (`.json` only, rate limited) | ## Save format @@ -217,6 +252,14 @@ The game is actively developed — save files may contain new fields, items, or After import, errors and warnings appear as a banner in the dashboard; in the CLI on stderr. +## Tests + +```powershell +python test_db_goals.py +``` + +Smoke tests for relative/skill goals, import change summaries, skill timeline, and snapshot deletion. + ## License Private project — use at your own risk.