# ZORD — AI Text Editor (Full Documentation) > Tagline (EN): Write smarter, on a real A4 page. > Tagline (FR): Écrivez plus malin, sur une vraie page A4. > > One-liner (EN): Free A4 word processor in your browser. Zero cloud, zero tracker, zero account + your choice of AI with your own keys (Claude, GPT, Gemini, Mistral). DOCX & PDF. > One-liner (FR): Traitement de texte A4 gratuit, dans votre navigateur. Zéro cloud, zéro tracker, zéro compte + IA au choix avec vos clés (Claude, GPT, Gemini, Mistral). DOCX & PDF. > > AI keys: BYOK — no API key is shipped or pre-paid. Users supply their own Anthropic / OpenAI / Google / Mistral keys. > > Complete technical documentation for LLM consumption. See llms.txt for the summary. ## 1. Product Identity - **Name**: ZORD (Supreme Text / Supreme Texte) - **Type**: Progressive Web App (PWA) — browser-based word processor - **Version**: v0.0.6 - **Release Date**: May 5, 2026 - **First Published**: December 2025 - **Publisher**: Zigmoon (https://zigmoon.com) - **Contact**: contact@zigmoon.com - **License**: Proprietary — free to use, no account required - **Languages**: English (default), French ## 2. URLs | Resource | URL | |----------|-----| | App (EN) | https://app.zigmoon.com/zord/ | | App (FR) | https://app.zigmoon.com/zord/index_FR.html | | Releases | https://app.zigmoon.com/release.html | | Sitemap | https://app.zigmoon.com/zord/sitemap.xml | | Manifest | https://app.zigmoon.com/zord/manifest.webmanifest | | Robots | https://app.zigmoon.com/zord/robots.txt | | Humans | https://app.zigmoon.com/zord/humans.txt | | LLMs | https://app.zigmoon.com/zord/llms.txt | ## 3. Architecture ### Frontend (Single-Page Application) - **app.js**: ~8700 lines, monolithic application logic - **index.html**: English UI (~3800 lines, inline CSS + Tailwind) - **index_FR.html**: French UI (same structure, translated text) - **sw.js**: Service Worker — cache-first for local assets, network-first for navigation, stale-while-revalidate for CDN ### Backend (PHP, optional) - **ai.php**: Simplified AI proxy — receives `{provider, apiKey, body}`, forwards to the correct API endpoint - **ai-proxy.php**: Advanced AI proxy — header-based auth, proper CORS, full body forwarding - **send-export.php**: Email endpoint — sends JSON export as email attachment (restricted to zigmoon.com domain) ### Storage Layers 1. **IndexedDB** (primary): Full document data with Delta format, per-document storage 2. **localStorage** (fallback): Metadata + emergency backup, conflict resolution via exportDate timestamps 3. **Service Worker Cache**: PRE_CACHE for offline shell, CDN caching for external resources 4. **IPFS/Pinata** (optional): Decentralized permanent backup via Pinata API 5. **Cloud OAuth** (optional): Google Drive (configured), Dropbox, OneDrive (need user API keys) ### Editor Engine - **Quill.js 1.3.6** with Snow theme - Custom formats: font whitelist (14 families), pt-based sizes, line-height block format - Multi-page architecture: one Quill instance per A4 page - Automatic pagination with overflow detection, binary search split, pull-back underflow - 12px guard margin for pagination stability ## 4. AI Integration (v0.0.4) ### Supported Providers & Models | Provider | Text Model | Vision Model | API Version | |----------|-----------|--------------|-------------| | Anthropic | claude-haiku-4-20250414 | claude-sonnet-4-20250514 | 2023-10-01 | | OpenAI | gpt-4.1-mini | gpt-4.1 | Latest | | Google | gemini-2.5-flash | gemini-2.5-pro | v1beta | | Mistral | mistral-large-latest | N/A (text only) | Latest | ### How It Works 1. User types a prompt in the AI panel (bottom of editor) 2. app.js builds a provider-specific request body with: - A shared system prompt describing ZORD's capabilities - The current document text (up to 12,000 chars) as context - The user's prompt - Optional: base64 image for vision analysis 3. Request is sent to `ai.php` which forwards to the provider's API 4. Response text is parsed and inserted at the cursor position 5. Markdown `#` headings in the response are converted to Quill H1-H3 format ### Configuration - API keys stored in localStorage (per-provider) - Users bring their own keys — no server-side keys - AI can be enabled/disabled per session - Debug mode available for troubleshooting (logs to console) ## 5. Export & Import ### Export Formats - **.zord**: Native JSON format with header metadata, wraps multi-doc export - **.json**: Legacy JSON export with Delta content per page - **.docx**: Professional Word export via docx.js — preserves bold, italic, underline, headings, lists, colors, font sizes, images - **.doc**: Simplified HTML-based .doc export - **Print/PDF**: Browser native print with @media print styles - **Email**: Send .json backup as email attachment via send-export.php ### Import Formats - **.zord**: Native format, full fidelity - **.json**: Legacy format support - **.docx**: Via Mammoth.js, converts to HTML then to Quill Delta - **.odt**: Via JSZip, parses XML content with style extraction - **.rtf**: Basic RTF parser for bold, italic, underline, headings - **.doc**: HTML-based .doc files ## 6. Collaboration (WebRTC) - Peer-to-peer via RTCPeerConnection + RTCDataChannel - Manual signaling via copy/paste of base64-encoded SDP offers/answers - Live cursor sharing with name and color - Maximum 3 concurrent users (self + 2 peers) - STUN server: stun.l.google.com:19302 - No signaling server required — fully manual exchange ## 7. PWA Capabilities - **Installable**: manifest.webmanifest with icons (192px, 512px, SVG) - **Offline**: Service Worker pre-caches all local assets + fonts - **Shortcuts**: "New document" and "AI Assistant" PWA shortcuts - **Categories**: productivity, utilities, business - **Display**: standalone (no browser chrome) ## 8. Privacy & Security - All document data stored locally (IndexedDB + localStorage) - No server-side storage of user content - No tracking, no analytics, no cookies (except functional) - No user accounts or registration - API keys stored in localStorage only — never sent to Zigmoon servers - AI requests proxied through ai.php to avoid CORS — keys forwarded to provider APIs only - Email export restricted to zigmoon.com domain recipients - CORS headers configured on all PHP endpoints - Input sanitization on PHP endpoints (header injection prevention, URL encoding) ## 9. Keyboard Shortcuts | Shortcut | Action | |----------|--------| | Ctrl+S | Save document | | Ctrl+O | Open document | | Ctrl+P | Print | | Ctrl+Z | Undo | | Ctrl+Y | Redo | | Ctrl+B | Bold | | Ctrl+I | Italic | | Ctrl+U | Underline | | Ctrl+Shift+M | Voice-to-text toggle | | Ctrl+1/2/3 | Heading H1/H2/H3 | | Ctrl++ / Ctrl+- | Zoom in/out | | Ctrl+0 | Reset zoom | | Space (hold) | Pan tool | ## 10. Browser Support - Chrome/Chromium 90+ - Firefox 90+ - Safari 15+ - Edge 90+ - Mobile: Chrome Android, Safari iOS ## 11. Dependencies | Library | Version | Purpose | |---------|---------|---------| | Quill.js | 1.3.6 | Rich text editor engine | | Tailwind CSS | 3.x (CDN) | Utility-first CSS | | Mammoth.js | 1.8.0 | DOCX import | | JSZip | 3.10.1 | ODT import (ZIP parsing) | | docx.js | UMD bundle | DOCX export | | FileSaver.js | minified | File download helper | | Google Fonts | Inter, Space Mono, Crimson Pro | Typography |