How yceachan/lightark works
Folio is a self-hosted personal document workspace. Users unlock the workbench, browse path-based knowledge bases, and read or edit documents; changes and file operations use the API, with revision checks protecting updates. Separate reader paths cover Markdown, PDF, DOCX, and sandboxed HTML. The README also documents offline caching and drafts, PDF annotations, and ZIP export. The backend is represented as one service because its implementation is concentrated in main.rs; finer internal boundaries are not established by the excerpts.
Main entry points: api.ts API client · App.tsx Workbench UI · markdown.ts Markdown renderer · Readers.tsx Document readers
Components 13
Workbench
- Workbench UI
frontend/src/App.tsx - API client
frontend/src/api.ts
Readers
- Markdown renderer
frontend/src/markdown.ts - Code highlighting
frontend/src/shiki.ts - Heading slugs
frontend/src/slugify.ts - Document readers
frontend/src/Readers.tsx
Backend
- HTTP API service
backend/src/main.rs - SQLite database
- File blobs
Offline
- Offline worker
frontend/src/sw.ts - Local drafts
- Browser cache
Other components
- Workspace user
Connections 14
- Workspace user → Workbench UI: uses
README.md - Workbench UI → API client: requests
frontend/src/App.tsx - Workbench UI → Document readers: renders
frontend/src/App.tsx - Workbench UI → Markdown renderer: renders
frontend/src/App.tsx - Document readers → API client: reads files
frontend/src/Readers.tsx - Document readers → Markdown renderer: renders Markdown
frontend/src/Readers.tsx - Markdown renderer → Code highlighting: highlights code
frontend/src/markdown.ts - Markdown renderer → Heading slugs: creates anchors
frontend/src/markdown.ts - API client → HTTP API service: calls API
frontend/src/api.ts - HTTP API service → SQLite database: reads and writes
README.md - HTTP API service → File blobs: stores files
README.md - API client → Local drafts: stores drafts
frontend/src/api.ts - Offline worker → Browser cache: caches resources
- API client → Browser cache: clears cached data
frontend/src/api.ts