Veyrix IDE
What is Veyrix IDE?
Veyrix is a lightweight, offline-first progressive web application (PWA) that transforms your browser into a highly responsive code editor. It is designed to run seamlessly in strict or restricted browser environments, keeping all processing and storage entirely on the client side without relying on backend servers.
Why use it?
Absolute Privacy
Your files never leave your device. Everything is securely saved in your browser's local IndexedDB storage unless you use cloud share.
Blazing Fast
Runs smoothly on low-end devices by bypassing heavy virtual DOMs and using a native vanilla JavaScript architecture.
True Offline Mode
Install it as a Web App (PWA) and write code anywhere, anytime—no internet connection required.
Built-in Time Machine
Easily save snapshots of your files to instantly roll back to previous versions without setting up Git.
Architecture & Stack
Veyrix IDE is an offline-first, client-side progressive web application (PWA) engineered for high-performance code editing in browser-restricted environments. It bypasses traditional Virtual DOM overhead by utilizing a vanilla JavaScript monolithic state architecture paired directly with the Ace Editor engine.
Core Technology Stack
Ace Editor
v1.32.6 • Core Text Engine
IndexedDB
Local Persistence Layer
LZ-String
v1.5.0 • URL Compression
Firebase
v11.6.1 • Cloud Share (Manual)
Comprehensive Usage Guide
This section details how to operate the Veyrix IDE effectively, covering file management, keyboard shortcuts, versioning, and sharing capabilities.
1. Managing Files
Click the `+` icon in the sidebar (or the floating button on mobile). Type your desired filename including the extension (e.g., `script.js`, `index.html`, `Dockerfile`). Veyrix automatically detects the language based on the extension and applies correct syntax highlighting. You can create a file without an extension.
Click the Open File icon (folder with up arrow) in the top navigation bar, or press Ctrl+O. Select any valid text, configuration, or code file from your device. Binary files (like images or compiled `.exe` files) will be rejected.
Hover over any file in the left sidebar and click the three-dots (...) icon. From the dropdown, you can select Rename, Delete, or Download the specific file.
2. Editing & Formatting
Veyrix automatically caches your typing to the local database 500ms after you stop typing. The blue dot next to your filename in the top bar indicates unsaved changes. You can force a save at any time by pressing Ctrl+S or clicking the floppy disk icon.
To instantly beautify your code (fix indentation and spacing), press Alt+Shift+F. Note: Formatting is only supported for recognized web languages (HTML, CSS, JS/JSX, JSON, Markdown).
3. Snapshots (Local Version History)
Veyrix has a built-in "Time Machine" for your files.
- Save a Snapshot: Click the bookmark icon in the top right. This saves a frozen copy of your code at that exact moment.
- Limits: You can save a maximum of 5 snapshots per file. If you try to save a 6th, the IDE will prompt you to permanently delete the oldest one.
- Restore: Click the clock icon to view your history. Clicking "Restore" on an older version will immediately replace your current editor content with the historical code.
4. Sharing Code
Click the Share icon to open the sharing modal. You have three options:
Compresses your entire file into the URL. No data leaves your browser. Best for very small snippets, as large files will generate massively long URLs.
Uploads your code to an anonymous, secure Firebase database. Generates a short link. You can optionally protect this link with a password.
Uses your phone or computer's native sharing menu (e.g., Airdrop, WhatsApp, Email) to send the raw text of your code.
Visual System Design
Below is a high-level visual representation of the data flow and architectural boundaries within Veyrix IDE. Notice the strict isolation of the Cloud layer.
Presentation Layer
Ace Editor & Vanilla DOM UI
Local Persistence
IndexedDB (VeyrixFS)
Cloud Share (Lazy)
Firebase Firestore
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 singleton `state` object. UI updates are handled through explicit imperative functions triggered by state mutations, avoiding full tree diffing.
// Global State Singleton
const state = {
files: [], // Array of File objects
activeFileId: null, // ID of currently rendered file
editor: null, // Ace Editor instance reference
db: null, // IndexedDB connection instance
renameTargetId: null // Transient state for UI modals
};
The Ace Editor manages its own complex internal state (cursors, selections, undo stacks). Wrapping it in a reactive framework often leads to race conditions during rapid typing. By keeping the source of truth in `state.editor` and extracting the `value` asynchronously via debounced events, we achieve sub-16ms frame times.
Local Storage Model (IndexedDB)
Persistence is entirely managed via the browser's native IndexedDB API using a Promisified wrapper. The database is named `VeyrixFS` (Version 1).
Schema: `files` ObjectStore
KeyPath: id
// TypeScript Representation of the IndexedDB Record
interface VeyrixFile {
id: string; // e.g., "f_a1b2c3d4e_1679000000"
name: string; // Base filename (e.g., "app")
ext: string; // Extension (e.g., "js", "html")
content: string; // Raw string payload of the editor
unsaved: boolean; // Tracks dirty state for the UI
lastModified: number; // Epoch timestamp
snapshotCounter?: number;
snapshots?: Snapshot[]; // Array (Max length: 5, FIFO eviction)
}
Cloud & Synchronization Strategy
Veyrix employs a zero-cost initial load strategy. Firebase SDKs (App, Auth, Firestore) are not bundled or loaded on startup. They are dynamically imported via ES Modules only when a user initiates a "Cloud Share".
1. Fast Local Share (LZ-String)
Compresses the payload using `LZString.compressToEncodedURIComponent`. Yields a base64-like URI-safe string appended directly to the URL. Operates entirely offline and within the client boundary.
2. Cloud Share (Firestore)
Authenticates using `signInAnonymously()`. Pushes payload to the `shared_snippets` root collection. Returns a lightweight document ID reference in the URL.
Cryptography & Security Model
Zero-Knowledge Cloud Password Protection
When a user applies a password to a Cloud Share snippet, the plaintext password is never transmitted to Firebase. Instead, Veyrix utilizes the native Web Crypto API to generate a SHA-256 hash locally.
// Internal Utility Method
async function hashPassword(password) {
const msgBuffer = new TextEncoder().encode(password);
const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer);
const hashArray = Array.from(new Uint8Array(hashBuffer));
return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
}
Threat Model Assumptions
- 1. Physical Security Veyrix relies completely on the local OS and browser profile. If an attacker gains physical, unlocked access to the device or compromises the browser profile (e.g., via malicious extensions), the IndexedDB store is considered compromised.
- 2. Cross-Site Scripting (XSS) Veyrix is an editor, not an evaluator. The Ace Editor parses content into Abstract Syntax Trees (ASTs) for highlighting. It does not execute the code within the DOM. DOM string interpolations are secured via native `textContent` mappings.
- 3. Cloud Anonymity Firebase interactions utilize `signInAnonymously()`. Data is tied to a temporary, anonymous session UID. We assume Firebase Security Rules enforce read/write access correctly based on the snippet UID, but URLs are considered semi-public unless SHA-256 hashed.
Performance & Benchmarks
By stripping away Webpack overhead, Virtual DOM reconciliation, and heavy language servers, Veyrix operates on a fraction of the hardware requirements of modern cloud IDEs.
| Environment | Base RAM (Idle) | Editor Engine | Time to Interactive |
|---|---|---|---|
| Veyrix IDE | ~30MB - 42MB | Ace Editor (Vanilla) | < 0.5 seconds |
| VS Code Web | ~350MB+ | Monaco + Web Workers | 2.5 - 4 seconds |
| CodeSandbox | ~500MB+ | Monaco + Container VM | 4 - 8 seconds |
Why Ours is Better for Mobile/Low-End:
- Debounced I/O: IndexedDB writes are debounced by 500ms, ensuring zero main-thread blockage during rapid typing.
- No Monaco Overhead: While powerful, the Monaco editor struggles on low-end Androids due to heavy worker threading. Ace Editor is substantially lighter.
- Visual Viewport Anchoring: PWA implementations often suffer from layout thrashing when the soft keyboard appears. Veyrix anchors directly to the `window.visualViewport` API, freezing the reflow.
Error Handling Behavior
Safari and Firefox frequently restrict or completely block `IndexedDB` access in Private Browsing. If `DB.init()` fails, Veyrix degrades gracefully to an in-memory volatile state. A UI toast warns the user that files will be lost upon closing the tab, prompting manual downloads.
Triggered when the physical device runs out of disk space, or the browser's origin quota is exceeded. Veyrix catches this in the `DB.save()` promise rejection, halting autosave and notifying the user to clear space or delete older snapshots.
Web IDE Architecture
Veyrix Web (web.html) is an advanced, multi-file environment built specifically for web development. Unlike the single-file main IDE, it utilizes a robust virtual file system with directory structures, multi-tab editing, and an integrated real-time preview window.
Isolated Database (VeyrixWebFS)
To prevent data collision, Veyrix Web uses a completely separate IndexedDB named VeyrixWebFS. It tracks full relative paths (e.g., /css/style.css) rather than flat IDs, enabling a true folder hierarchy.
// VFS Node Representation
interface VFSNode {
path: string; // Absolute virtual path
type: string; // "file" or "folder"
content: string; // String payload or Base64 URI
isBase64: boolean; // Flags binary image assets
}
Live Preview Engine
The core powerhouse of the Web IDE is the PreviewEngine. Because all files exist securely inside IndexedDB, standard relative HTML links (like <link rel="stylesheet" href="style.css">) fail natively inside an isolated iframe. Our engine intercepts and resolves these on the fly.
When rendering, the engine intercepts your /index.html file and uses the browser's native DOMParser API. It scans the Document Object Model for external scripts, styles, and image tags.
Using PathUtils.resolve(), it computes the absolute virtual path of each linked asset, retrieves its content from the VFS, and transforms it. <link> tags are seamlessly replaced with inline <style> tags, and <script src> tags are converted to inline execution blocks.
The compiled master HTML string is injected directly into the iframe's srcdoc attribute. This entirely bypasses cross-origin requests, eliminates network latency, and keeps processing lightning fast and 100% offline.
Workspace Export (ZIP)
Unlike the main IDE which deals with flat single files, Veyrix Web allows you to export your entire workspace architecture effortlessly.
Combine HTML
Leverages the PreviewEngine to bundle all your CSS, JavaScript, and Base64 images into a single monolithic index.html file. Excellent for quick sharing or embedding in systems that don't support multi-file directories.
ZIP Archive Export
Dynamically loads the JSZip library only when requested. It maps over the Virtual File System, constructs a standard directory structure, and outputs a downloadable .zip file, preserving all relative paths and binary formats perfectly.
Frequently Asked Questions (FAQ)
Where are my files stored?
All your files are stored locally on your device inside your browser's secure IndexedDB. They are never uploaded to any server automatically. You maintain full ownership and privacy of your code. Only when you use cloud share are your files sent to the server.
Do I need an internet connection to use Veyrix?
No. Once Veyrix is loaded in your browser for the first time, its Service Worker caches the application. You can use the IDE entirely offline. An internet connection is only required if you explicitly use the "Cloud Share" feature.
Can I recover a deleted file?
No. Deleting a file from the sidebar removes it permanently from the local IndexedDB along with all of its associated snapshots. Please use the Download feature to keep manual backups of important code.
What languages does Veyrix support?
Veyrix supports syntax highlighting for over 50 languages via Ace Editor. Common formats like HTML, CSS, JavaScript, TypeScript, Python, Markdown, JSON, YAML, and XML are auto-detected via the file extension.
Can I install Veyrix as an App?
Yes! Veyrix is a Progressive Web App (PWA). Tap the button, then click on the Install Web App. It will run fullscreen without browser toolbars.
Current Limitations
- Flat File System: No directory or subfolder support; flat array mapping.
- Snapshot Limit: Hardcoded FIFO limit of 5 snapshots per file to prevent quota bloating.
- No Language Servers: Relies entirely on basic Ace autocompletion arrays; no deep intellisense (LSP).
- Single View: Split-pane or multi-tab rendering is not yet supported in the DOM structure.
Development Roadmap
Core IDE
Web IDE
UI Visuals & Layout
The interface is designed using a flexbox layout tailored for high-performance desktop workflows. Both environments utilize a persistent sidebar for file management, while the Web IDE adds a synchronized live preview engine.
Veyrix IDE (Main) - Desktop Layout
Veyrix Web - Desktop Layout (Preview Mode)
Veyrix Web
Veyrix IDE and this documentation are provided "as is" under the Apache License 2.0, without warranty of any kind, express or implied. The creator reserves the right to modify or permanently discontinue this project at any time without prior notice. The creator is not responsible for data loss, service interruptions, or damages arising from the use of this software. Local data management is the sole responsibility of the user. Use at your own risk.