How chamakov/krona-vault works
KRONA VAULT is a self-hosted TCG-store credit, POS and custody platform with browser PWA portals and Node/edge API deployments. Its central workflow is a player-authorized POS redemption: the API routes the request to the ledger engine, which validates authorization, applies credit and produces a sealed voucher; the PWA supports offline access. Tournament pools, custody escrow, multi-store policy and forensic audit are distinct product branches. The source excerpts show API-to-engine/parser calls and PWA networking; unsampled subsystem links are included only where README documents them.
Main entry points: server.ts Node API · ledger-engine.ts Credit ledger engine · worker.ts Edge API · krona-core.js Portal client core
Components 18
PWA Portals
- Store and player portals
apps/web-pwa/public - Portal client core
apps/web-pwa/public/js/krona-core.js - Offline PWA cache
apps/web-pwa/public/sw.js
Credit & Accounting
- Credit ledger engine
apps/api/src/ledger-engine.ts - TOTP and seals
packages/crypto-totp/src/index.ts - Ledger database
infra/postgres/init.sql - Domain data types
packages/shared-types/src/index.ts
Store Operations
- POS vouchers
apps/web-pwa/public/pos.html - Player wallet
apps/web-pwa/public/wallet.html - Tournament prizes
apps/api/src/pokemon-standings-parser.ts - Custody escrow
apps/web-pwa/public/custody.html - Forensic audit
apps/web-pwa/public/audit.html - Store network
apps/web-pwa/public/stores.html
Other components
- Store operator
- Player
- Cloudflare D1
Connections 19
- Player → Player wallet: uses
README.md - Store operator → POS vouchers: checks out
README.md - POS vouchers → Store and player portals: served within
README.md - Player wallet → Store and player portals: served within
README.md - Store and player portals → Portal client core: uses
apps/web-pwa/public/js/krona-core.js - Portal client core → Node API: requests
apps/web-pwa/public/js/krona-core.js - Portal client core → Offline PWA cache: registers
apps/web-pwa/public/js/krona-core.js - Node API → Credit ledger engine: invokes
apps/api/src/server.ts - Edge API → Credit ledger engine: invokes
apps/api/src/worker.ts - Node API → Tournament prizes: parses standings
apps/api/src/server.ts - Edge API → Tournament prizes: parses standings
apps/api/src/worker.ts - Credit ledger engine → TOTP and seals: generates seals
apps/api/src/ledger-engine.ts - Node API → TOTP and seals: generates PIN
apps/api/src/server.ts - Edge API → Cloudflare D1: loads and saves
apps/api/src/worker.ts - Credit ledger engine → Ledger database: records entries
README.md - Store operator → Tournament prizes: imports standings
README.md - Store operator → Custody escrow: manages escrow
README.md - Store operator → Forensic audit: reviews activity
README.md - Store operator → Store network: configures branches
README.md