Visual system design
Data flows through three strictly isolated layers:- Presentation layer — Ace Editor & vanilla DOM UI, reading via
state.editor.getValue() - Local persistence — IndexedDB (
VeyrixFS), written viaDB.save(state.files) - Cloud share (lazy) — Firebase Firestore, written via
addDoc(shared_snippets)— only touched when the user explicitly shares to the cloud
State management pattern
To maintain extreme performance on low-end mobile devices, Veyrix eschews frameworks like React or Vue. Instead it relies on a mutable, global singletonstate object. UI updates happen through explicit imperative functions triggered by state mutations, avoiding full tree diffing.
state.editor and extracting value asynchronously via debounced events, Veyrix achieves sub-16ms frame times.
Local storage model (IndexedDB)
Persistence is managed entirely via the browser’s native IndexedDB API through a Promisified wrapper. The database is namedVeyrixFS (Version 1).
Schema: files ObjectStore
KeyPath: id
Cloud & synchronization strategy
Veyrix uses a zero-cost initial load strategy: Firebase SDKs (App, Auth, Firestore) are not bundled or loaded on startup. They’re dynamically imported via ES Modules only when a user initiates a “Cloud Share.”1. Fast local share (LZ-String)
Compresses the payload withLZString.compressToEncodedURIComponent, yielding a base64-like URI-safe string appended directly to the URL. Entirely offline, entirely client-side.
2. Cloud share (Firestore)
Authenticates usingsignInAnonymously(), pushes the payload to the shared_snippets root collection, and returns a lightweight document ID reference in the URL.
Copyright © 2025–2026 Amit Dutta