How onlyoffice/documentserver works
1. This repository is the full ONLYOFFICE Docs product, not a single app. It packages the backend document server, the browser-based editors, conversion tooling, shared client SDK, fonts, dictionaries, format metadata, and starter templates.
2. The architecture is split into clear component boundaries:
- server provides the document server backend and integration surface.
- web-apps is the editor UI delivered to the browser.
- sdkjs is the shared JavaScript client SDK used by the editors.
- core is the conversion/rendering backend for office and document formats.
- core-fonts, dictionaries, document-formats, and document-templates are supporting data/runtime assets.
3. The main runtime flow is: an external DMS or host application integrates ONLYOFFICE Docs, the browser opens the editors from web-apps, and the server layer coordinates document loading, saving, export, and collaborative editing sessions.
4. web-apps is the user-facing surface for all editor types: document, spreadsheet, presentation, form, PDF, and diagram viewing/editing. It is where the common editing shell lives, including shared UI, collaboration controls, and editor-specific views.
5. sdkjs is the client-side contract between the UI and the editor logic. It provides the APIs and shared behaviors that let the different editors interact consistently with the host page, backend messages, plugin hooks, and editor state.
6. server is the orchestration boundary. It is the component that ties together authentication/requests from the host system, editor sessions, collaboration, storage access, and the handoff to conversion services when files must be transformed or prepared for editing/viewing.
7. core is the document transformation engine. It exists to convert between OOXML and other office/document formats such as DOCX, XLSX, PPTX, PDF, HTML, ODT, CSV, EPUB, XPS, and others, and it is central to import/export and preview flows.
8. core-fonts is part of the rendering fidelity path. Bundling fonts with the product helps ensure documents render and convert consistently across environments, which matters for page layout, PDF generation, and WYSIWYG editing.
9. dictionaries supports spellchecking and language-aware editing. This is a separate asset boundary from the editors themselves, and it affects text input, proofreading, and localized user experience.
10. document-formats defines the supported file-type metadata, which helps the server and editors decide how to open, convert, or export documents. document-templates supplies blank and sample starting points used when creating new files.
11. Collaboration is a cross-cutting subsystem rather than a separate app. Features like co-editing, comments, chat, review/tracking changes, version history, and live viewing are implemented across the server/editor boundary, with the browser UI reflecting shared session state.
12. Security and integration are also first-class boundaries. JWT is supported for request authentication, and the product is meant to be embedded into third-party systems such as DocSpace, Workspace, Moodle, ownCloud, Seafile, and similar DMS/sync-and-share platforms.
13. Plugins are an extension layer on top of the editors. They add functionality that is not tied to the OOXML core format, so the plugin boundary sits alongside the editor UI/SDK rather than inside the conversion engine.
14. Edition differences affect deployment and capability boundaries. Community, Enterprise, and Developer editions share the same core architecture, but clusterization, admin features, white-labeling, document builder/automation APIs, and some mobile or enterprise capabilities change which subsystems are enabled.
15. The repo-level structure also suggests a packaged distribution model: the code is meant to be built and deployed as Document Server, typically via Docker or platform-specific installers, with the submodules working together as one integrated office suite backend-plus-frontend system.
Main entry points: server Document server · sdkjs SDK JS · core Conversion · web-apps Web apps
Components 13
Integration
External systems and deployment boundary.
- Host app · External DMS or platform embedding ONLYOFFICE Docs.
Browser client
Editor UI and shared client logic.
- Web apps · Browser-delivered shells and views for documents, sheets, slides, forms, PDF, and diagrams.
web-apps - Editor shell · Common editor chrome, controls, and collaboration UI.
- Editor views · Type-specific editing and viewing surfaces for the supported editor families.
- SDK JS · Shared editor APIs, host contract, plugins hooks, and state behavior.
sdkjs - Plugins · Optional editor extensions that add functionality alongside the core editors.
Backend
Document server and conversion runtime.
- Document server · Coordinates auth, sessions, storage, collaboration, and editor handoff.
server - Collaboration · Co-editing, comments, review state, and live session coordination.
- Conversion · Prepares files for editing, export, preview, and format translation.
core
Assets
Fonts, language data, format metadata, and templates.
- Format metadata · Supported document type definitions used to open, convert, and export files.
document-formats - Templates · Blank and sample documents used when creating new files.
document-templates - Fonts · Bundled fonts that improve layout fidelity and conversion consistency.
core-fonts - Dictionaries · Spellcheck and language data for proofreading and localized editing.
dictionaries
Connections 16
- Host app → Document server: integrates · The host system embeds and authenticates against the document server.
- Document server → Web apps: serves · The backend delivers the browser editor application.
- Document server → Collaboration: coordinates · The server maintains collaborative document sessions and shared state.
- Document server → Conversion: hands off · The server delegates format preparation and conversion work to the core engine.
- Web apps → Editor shell: contains · The web-apps package provides the shared editor shell and common UI.
- Web apps → Editor views: renders · The browser client exposes editor-specific document, sheet, slide, form, PDF, and diagram views.
- Editor shell → SDK JS: uses · The shared shell relies on the client SDK for editor behavior and host communication.
- Editor views → SDK JS: uses · Individual editor views depend on the SDK for common APIs and state handling.
- SDK JS → Document server: syncs · The client SDK exchanges editor state and document events with the backend.
- SDK JS → Plugins: extends · Plugins attach to the editor through the shared client-side contract.
- Conversion → Format metadata: interprets · Conversion logic depends on supported file-type metadata.
- Conversion → Fonts: uses · Rendering and conversion rely on bundled fonts for fidelity.
- Conversion → Templates: creates · The backend and editors use starter templates when generating new documents.
- Editor shell → Dictionaries: checks · The editor UI can surface spellchecking and language-aware editing support.
- Document server → Format metadata: routes by type · The orchestration layer uses format metadata to decide how to open or export content.
- Host app → SDK JS: contracts · The embedding application interacts with the editors through the shared client contract.