HaoXiang Document Assistant
Local official-document review, formatting repair, preview, and compliant .docx export in an Electron desktop workspace.
The application combines an Electron 39 + React 19 + TypeScript interface with a Python 3.12+ FastAPI backend. It imports Word-family documents, converts them into a structured DocumentModel, applies YAML-backed review and repair rules, previews A4 output, and exports a new Word document. Chinese and English application interfaces are included, and project data stays on the local device by default.
Capabilities
- Import
.docx, .doc, and .wps documents and select the intended official-document type.
- Review typography, paragraph spacing, margins, headings, tables, page fields, and other rule-backed formatting details.
- Apply selected repairs through the document modifier instead of editing the source file in place.
- Use official, custom, user, or uploaded
.docx/.dotx templates as formatting sources.
- Preview pages in an A4-oriented workspace and export the reviewed result as
.docx.
- Optionally request AI-assisted analysis. Offline builds expose local Ollama only; online-mode packages can use explicitly configured provider endpoints.
- Use the Word VBA bridge for format checking, repair, and template actions while the local backend is running.
- Switch the application UI between Chinese and English; the preference is stored locally.
Automated checks help find and repair formatting issues, but they do not replace human review, organizational policy, or an authoritative interpretation of an official-document standard.
Architecture
Electron / React UI
|
| local HTTP
v
FastAPI on 127.0.0.1:8765
|
v
parser -> DocumentModel -> RuleEngine / Modifier -> generator -> .docx
| |
| +-- rules/official/*.yaml
+-- templates and uploaded formatting bases
| Path | Responsibility |
|---|
backend/api/routes/ | Document, review, optimization, template, settings, AI, and Office bridge endpoints |
backend/core/document/ | Conversion, parsing, structured models, modification, validation, template application, and Word generation |
backend/core/rules/ | Rule loading, merge precedence, checking, fixing, and runtime rule management |
| `backend/cor | |