# onlyoffice/documentserver architecture

> Architecture diagram of the GitHub repository onlyoffice/documentserver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/onlyoffice/documentserver
- Repository: https://github.com/onlyoffice/documentserver

## Overview

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`](https://github.com/onlyoffice/documentserver/tree/master/server) (Document server), [`sdkjs`](https://github.com/onlyoffice/documentserver/tree/master/sdkjs) (SDK JS), [`core`](https://github.com/onlyoffice/documentserver/tree/master/core) (Conversion), [`web-apps`](https://github.com/onlyoffice/documentserver/tree/master/web-apps) (Web apps)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Integration"]
  node_host["Host app<br/>dms/integration"]
end

subgraph group_client["Browser client"]
  node_webapps["Web apps<br/>editor UI"]
  node_shell["Editor shell<br/>shared UI"]
  node_views["Editor views<br/>document views"]
  node_sdkjs["SDK JS<br/>client SDK"]
  node_plugins{{"Plugins<br/>extension layer"}}
end

subgraph group_backend["Backend"]
  node_server["Document server<br/>orchestration backend"]
  node_collab(("Collaboration<br/>session layer"))
  node_convert["Conversion<br/>transform engine"]
end

subgraph group_assets["Assets"]
  node_formats["Format metadata<br/>file-type registry"]
  node_templates["Templates<br/>starter assets"]
  node_fonts[("Fonts<br/>render assets")]
  node_dictionaries[("Dictionaries<br/>language assets")]
end

node_host -->|"integrates"| node_server
node_server -->|"serves"| node_webapps
node_server -->|"coordinates"| node_collab
node_server -->|"hands off"| node_convert
node_webapps -->|"contains"| node_shell
node_webapps -->|"renders"| node_views
node_shell -->|"uses"| node_sdkjs
node_views -->|"uses"| node_sdkjs
node_sdkjs -->|"syncs"| node_server
node_sdkjs -->|"extends"| node_plugins
node_convert -->|"interprets"| node_formats
node_convert -->|"uses"| node_fonts
node_convert -->|"creates"| node_templates
node_shell -->|"checks"| node_dictionaries
node_server -->|"routes by type"| node_formats
node_host -.->|"contracts"| node_sdkjs

click node_server "https://github.com/onlyoffice/documentserver/tree/master/server"
click node_convert "https://github.com/onlyoffice/documentserver/tree/master/core"
click node_webapps "https://github.com/onlyoffice/documentserver/tree/master/web-apps"
click node_sdkjs "https://github.com/onlyoffice/documentserver/tree/master/sdkjs"
click node_formats "https://github.com/onlyoffice/documentserver/tree/master/document-formats"
click node_templates "https://github.com/onlyoffice/documentserver/tree/master/document-templates"
click node_fonts "https://github.com/onlyoffice/documentserver/tree/master/core-fonts"
click node_dictionaries "https://github.com/onlyoffice/documentserver/tree/master/dictionaries"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_host toneBlue
class node_webapps,node_shell,node_views,node_sdkjs,node_plugins toneAmber
class node_server,node_collab,node_convert toneMint
class node_formats,node_templates,node_fonts,node_dictionaries toneRose
```

## Components

### Integration

External systems and deployment boundary.

- **Host app**: dms/integration · External DMS or platform embedding ONLYOFFICE Docs.

### Browser client

Editor UI and shared client logic.

- [Web apps](https://github.com/onlyoffice/documentserver/tree/master/web-apps): editor UI · Browser-delivered shells and views for documents, sheets, slides, forms, PDF, and diagrams. · `web-apps`
- **Editor shell**: shared UI · Common editor chrome, controls, and collaboration UI.
- **Editor views**: document views · Type-specific editing and viewing surfaces for the supported editor families.
- [SDK JS](https://github.com/onlyoffice/documentserver/tree/master/sdkjs): client SDK · Shared editor APIs, host contract, plugins hooks, and state behavior. · `sdkjs`
- **Plugins**: extension layer · Optional editor extensions that add functionality alongside the core editors.

### Backend

Document server and conversion runtime.

- [Document server](https://github.com/onlyoffice/documentserver/tree/master/server): orchestration backend · Coordinates auth, sessions, storage, collaboration, and editor handoff. · `server`
- **Collaboration**: session layer · Co-editing, comments, review state, and live session coordination.
- [Conversion](https://github.com/onlyoffice/documentserver/tree/master/core): transform engine · Prepares files for editing, export, preview, and format translation. · `core`

### Assets

Fonts, language data, format metadata, and templates.

- [Format metadata](https://github.com/onlyoffice/documentserver/tree/master/document-formats): file-type registry · Supported document type definitions used to open, convert, and export files. · `document-formats`
- [Templates](https://github.com/onlyoffice/documentserver/tree/master/document-templates): starter assets · Blank and sample documents used when creating new files. · `document-templates`
- [Fonts](https://github.com/onlyoffice/documentserver/tree/master/core-fonts): render assets · Bundled fonts that improve layout fidelity and conversion consistency. · `core-fonts`
- [Dictionaries](https://github.com/onlyoffice/documentserver/tree/master/dictionaries): language assets · Spellcheck and language data for proofreading and localized editing. · `dictionaries`

## Connections

- 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.
