How reznormichael/hollow-knight-completion-check works
Project Type and Purpose
• This is a purely client-side, single-page web application (an open-source tool) that runs entirely in the browser.
• It reads/unpacks a Hollow Knight save file (user*.dat), decrypts/parses it with AES-JS, and displays completion stats, hints, and game data.
• Build process uses Webpack (dev/stage/prod), Babel, ESLint; output is static HTML/CSS/JS served via GitHub Pages or any static host.
Core Architectural Components
A. Development Environment
– Source code under src/ (HTML template, CSS, JS modules, partials, fonts, images)
– Configuration files: webpack.dev.js, webpack.stage.js, webpack.prod.js, .eslintrc.js, .gitignore, package.json
B. Build Pipeline
– Webpack (three modes): dev, stage, prod
– Babel and core-js handle JS transpilation/polyfills
– Output directories:
• build/ (production bundle for local testing)
• stage/ (staging bundle)
• docs/ (GitHub Pages deployment bundle)
C. Client-Side Runtime
– Browser loads index.html + main.css + app.js
– app.js orchestrates:
• File input (LoadSaveFile.js) or paste-in text (LoadJson.js)
• AES decryption (aes-js.js)
• Data model classes (classes.js)
• Parsing/database logic (hk-database.js, hk-dictionary.js)
• UI rendering & page-functions (index.js, page-functions.js)
• Cookie consent & analytics (cookiealert.js, cookies.js, partials/*.html)
– Assets (img/, font/, css/) loaded as static resources
D. External Services (optional)
– Analytics (Google Analytics embed partial)
– Steam Guide link and PayPal donate integration (external redirects only)
Relationships and Data Flows
• Developer edits src files → runs Webpack → deploys bundle to docs/ or static host.
• Browser requests index.html → CSS + JS bundle loaded.
• User selects a save file or pastes text → FileReader API + LoadSaveFile/LoadJson modules read input → AES module decrypts hex/blob → Parser modules extract game state → Data model populated → UI modules re-render tabs and stats.
• Cookies & localStorage manage user preferences (hint toggles).
• Page may fire analytics events based on partials.
Architectural Patterns & Principles
• Modular JavaScript: each feature implemented as a separate module under src/js.
• Build-time configuration: three Webpack configurations allow different environment settings (dev, stage, prod).
• Static hosting: no server or backend; pure client-side.
• Progressive enhancement: works offline, requires no internet, runs entirely in modern browsers.