NilsBriggen 04fa90e580 Proper guided character builder + level-up wizard
The bare name/class/level form left new characters as shells (1 HP, all-10
abilities, no proficiencies). Now creation and level-up are guided and auto-populate.

- Hand-authored progression tables (no SRD class/slot data exists on disk):
  src/lib/rules/{dnd5e,pf2e}/progression.ts — core classes' hit die/HP, key
  abilities, save & perception proficiencies, trained-skill counts, caster type;
  5e full/half/pact spell-slot tables, pf2e slot approximation; ASI/boost/skill
  schedules.
- src/lib/rules/progression.ts: getClassDefs/getClassDef, classSkillChoices/Count,
  buildCharacter() (HP from hit die + CON over levels, trained saves/skills, spell
  slots + ability), planLevelUp() (HP gain, new slots, ASI/boost/skill choices),
  applyIncreases/bumpRank. Pure + 12 unit tests.
- Multi-step CreationWizard (Basics → Abilities → Skills → Review) replaces the
  old form; pulls PF2e ancestry HP/speed from the bestiary; review previews HP/AC/
  saves/skills/slots; lands on a ready-to-play sheet.
- LevelUpModal reworked into a guided wizard: auto HP + spell slots, presents the
  level's actual choices (5e ASI/feat, pf2e ability boosts + skill increase) and
  applies them; keeps the strategic build-route advisor.

e2e helper drives the wizard; updated 7 specs to the new flow; new character-wizard
spec asserts a complete level-3 Wizard (HP 17, slots 4xL1 2xL2).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 09:55:48 +02:00
2026-06-07 23:47:39 +02:00
2026-06-07 23:47:39 +02:00
2026-06-07 23:47:39 +02:00
2026-06-07 23:47:39 +02:00
2026-06-07 23:47:39 +02:00
2026-06-07 23:47:39 +02:00

TTRPG Manager

A local-first campaign manager for D&D 5e and Pathfinder 2e, built for both Game Masters and players. Runs entirely in the browser (installable as a PWA) — your data lives in IndexedDB on your device; no account, no server.

Features (MVP)

  • Campaigns — create per-system campaigns; deleting one cascades to all its data.
  • Characters — 5e/PF2e sheets with live derived stats: ability modifiers, proficiency, skills, saves, AC, initiative, HP (with damage/heal/temp). Autosaves.
  • Combat tracker — initiative order, round/turn tracking, conditions, HP, and add/remove/reorder mid-fight without ever corrupting whose turn it is.
  • Dice — full notation (2d6+3, 4d6kh3), advantage/disadvantage, seedable RNG, per-campaign roll history.
  • Compendium — searchable SRD bestiary, spells, and magic items. Add any monster straight into the open encounter.

Tech

  • React 19 + TypeScript (strict) + Vite
  • TanStack Router · Zustand · Zod · Dexie (IndexedDB) · Tailwind v4 · Fuse.js
  • Vitest (unit) + Playwright (e2e), PWA via vite-plugin-pwa

Architecture

src/
  lib/
    rules/        # game-system abstraction — 5e & pf2e behind one RulesSystem interface
    combat/       # pure, tested turn-order + HP engine
    dice/         # notation parser + roller
    db/           # Dexie schema + repositories (cascade deletes, validation on write)
    schemas/      # Zod entity schemas — every number rejects NaN/Infinity
    compendium/   # lazy SRD data loaders (code-split out of the main bundle)
  features/       # campaigns, characters, combat, dice, compendium (UI)
  components/ui/  # design-system primitives
  data/srd/       # SRD JSON (Open5e + MPMB); regenerate with scripts/fetch_data.py

The rules layer means features never branch on if (system === '5e'); they call the RulesSystem interface, so adding a system is a self-contained module.

Development

bun install
bun run dev          # dev server at http://localhost:5173
bun run test         # unit tests (vitest)
bun run test:e2e     # end-to-end (playwright)
bun run build        # typecheck + production build
bun run lint

Roadmap

Notes/journal, maps with fog of war, encounter/loot builders, a shared player view, PF2e compendium data, and an optional sync backend for real-time tables.

History

This is a from-scratch rebuild. The previous implementation (deleted) had ~135 documented bugs and no version control; its bug report is kept at docs/OLD_BUG_HUNT_REPORT.md as a record of failure modes designed against here (silent data loss, turn-order corruption, no cascade deletes, NaN inputs, dead Tauri integration). The SRD data and Python scrapers were preserved.

S
Description
No description provided
Readme 17 MiB
Languages
TypeScript 98.7%
CSS 0.6%
Python 0.5%
JavaScript 0.1%