How dociere/docierepro works
1. Overall shape
Docière Pro is a desktop-first LaTeX writing environment built as an Electron shell around a React/Vite renderer. The app is optimized for offline project editing, template-driven document creation, and live document preview rather than as a pure web app.
2. Primary UI/runtime boundary
The repository is split into:
• Electron main process (electron/main.cjs) for app lifecycle, windows, and OS integration
• Preload bridge (electron/preload.js) for safe IPC exposure to the renderer
• Renderer app (src/) for all editing, navigation, and document management UI
This boundary is important because file access, native dialogs, and any OS-level operations must cross Electron IPC rather than being done directly from React.
3. Renderer application structure
src/ is organized as a single-page application with clear feature areas:
• Pages (src/pages) for major screens like editor, template browsing/selection, settings, account flow, and startup
• Components (src/components) for reusable editors, toolbars, side panels, modals, citation tools, PDF viewing, and collaboration UI
• Context providers (src/context) for auth, project state, and settings
• Hooks (src/hooks) for shared behavior like toast notifications and Monaco/Yjs integration
This suggests a central app shell with route-level views and many modular editor panels.
4. Document editing subsystem
The app supports multiple editing modes:
• structured text/section editing
• rich text editing
• Monaco-based source/code editing
• Slate-based editor surfaces
• math/equation insertion and table/image modals
The editing experience is not just a text area; it is a multi-editor system where different representations of the same document can be shown or edited depending on context.
5. LaTeX generation and document model
The src/utils folder is the core transformation layer:
• latexGenerator.js
• latexAstEngine.jsx
• latexBlots.jsx
• latexUtility.jsx
• latexMonarchLanguage.jsx
• layoutSchema.js
• componentRegistry.js
These files indicate that Docière maintains a structured document model and converts it into LaTeX, while also providing language syntax support and component/layout metadata. The architecture likely flows from editor state -> document schema/AST -> LaTeX output -> preview/export.
6. PDF preview and document rendering
The UI includes a dedicated pdfViewer component plus CSS for PDF and SyncTeX styles. That implies a tight edit/preview loop where the generated LaTeX project is compiled to PDF and then displayed inside the app. The CrossRefPanel, FootnotePanel, and versionManager components show that the preview/editor ecosystem includes navigation and document-structure tooling, not only raw text editing.
7. Template and project system
The templates/ and user-templates/ directories are first-class architecture elements. They contain complete LaTeX project skeletons for:
• ACM manuscript
• IEEE conference/journal
• MLA format
• resume
• user-created custom templates
Each template is a filesystem-backed LaTeX project with main files, section files, class definitions, references, and supporting assets. The template browser/select/preview/builder pages form the user-facing layer over these project blueprints.
8. Project and account workflow
The app includes auth-related pages (login, signup, forgotPassword, changePassword) and project-management contexts. That indicates Docière supports a user/session layer in addition to local document editing. The presence of shareProject, leaveSession, and collaboration-related hooks suggests a project can be shared or collaboratively edited, with some state managed locally and some likely synchronized remotely.
9. External/service boundary
The README links to Docière Server, so this repository appears to be the desktop client while a separate backend handles features such as collaboration, account/session management, or sync. The repo itself is still heavily offline-capable, but a diagram should show an optional/required remote service boundary for collaborative and account-based features.
10. Native helper sidecar
The sidecar/ directory is a separate C++ native component built with CMake, including qpdf.cpp and bundling scripts. This strongly suggests native PDF-related work such as PDF manipulation, packaging, or invoking lower-level document tooling that is awkward to do purely in JS. It is an important architecture boundary because it sits outside the Electron/React runtime.
11. Tooling and build pipeline
The project uses:
• Vite for the renderer build
• Tailwind/PostCSS for styling
• ESLint for linting
• GitHub Actions (.github/workflows/build.yml) for CI
• scripts for icon generation, installer setup, and TinyTeX initialization
This indicates the desktop app is packaged with its TeX toolchain and native helpers in mind, not deployed as a hosted web frontend.
12. End-to-end data flow
A typical flow is:
user selects or opens a template/project -> React context loads project state -> editor components modify structured content -> LaTeX utilities generate or update source files -> native/Electron boundaries handle filesystem and preview compilation -> PDF viewer renders the result -> optional remote services handle auth, collaboration, or sharing.
That flow is the core architecture to reflect in a diagram.
Main entry points: editorPage.jsx Editor workbench · latexGenerator.js LaTeX pipeline · pageLayout.jsx Page layout · pdfViewer.jsx Doc panels
Components 23
Desktop runtime
Electron main/preload boundary for app lifecycle and safe native access.
- Electron main · App lifecycle, windows, and OS integration.
electron/main.cjs - Preload bridge · Safe IPC surface exposed to the renderer.
electron/preload.js
Renderer app
React/Vite UI for editing, navigation, and project management.
- App shell · Root renderer bootstrap and routing entry.
src/main.jsx - Page layout · Shared page framing and navigation layout.
src/layout/pageLayout.jsx - Start & docs · Startup, template browsing, preview, and details screens.
src/pages/startingPage.jsx - Editor workbench · Main editor, canvas, settings, and template builder screens.
src/pages/editorPage.jsx - Account flow · Login, signup, and password recovery screens.
src/pages/User_Account/login.jsx - Editor panels · Monaco, Slate, rich text, section, toolbar, and sidebar surfaces.
src/components/monacoEditor.jsx - Doc panels · Cross-references, footnotes, citations, versioning, and PDF view.
src/components/pdfViewer.jsx - Project state · Auth, project, and settings state providers.
src/context/useProject.jsx - Project API · Project handling and file/workspace operations.
src/api/projectHandling.jsx - Template screens · Template browse, select, preview, and builder screens.
src/pages/templateBrowse.jsx - Builder tools · Component renderer and property panel for template authoring.
src/components/templateBuilder/ComponentRenderer.jsx
Document engine
Structured content model, LaTeX generation, and preview pipeline.
- LaTeX pipeline · AST, blots, generator, utilities, and schema metadata.
src/utils/latexGenerator.js - Registry · Component and layout registry used by document assembly.
src/utils/componentRegistry.js - Preview assets · PDF and SyncTeX styling for preview rendering.
src/assets/styles/pdfViewer.css
Template system
Built-in and user-provided LaTeX project blueprints.
- Built-in templates · Packaged ACM, IEEE, MLA, and resume project skeletons.
templates/ACM Manuscript/main.tex - User templates · User-authored template projects and reusable LaTeX starting points.
user-templates/Founders Agreement (India)/main.tex
Native sidecar
C++ helper for lower-level PDF/document tooling.
- C++ sidecar · Native helper entrypoints and bundled document tooling.
sidecar/main.cpp - QPDF bridge · Native PDF-related implementation layer.
sidecar/qpdf.cpp
Remote services
Optional backend for auth, sharing, and collaboration.
- Docière Server · External service for auth, sharing, and collaboration.
Tooling
Build, packaging, and CI support.
- Build & CI · Vite build, packaging scripts, and GitHub Actions.
.github/workflows/build.yml - Packaging scripts · Installer, icon generation, and TinyTeX setup scripts.
scripts/setup-tinytex.js
Connections 29
- Electron main → Preload bridge: exposes · Main process publishes safe IPC to the renderer.
- Preload bridge → App shell: bridges · Renderer accesses OS capabilities through preload.
- App shell → Page layout: uses · Root app composes shared page framing.
- Page layout → Start & docs: hosts · Layout wraps startup and document browsing screens.
- Page layout → Editor workbench: hosts · Layout wraps the main editing workflow screens.
- Page layout → Account flow: hosts · Layout also supports account/session pages.
- Editor workbench → Editor panels: composes · Main editor screens are built from reusable editors and panels.
- Editor workbench → Doc panels: composes · Workbench includes document navigation and preview tools.
- Editor workbench → Builder tools: composes · Template authoring uses dedicated builder controls.
- Project state → Project API: loads · State providers coordinate project access and persistence.
- Project state → Editor workbench: feeds · Editor screens read from shared auth/project/settings state.
- Project API → Preload bridge: requests · Filesystem and native operations cross the IPC boundary.
- Editor panels → LaTeX pipeline: edits · Editors produce structured content consumed by the document engine.
- LaTeX pipeline → Registry: consults · Generation uses layout and component metadata.
- LaTeX pipeline → Built-in templates: writes · Structured document state becomes template-backed LaTeX source.
- LaTeX pipeline → User templates: writes · User project variants are also rendered to LaTeX files.
- Doc panels → Preview assets: renders with · PDF preview uses dedicated viewer and SyncTeX styling.
- Doc panels → LaTeX pipeline: observes · Preview tools stay aligned with generated document structure.
- Template screens → Built-in templates: browses · Template screens present packaged project blueprints.
- Template screens → User templates: browses · Template screens also present custom user templates.
- Template screens → Builder tools: opens · Template selection can lead into template authoring.
- C++ sidecar → QPDF bridge: includes · Native helper contains PDF-specific implementation.
- Electron main → C++ sidecar: launches · Desktop app can invoke the native sidecar for lower-level work.
- Account flow → Docière Server: auths against · Account pages depend on remote service capabilities.
- Project state → Docière Server: syncs with · Project and collaboration state may synchronize remotely.
- Doc panels → C++ sidecar: compiles via · PDF generation and preview may use native tooling.
- Build & CI → Packaging scripts: runs · CI and build tasks rely on packaging/setup scripts.
- Build & CI → C++ sidecar: builds · Release pipeline includes native component builds.
- Build & CI → App shell: bundles · Renderer is packaged through the Vite/Electron build.