# eimza-kep/uyap-web-udf-editor architecture

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

- Interactive diagram: https://gitdiagram.com/eimza-kep/uyap-web-udf-editor
- Repository: https://github.com/eimza-kep/uyap-web-udf-editor

## Overview

UYAP Web UDF Editörü is an offline, browser-only legal-document editor. Users open UDF/XML, DOCX, PDF, or scanned TIFF/image files, edit the resulting document in an A4-style page, optionally start from a legal template, and download the work as UDF. The UI coordinates format-specific imports; the UDF parser and generator implement the native format boundary. The README documents all import formats and offline operation, while sampled source confirms UI dispatch, template use, DOCX conversion, TIFF OCR, and UDF parsing/generation. Some PDF and export wiring is documented but not fully excerpted.

Main entry points: [`js/editor-ui.js`](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/editor-ui.js) (Editor controls), [`js/udf-generator.js`](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/udf-generator.js) (UDF generation), [`js/templates.js`](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/templates.js) (Legal template library), [`index.html`](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/index.html) (Browser application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Editing interface"]
  node_webapp["Browser application<br/>[index.html]"]
  node_editor["Editor controls<br/>[editor-ui.js]"]
  node_page["A4 page styling<br/>[editor.css]"]
end

subgraph group_import["Document import"]
  node_fileinput["File import dispatch<br/>[editor-ui.js]"]
  node_docx["DOCX conversion<br/>[editor-ui.js]"]
  node_pdf["PDF text import<br/>[editor-ui.js]"]
  node_ocr["TIFF image OCR<br/>[editor-ui.js]"]
end

subgraph group_udf["UDF format"]
  node_udfparser["UDF parsing<br/>[udf-parser.js]"]
  node_udfgenerator["UDF generation<br/>[udf-generator.js]"]
  node_jszip["JSZip archive"]
  node_download["Downloaded UDF"]
end

subgraph group_templates["Legal templates"]
  node_templatesdata["Legal template library<br/>[templates.js]"]
end

node_user(("Document user"))
node_mammoth["Mammoth.js"]
node_pdfjs["PDF.js"]
node_tesseract["Tesseract.js"]
node_utif["UTIF.js"]

node_user -->|"opens"| node_webapp
node_webapp -->|"loads interface"| node_editor
node_editor -->|"edits on"| node_page
node_user -->|"selects file"| node_fileinput
node_fileinput -->|"parses UDF"| node_udfparser
node_fileinput -->|"dispatches DOCX"| node_docx
node_docx -->|"converts with"| node_mammoth
node_fileinput -->|"dispatches PDF"| node_pdf
node_pdf -.->|"extracts text"| node_pdfjs
node_fileinput -->|"dispatches TIFF"| node_ocr
node_ocr -.->|"decodes image"| node_utif
node_ocr -->|"recognizes text"| node_tesseract
node_udfparser -->|"returns HTML"| node_editor
node_user -->|"chooses template"| node_templatesdata
node_editor -->|"renders templates"| node_templatesdata
node_templatesdata -->|"provides HTML"| node_editor
node_editor -.->|"exports document"| node_udfgenerator
node_udfgenerator -->|"creates archive"| node_jszip
node_udfgenerator -->|"downloads file"| node_download
node_download -->|"delivers UDF"| node_user

click node_webapp "https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/index.html"
click node_editor "https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/editor-ui.js"
click node_page "https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/css/editor.css"
click node_fileinput "https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/editor-ui.js"
click node_docx "https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/editor-ui.js"
click node_pdf "https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/editor-ui.js"
click node_ocr "https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/editor-ui.js"
click node_udfparser "https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/udf-parser.js"
click node_udfgenerator "https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/udf-generator.js"
click node_templatesdata "https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/templates.js"

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_webapp,node_editor,node_page,node_user toneBlue
class node_fileinput,node_docx,node_pdf,node_ocr toneAmber
class node_udfparser,node_udfgenerator,node_jszip,node_download toneMint
class node_templatesdata toneRose
class node_mammoth,node_pdfjs,node_tesseract,node_utif toneIndigo
```

## Components

### Editing interface

- [Browser application](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/index.html): `index.html`
- [Editor controls](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/editor-ui.js): `js/editor-ui.js`
- [A4 page styling](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/css/editor.css): `css/editor.css`

### Document import

- [File import dispatch](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/editor-ui.js): `js/editor-ui.js`
- [DOCX conversion](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/editor-ui.js): `js/editor-ui.js`
- [PDF text import](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/editor-ui.js): `js/editor-ui.js`
- [TIFF image OCR](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/editor-ui.js): `js/editor-ui.js`

### UDF format

- [UDF parsing](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/udf-parser.js): `js/udf-parser.js`
- [UDF generation](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/udf-generator.js): `js/udf-generator.js`
- **JSZip archive**
- **Downloaded UDF**

### Legal templates

- [Legal template library](https://github.com/eimza-kep/uyap-web-udf-editor/blob/master/js/templates.js): `js/templates.js`

### Other components

- **Document user**
- **Mammoth.js**
- **PDF.js**
- **Tesseract.js**
- **UTIF.js**

## Connections

- Document user → Browser application: opens (evidence: `README.md`)
- Browser application → Editor controls: loads interface (evidence: `README.md`)
- Editor controls → A4 page styling: edits on (evidence: `README.md`)
- Document user → File import dispatch: selects file (evidence: `README.md`)
- File import dispatch → UDF parsing: parses UDF (evidence: `js/editor-ui.js`)
- File import dispatch → DOCX conversion: dispatches DOCX (evidence: `js/editor-ui.js`)
- DOCX conversion → Mammoth.js: converts with (evidence: `js/editor-ui.js`)
- File import dispatch → PDF text import: dispatches PDF (evidence: `README.md`)
- PDF text import → PDF.js: extracts text (evidence: `README.md`)
- File import dispatch → TIFF image OCR: dispatches TIFF (evidence: `js/editor-ui.js`)
- TIFF image OCR → UTIF.js: decodes image (evidence: `README.md`)
- TIFF image OCR → Tesseract.js: recognizes text (evidence: `js/editor-ui.js`)
- UDF parsing → Editor controls: returns HTML (evidence: `js/editor-ui.js`)
- Document user → Legal template library: chooses template
- Editor controls → Legal template library: renders templates (evidence: `js/editor-ui.js`)
- Legal template library → Editor controls: provides HTML (evidence: `js/editor-ui.js`)
- Editor controls → UDF generation: exports document (evidence: `README.md`)
- UDF generation → JSZip archive: creates archive (evidence: `js/udf-generator.js`)
- UDF generation → Downloaded UDF: downloads file (evidence: `js/udf-generator.js`)
- Downloaded UDF → Document user: delivers UDF (evidence: `README.md`)
