App Startup & Boot Sequence
The HAWKI frontend does not run feature code immediately on page load. Instead, app.ts registers all initialization work into an ordered sequence of async boot stages managed by the Bootstrapper singleton, then calls bootstrapper.run() once. Each stage fully resolves before the next one begins. Within a stage, handlers run concurrently (up to 3 at a time). This ordering guarantees that foundational infrastructure — connection, config — is always available before feature code runs.
Old UI Integration
The HAWKI chat UI is being progressively rewritten from vanilla JS to Svelte 5. During this transition, both layers need to coexist: the new Svelte frontend must expose capabilities that legacy JS code can consume, and the two layers need typed communication channels for the parts of the UI they share.
Encryption
HAWKI uses the browser's native Web Crypto API (window.crypto.subtle) for end-to-end encryption. The resources/js/encryption/ directory provides a thin typed wrapper that keeps all crypto primitives in one place, enforces consistent serialisation formats, and prevents accidental direct use of window.crypto.subtle in feature code.
Frontend Migrations
Frontend migrations are one-time JavaScript scripts that run in the user's browser to transform or re-key locally stored or encrypted data. They are necessary when encryption formats change or user data structures are updated in ways that cannot be handled server-side — typically because the server never has access to the plaintext.