# eees0/jakupsil architecture

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

- Interactive diagram: https://gitdiagram.com/eees0/jakupsil
- Repository: https://github.com/eees0/jakupsil

## Overview

Jakupsil is a browser-based document editor that turns formatted editor content into downloadable DOCX or PDF files. The main flow is authoring and formatting in the editor, posting its JSON content to the Spring API, generating the selected file, and downloading it in the browser. The graph also shows the request model and the editor’s server-wakeup ping. PDF generation is present in the source and UI flow, although the README still lists it as planned; unsampled HTML wiring and implementation details are omitted.

Main entry points: [`src/main/resources/static/js/editor/main.js`](https://github.com/eees0/jakupsil/blob/main/src/main/resources/static/js/editor/main.js) (Editor runtime), [`src/main/java/io/github/EEES0/docxeditor/controller/ApiController.java`](https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/controller/ApiController.java) (Document API), [`src/main/java/io/github/EEES0/docxeditor/dto/createFile/ContentNode.java`](https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/dto/createFile/ContentNode.java) (Content nodes), [`src/main/java/io/github/EEES0/docxeditor/service/CreateDocx.java`](https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/service/CreateDocx.java) (DOCX generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web editor"]
  node_editor["Editor runtime<br/>[main.js]"]
  node_toolbar["Formatting toolbar<br/>[toolbar.js]"]
  node_theme["Editor theme<br/>[theme.js]"]
  node_download["Download client<br/>[download.js]"]
  node_ping["Server wakeup ping<br/>[server.js]"]
end

subgraph group_api["API boundary"]
  node_api["Document API<br/>[ApiController.java]"]
end

subgraph group_generation["File generation"]
  node_docx["DOCX generator<br/>[CreateDocx.java]"]
  node_pdf["PDF generator<br/>[CreatePdf.java]"]
end

subgraph group_model["Document model"]
  node_request["JSON request model"]
  node_content["Content nodes<br/>[ContentNode.java]"]
  node_text["Text and marks<br/>[TextNode.java]"]
  node_attrs["Node attributes<br/>[Attrs.java]"]
  node_markattrs["Mark attributes<br/>[MarkAttrs.java]"]
end

node_author(("Document author"))
node_browserfile["Downloaded file"]

node_author -->|"writes in"| node_editor
node_editor -->|"initializes"| node_toolbar
node_editor -->|"initializes"| node_theme
node_editor -->|"initializes"| node_download
node_editor -->|"initializes"| node_ping
node_toolbar -->|"formats content"| node_editor
node_download -->|"posts JSON"| node_api
node_ping -->|"pings"| node_api
node_api -->|"accepts"| node_request
node_api -->|"calls for DOCX"| node_docx
node_api -->|"calls for PDF"| node_pdf
node_docx -->|"reads"| node_content
node_pdf -->|"reads"| node_content
node_content -->|"uses"| node_attrs
node_content -->|"contains"| node_text
node_text -->|"uses marks"| node_markattrs
node_docx -->|"returns bytes via API"| node_browserfile
node_pdf -->|"returns bytes via API"| node_browserfile
node_browserfile -->|"downloads in browser"| node_author

click node_editor "https://github.com/eees0/jakupsil/blob/main/src/main/resources/static/js/editor/main.js"
click node_toolbar "https://github.com/eees0/jakupsil/blob/main/src/main/resources/static/js/editor/toolbar.js"
click node_theme "https://github.com/eees0/jakupsil/blob/main/src/main/resources/static/js/editor/theme.js"
click node_download "https://github.com/eees0/jakupsil/blob/main/src/main/resources/static/js/editor/download.js"
click node_ping "https://github.com/eees0/jakupsil/blob/main/src/main/resources/static/js/editor/server.js"
click node_api "https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/controller/ApiController.java"
click node_request "https://github.com/eees0/jakupsil/tree/main/src/main/java/io/github/EEES0/docxeditor/dto/createFile"
click node_content "https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/dto/createFile/ContentNode.java"
click node_text "https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/dto/createFile/TextNode.java"
click node_attrs "https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/dto/createFile/Attrs.java"
click node_markattrs "https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/dto/createFile/MarkAttrs.java"
click node_docx "https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/service/CreateDocx.java"
click node_pdf "https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/service/CreatePdf.java"

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_editor,node_toolbar,node_theme,node_download,node_ping toneBlue
class node_api toneAmber
class node_docx,node_pdf toneMint
class node_request,node_content,node_text,node_attrs,node_markattrs toneRose
class node_author,node_browserfile toneIndigo
```

## Components

### Web editor

- [Editor runtime](https://github.com/eees0/jakupsil/blob/main/src/main/resources/static/js/editor/main.js): `src/main/resources/static/js/editor/main.js`
- [Formatting toolbar](https://github.com/eees0/jakupsil/blob/main/src/main/resources/static/js/editor/toolbar.js): `src/main/resources/static/js/editor/toolbar.js`
- [Editor theme](https://github.com/eees0/jakupsil/blob/main/src/main/resources/static/js/editor/theme.js): `src/main/resources/static/js/editor/theme.js`
- [Download client](https://github.com/eees0/jakupsil/blob/main/src/main/resources/static/js/editor/download.js): `src/main/resources/static/js/editor/download.js`
- [Server wakeup ping](https://github.com/eees0/jakupsil/blob/main/src/main/resources/static/js/editor/server.js): `src/main/resources/static/js/editor/server.js`

### API boundary

- [Document API](https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/controller/ApiController.java): `src/main/java/io/github/EEES0/docxeditor/controller/ApiController.java`

### File generation

- [DOCX generator](https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/service/CreateDocx.java): `src/main/java/io/github/EEES0/docxeditor/service/CreateDocx.java`
- [PDF generator](https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/service/CreatePdf.java): `src/main/java/io/github/EEES0/docxeditor/service/CreatePdf.java`

### Document model

- [JSON request model](https://github.com/eees0/jakupsil/tree/main/src/main/java/io/github/EEES0/docxeditor/dto/createFile): `src/main/java/io/github/EEES0/docxeditor/dto/createFile`
- [Content nodes](https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/dto/createFile/ContentNode.java): `src/main/java/io/github/EEES0/docxeditor/dto/createFile/ContentNode.java`
- [Text and marks](https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/dto/createFile/TextNode.java): `src/main/java/io/github/EEES0/docxeditor/dto/createFile/TextNode.java`
- [Node attributes](https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/dto/createFile/Attrs.java): `src/main/java/io/github/EEES0/docxeditor/dto/createFile/Attrs.java`
- [Mark attributes](https://github.com/eees0/jakupsil/blob/main/src/main/java/io/github/EEES0/docxeditor/dto/createFile/MarkAttrs.java): `src/main/java/io/github/EEES0/docxeditor/dto/createFile/MarkAttrs.java`

### Other components

- **Document author**
- **Downloaded file**

## Connections

- Document author → Editor runtime: writes in
- Editor runtime → Formatting toolbar: initializes (evidence: `src/main/resources/static/js/editor/main.js`)
- Editor runtime → Editor theme: initializes (evidence: `src/main/resources/static/js/editor/main.js`)
- Editor runtime → Download client: initializes (evidence: `src/main/resources/static/js/editor/main.js`)
- Editor runtime → Server wakeup ping: initializes (evidence: `src/main/resources/static/js/editor/main.js`)
- Formatting toolbar → Editor runtime: formats content (evidence: `src/main/resources/static/js/editor/toolbar.js`)
- Download client → Document API: posts JSON (evidence: `src/main/resources/static/js/editor/download.js`)
- Server wakeup ping → Document API: pings (evidence: `src/main/resources/static/js/editor/server.js`)
- Document API → JSON request model: accepts (evidence: `src/main/java/io/github/EEES0/docxeditor/controller/ApiController.java`)
- Document API → DOCX generator: calls for DOCX (evidence: `src/main/java/io/github/EEES0/docxeditor/controller/ApiController.java`)
- Document API → PDF generator: calls for PDF (evidence: `src/main/java/io/github/EEES0/docxeditor/controller/ApiController.java`)
- DOCX generator → Content nodes: reads (evidence: `src/main/java/io/github/EEES0/docxeditor/service/CreateDocx.java`)
- PDF generator → Content nodes: reads (evidence: `src/main/java/io/github/EEES0/docxeditor/service/CreatePdf.java`)
- Content nodes → Node attributes: uses (evidence: `src/main/java/io/github/EEES0/docxeditor/dto/createFile/ContentNode.java`)
- Content nodes → Text and marks: contains (evidence: `src/main/java/io/github/EEES0/docxeditor/dto/createFile/ContentNode.java`)
- Text and marks → Mark attributes: uses marks
- DOCX generator → Downloaded file: returns bytes via API
- PDF generator → Downloaded file: returns bytes via API
- Downloaded file → Document author: downloads in browser
