A lightweight, Bun-powered Next.js app for running D&D 5e initiative with local-only storage. Add combatants, track turns and rounds, and adjust hit points quickly during play.
- Add combatants with initiative, max HP, and AC; sorting is automatic (initiative desc, then name).
- Start combat to set the active combatant and round counter; advance turn cycles and increments rounds on wrap.
- Adjust HP inline with absolute values (e.g.,
12) or deltas (-5,+3) with clamping to 0…max. - State persists in
localStorage; clearing wipes the encounter.
- Next.js App Router, React 19, TypeScript
- Tailwind CSS 4 (utility styling)
- Bun for install, dev server, and tests
Prereq: Bun installed.
- Install deps:
bun install - Start dev server:
bun devthen open http://localhost:3000 - Build for production:
bun run build(served viabun start)
- Add each combatant with name, initiative, max HP, and AC.
- Click Start Combat to lock the order and highlight the active turn.
- Use Next Turn to advance; the round counter increments on wrap.
- Adjust HP in the input with numbers (set) or
+/-deltas, then Apply or press Enter; values clamp between 0 and max. - Clear resets everything, including persisted state.
- Run tests:
bun test - Lint:
bun lint