How forward-future/folio works
Folio is a cross-platform desktop PDF reader. The main workflow is opening a PDF (or converting a supported Word document or webpage), reading and navigating it, then searching, annotating, signing, or asking AI about its contents. The graph also preserves OCR, document editing/history, and desktop integrations. Several feature modules are identified by the tree and README but were not sampled; those branches are included at directory or module paths, with relationships shown only where the README or excerpts support them.
Main entry points: App.tsx Reader interface · OcrSession.ts OCR sessions · ai.cjs AI orchestration · main.cjs Electron shell
Components 25
Desktop and input
- Electron shell
electron/main.cjs - Webpage conversion
electron/webpage.cjs - Word conversion
electron/convert.cjs - DOCX parser
electron/docx-worker.cjs - PDF input
src/pdfInput.ts - Network safeguards
electron/network.cjs
Reading and navigation
- Document tabs
src/documentTabs.ts - Reader interface
src/App.tsx - PDF viewer
src/viewer.ts - Recent library
src/recent.ts
Document tools
- Highlights and notes
src/markup.ts - Text and image editing
src/contentEditor.worker.ts - Signatures
src/signatures.ts - Version history
src/versionHistory.ts - Print workflow
electron/printing.cjs
OCR and search
- OCR sessions
src/lib/ocr/session/OcrSession.ts - Scan detection
src/lib/ocr/text/scan.ts - OCR recognition
src/ocrWorker.ts - OCR cache
src/lib/ocr/storage/ocrStore.ts - Document search
src/lib/search/index.ts
AI assistance
- Ask AI panel
src/AiPanel.tsx - AI orchestration
electron/ai.cjs - AI providers
electron/openrouter.cjs
Other components
- Reader
- AI services
Connections 23
- Reader → Electron shell: opens documents
- Reader → Reader interface: reads and edits
- Electron shell → Word conversion: routes Word files
electron/main.cjs - Word conversion → DOCX parser: delegates parsing
electron/docx-worker.cjs - Reader → Webpage conversion: opens webpage URL
- Reader interface → PDF viewer: uses viewer
src/App.tsx - Reader interface → PDF input: opens PDFs
src/App.tsx - Reader interface → Document tabs: manages document tabs
src/App.tsx - Reader interface → Recent library: reads saved view
src/App.tsx - Reader interface → Highlights and notes: annotates PDFs
src/App.tsx - Reader interface → Text and image editing: edits PDF content
- Reader interface → Signatures: signs documents
src/App.tsx - Reader interface → Version history: reviews changes
src/App.tsx - Reader interface → Print workflow: prints documents
- Reader interface → OCR sessions: creates OCR session
src/App.tsx - OCR sessions → OCR cache: loads and saves pages
src/lib/ocr/session/OcrSession.ts - OCR sessions → Scan detection: identifies scanned pages
- OCR sessions → OCR recognition: requests recognition
- Reader interface → Document search: searches document
- Ask AI panel → AI orchestration: sends questions
- AI orchestration → AI providers: dispatches requests
electron/ai.cjs - AI orchestration → Network safeguards: uses network controls
electron/ai.cjs - AI providers → AI services: requests answers
electron/openrouter.cjs