# Final Wishes — Overview > An encrypted, printable "in the event of my death or incapacity" guide that lives on a thumbdrive as a single self-contained HTML file, so a non-technical executor can open it on any PC or Mac with one passphrase and print it. ## Purpose The owner keeps accounts, documents, contacts, wind-down steps and similar life-admin information in one document that is encrypted at rest. It began as an 8-page 2022 PDF with plaintext secrets (`abi-wishes.pdf`, never committed). The executor double-clicks `final-wishes.html`, enters a passphrase, reads the guide in the browser and prints it. The owner edits the same file and saves it back to the drive. There is no server, no install and no network access. ## Tech Stack | Layer | Technology | |-------|-----------| | Language / runtime | Vanilla JavaScript (ES modules in source). Browser for the app, Node 20+ for build and tests. | | UI | Hand-written DOM code (`h()` helper, `textContent` only, no `innerHTML`), plain CSS with light/dark themes | | Crypto | WebCrypto: PBKDF2-SHA256 (600,000 iterations) into AES-256-GCM | | Build | `build.js`: concatenates `src/*.js`, no bundler, no dependencies | | Tests | `node --test` (built-in runner). Browser behavior was checked by hand with headless Chromium over CDP, which is not part of the repo. | | Hosting / issues | Gitea (`gitea.ericthered.tech`), `gt` CLI. Issues #1–#19 track the work. | There are no npm dependencies and no CDN or network calls at runtime. ## Directory Structure ``` build.js builds dist/final-wishes.html (optionally encrypting a JSON file into it) sanitize.js `node sanitize.js --in real.html --out copy.html`: re-seals a copy with secrets erased under a new passphrase bump-version.js `npm run bump`, and the pre-commit hook's engine: advances src/version.js to today's date + next letter .githooks/pre-commit runs `bump-version.js --staged`; enable once per clone with `npm run hooks` package.json scripts: build, seal, test src/ crypto.js encrypt / decrypt / passphrase rules (blob format below) model.js document schema, validate(), section/record/field/sequence kinds ops.js pure edit helpers: add/move/remove, header, images, sequences, sub-tabs, revert-to-saved (Cancel), delete-section message, clearSecrets print.js pure print helpers: secret masking, header layout, frame rules, secret count images.js image helpers (PNG/JPEG sniffing, sizing, data URLs) + browser import pipeline template.js assemble(): the HTML skeleton shared by build.js and in-page Save version.js APP_VERSION ("Ver YYMMDDX" in the top bar) and bump helpers app.js the whole UI (start/unlock, view, edit, print, save) style.css screen styles, visual-sequence styles, @media print rules test/ one test file per src module, plus a build test docs/ thumbdrive/README.txt executor's one-page instructions (copied to the drive) PLAN.md original plan ``` Git-ignored on purpose: `*.pdf`, `data/` (plaintext working copies with real secrets), `dist/`, `node_modules/`. ## Architecture **One file.** `build.js` concatenates the modules (`crypto, images, model, ops, print, template, version`), strips `^import ` lines and `^export ` keywords, appends `app.js`, and drops the result into the skeleton from `src/template.js`. All modules therefore share one global scope in the built file, so names must not collide across modules. The skeleton holds `