The Problem
Teams that need native‑style editing of .docx, .xlsx, .pptx and PDF files on macOS/Windows currently juggle separate desktop apps, each with its own file‑format quirks. Switching among them breaks workflows, and integrating AI‑assisted editing requires custom glue code in each product.
What This Does
genoffice delivers a single Electron‑based suite (apps/docs, apps/sheets, apps/slides, apps/pdf) that share a common engine layer (see packages/*‑engine). The word processor (apps/docs) preserves the original .docx byte‑stream, only re‑generating dirty paragraphs. The spreadsheet app (apps/sheets) uses the open‑source Univer core plus a Rust side‑car (apps/sheets/native/xlsx-engine/Cargo.toml) for fast import/export. The presentation app (apps/slides) runs an in‑house PPTX engine (packages/pptx-engine/src/index.ts). PDF editing (apps/pdf) builds on pdf.js and pdf-lib. A lightweight shell (apps/shell) hosts the four editors in a tabbed UI.
Key files:
apps/docs/src/main/index.ts– Electron main process bootstrap.apps/docs/src/renderer/App.tsx– React root for the word‑processor UI.packages/pptx-engine/src/index.ts– Hub for PPTX parsing/rendering (56 inbound imports).apps/sheets/native/xlsx-engine/Cargo.toml– Rust crate that powers XLSX I/O.
How It Is Wired
Execution starts in the Electron main script (apps/docs/src/main/index.ts for Docs, analogous files exist for Sheets, Slides, PDF). The main process creates a BrowserWindow that loads apps/docs/src/renderer/index.html. React mounts App.tsx, which composes the ribbon, editor, and preview components.
- Editor pipeline (Docs) –
apps/docs/src/renderer/editor/convert.tsparses the incoming DOCX model, then hands the document tree todoc-state.tsanddoc-style-css.ts. Changes flow back througheditor/active-editor.ts→editor/ink.ts→ IPC (apps/docs/src/shared/ipc.ts) → the main process for file writes (apps/docs/src/main/index.ts). - Spreadsheet I/O – UI actions call
apps/sheets/src/gateway/xlsx-gateway.ts, which invokes the Rust side‑car vianpm run buildof the Cargo crate. The resulting binary is spawned from the Electron main process (apps/sheets/src/main/index.ts). - Presentation engine – Most modules import
packages/pptx-engine/src/index.ts; this hub re‑exports parsers, renderers, and type definitions. The cycle count (56 inbound, 30 outbound) makes it a blast‑radius hotspot. - PDF handling –
apps/pdf/src/main/index.tsloadspdf.jsin a renderer process and routes annotation commands throughapps/pdf/src/renderercomponents.
Circular import members (packages/pptx-engine/src/index.ts, apps/docs/src/renderer/editor/extensions.ts, apps/docs/src/renderer/editor/convert.ts) increase coupling; any change risks breakage across the suite. The most connected modules (e.g., packages/pptx-engine/src/index.ts) should be kept stable and minimal.
How To Use It
# Clone the repo
git clone https://github.com/moses-y/genoffice
cd genoffice
# Install Node dependencies (npm is declared in package.json)
npm ci
# Build the Rust XLSX engine (required for Sheets)
cd apps/sheets/native/xlsx-engine
cargo build --release
cd ../../../..
# Run a specific app, e.g., Docs
npm run dev:docs # defined in apps/docs/package.json (starts Electron)
# To launch the full suite shell
npm run dev:shell # starts the tabbed host
No additional environment variables are required; the apps read configuration from their own package.json and bundled assets. If a script name differs, inspect apps/*/package.json for the exact npm command.
Real‑World Use
A publishing house can replace Microsoft Word and Excel with genoffice to edit contracts while preserving exact layout on save. An AI assistant (see apps/docs/src/renderer/ai/*) can suggest clause rewrites; the changes flow through editor/convert.ts and are written back to the original .docx without breaking existing formatting.
Code Health & Issues
- HIGH – cognitive_load – Oversized files (e.g.,
packages/pptx-engine/src/index.ts,apps/slides/src/shared/ipc.ts,apps/docs/src/renderer/editor/extensions.ts) contain >2 600 lines each. - HIGH – soundness – Import cycle members (
packages/pptx-engine/src/index.ts,apps/docs/src/renderer/editor/extensions.ts,apps/docs/src/renderer/editor/convert.ts). - MEDIUM – cognitive_load – Deep nesting (max depth 6) in
apps/docs/src/renderer/editor/convert.tsand similar files. - MEDIUM – cognitive_load – High branching density (≈ 800 branches) in
packages/pptx-engine/src/index.tsand key gateway modules. - HIGH – clarity – Hub modules (e.g.,
packages/pptx-engine/src/index.ts) attract 74 dependent modules, creating a large blast radius.
Repository hygiene (static audit):
- MEDIUM – Enable Dependabot or Renovate (
.github/dependabot.ymlmissing). - MEDIUM – Add a dependency‑vulnerability scan to CI (
.github/workflows/ci.ymllacks such step). - MEDIUM – Set
persist-credentials: falseon the checkout action to avoid leaking the token.
All other standard safeguards (tests, CI, license, lockfile) are present.
The Bottom Line
genoffice provides a cohesive, AI‑first desktop office suite with solid test coverage and a clear monorepo layout. The codebase is functional but suffers from large hub modules and import cycles that inflate change risk. Teams comfortable with TypeScript, Electron, and a Rust side‑car will find it extensible; newcomers should prioritize refactoring the identified hotspots before heavy customization.