- TypeScript 55%
- Python 24.6%
- JavaScript 19.5%
- HTML 0.6%
- CSS 0.3%
| .github | ||
| app | ||
| data | ||
| docs/roadmap | ||
| GURPS | ||
| schema | ||
| tests | ||
| tools | ||
| .gitignore | ||
| CONCEPT.md | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| start.py | ||
| tailwind.config.js | ||
| tsconfig.json | ||
| vite.config.ts | ||
LootGenerator
A local, static, browser-based loot generator for GURPS pen-and-paper sessions.
Data is curated in Git as JSON and bundled into a single static HTML/JS app that
runs from file:// — no server required.
See CONCEPT.md for the design and docs/roadmap/ for milestone plans.
Status
v0.1 MVP: engine, schemas, tooling, and a minimal React UI. Ships with a tiny
hand-crafted data/test/ pack so the whole pipeline can be exercised end-to-end.
Requirements
- Node.js 20+ (uses the built-in test runner).
- npm 9+.
Setup
npm install
Develop
npm run dev
Runs the bundler then starts Vite on a local dev server.
Build a distributable
npm run build
This:
- Validates every JSON file against its schema and the cross-reference rules.
- Runs the unit tests.
- Bundles all data into
app/public/data.bundle.json. - Builds the Vite app into
dist/.
Open dist/index.html directly from disk — it works via file://.
Test
npm test
Runs all tests/**/*.test.ts via Node's built-in test runner (TypeScript loaded
through tsx).
Validate data only
npm run validate
Checks schemas, cross-references, dedupe, and lootEffects cycles.
Layout
app/ Vite app (TypeScript + React + Tailwind)
src/engine/ Pure-function loot engine (RNG, dice, weighted picker, generator)
src/ui/ React UI
data/ One folder per setting (test pack ships with this MVP)
schema/ JSON Schemas + controlled modifier-slot vocabulary
tools/ validate.mjs, bundle.mjs, shared lib
tests/ Engine tests + fixtures
docs/roadmap/ Per-milestone work instructions
Reproducibility
Provide a seed in the UI (or pass seed to generate()) and the same
inputs always produce the same loot list.