How thedeductor/inkcoach works
InkCoach is an offline desktop writing assistant. Writers edit and manage documents in the React app; editor analysis requests travel through Electron’s secure bridge to the Python backend, while document operations and exports use the same backend route. The backend combines grammar checking with readability and tone analysis, and streams rewriting or generated text from local Ollama back to the assistant panel. Document content, settings, and version history are persisted locally. The README documents these major capabilities; wiring details are based on the sampled source, so uncertain links are omitted.
Main entry points: preload.js Secure API Bridge · api.py JSON Request Router · App.jsx App State · Editor.jsx Rich Editor
Components 19
Writing Interface
- App State
src/App.jsx - Rich Editor
src/components/Editor.jsx - Assistant Panel
src/components/AssistantPanel.jsx - Document Sidebar
src/components/Sidebar.jsx - Status Bar
src/components/StatusBar.jsx - Top Bar
src/components/TopBar.jsx
Desktop Bridge
- Secure API Bridge
src/preload.js - Electron Main
src/main.js
Writing Services
- JSON Request Router
backend/api.py - Grammar Checking
backend/grammar.py - Readability and Tone
backend/readability.py - AI Rewrite and Generate
backend/rewriter.py
Documents and Export
- Document Storage
backend/storage.py - PDF and DOCX Export
backend/exporter.py
Other components
- Writer
- Local Ollama
- LanguageTool
- SQLite
- Export Files
Connections 26
- Writer → Rich Editor: edits text
- Writer → Assistant Panel: requests writing help
- Writer → Document Sidebar: manages documents
- Rich Editor → App State: reports edits and analysis
- Assistant Panel → Secure API Bridge: requests rewrite or generation
- Rich Editor → Secure API Bridge: requests analysis
- App State → Secure API Bridge: requests document actions
- Top Bar → App State: triggers app actions
- Document Sidebar → App State: triggers document actions
- App State → Status Bar: provides writing status
- Secure API Bridge → Electron Main: dispatches IPC
- Electron Main → JSON Request Router: sends JSON requests
- JSON Request Router → Grammar Checking: checks grammar
- JSON Request Router → Readability and Tone: computes writing metrics
- Grammar Checking → LanguageTool: checks text
- JSON Request Router → AI Rewrite and Generate: starts rewrite or generation
- AI Rewrite and Generate → Local Ollama: streams chat request
- JSON Request Router → Document Storage: dispatches document operations
- Document Storage → SQLite: reads and writes
- JSON Request Router → PDF and DOCX Export: dispatches export
- PDF and DOCX Export → Export Files: writes PDF or DOCX
- JSON Request Router → Electron Main: returns results and stream chunks
- Electron Main → Secure API Bridge: forwards results and stream events
- Secure API Bridge → Assistant Panel: delivers stream events
- Secure API Bridge → Rich Editor: returns analysis
- Secure API Bridge → App State: returns document results