# mustafayildiran/lexudf architecture

> Architecture diagram of the GitHub repository mustafayildiran/lexudf, 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/mustafayildiran/lexudf
- Repository: https://github.com/mustafayildiran/lexudf

## Overview

LexUDF is an offline Chrome extension for preparing UYAP-compatible legal-document drafts. In the panel workflow, a user selects a template, fills or auto-fills its fields, reviews required fields and custom-text placeholders, then generates and downloads a `.udf` file. A separate UYAP Portal content script adds a download action that reads case details from the portal. The graph includes the six documented templates and shared document-generation layers; the portal implementation was read, but its internal wiring to the shared core is not established by the available reference index.

Main entry points: [`js/main.js`](https://github.com/mustafayildiran/lexudf/blob/main/js/main.js) (Panel controller), [`js/templates/index.js`](https://github.com/mustafayildiran/lexudf/blob/main/js/templates/index.js) (Template registry), [`js/core/builder.js`](https://github.com/mustafayildiran/lexudf/blob/main/js/core/builder.js) (Document builder), [`js/core/profiles.js`](https://github.com/mustafayildiran/lexudf/blob/main/js/core/profiles.js) (Attorney profiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_panel["Panel workflow"]
  node_main["Panel controller<br/>[main.js]"]
  node_form["Form validation<br/>[form.js]"]
  node_autofill["UYAP auto-fill<br/>[otofill.js]"]
  node_icrafill["Enforcement mapping<br/>[icraOtofill.js]"]
end

subgraph group_templates["Document templates"]
  node_registry["Template registry<br/>[index.js]"]
  node_inceleme["Case review request<br/>[inceleme.js]"]
  node_yetki["Authority certificate<br/>[yetkiBelgesi.js]"]
  node_cmk["CMK registration<br/>[cmkKayit.js]"]
  node_icra["Debt objection<br/>[icraItiraz.js]"]
  node_gerekceli["Reasoned judgment<br/>[gerekceliKarar.js]"]
  node_kesinlesme["Finalization request<br/>[kesinlesme.js]"]
end

subgraph group_generation["UDF generation"]
  node_blocks["Document blocks<br/>[blocks.js]"]
  node_builder["Document builder<br/>[builder.js]"]
  node_placeholders["Placeholder resolver<br/>[placeholders.js]"]
  node_xml["UDF XML writer<br/>[xml.js]"]
  node_zip["UDF archive<br/>[zip.js]"]
  node_utils["Filename utilities<br/>[utils.js]"]
end

subgraph group_portal["Portal integration"]
  node_portal_script["Portal downloader"]
end

subgraph group_profile["Local profiles"]
  node_profiles["Attorney profiles<br/>[profiles.js]"]
  node_storage[("Chrome local storage")]
end

node_user(("Extension user"))
node_uyap["UYAP Avukat Portal"]
node_download["Downloaded UDF"]

node_user -->|"uses panel"| node_main
node_main -->|"selects template"| node_registry
node_main -->|"collects and validates"| node_form
node_main -->|"builds document"| node_builder
node_main -->|"checks placeholders"| node_placeholders
node_main -->|"packages document"| node_zip
node_main -->|"names download"| node_utils
node_main -->|"initializes profiles"| node_profiles
node_main -->|"maps portal fields"| node_autofill
node_autofill -->|"uses enforcement mapping"| node_icrafill
node_registry -->|"registers"| node_inceleme
node_registry -->|"registers"| node_yetki
node_registry -->|"registers"| node_cmk
node_registry -->|"registers"| node_icra
node_registry -->|"registers"| node_gerekceli
node_registry -->|"registers"| node_kesinlesme
node_inceleme -->|"uses layout blocks"| node_blocks
node_yetki -->|"uses layout blocks"| node_blocks
node_icra -->|"uses layout blocks"| node_blocks
node_builder -->|"resolves custom text"| node_placeholders
node_builder -->|"writes XML"| node_xml
node_profiles -->|"fills template fields"| node_registry
node_profiles -->|"reads and writes"| node_storage
node_zip -->|"produces archive"| node_download
node_user -->|"uses portal action"| node_portal_script
node_uyap -->|"provides case details"| node_portal_script
node_portal_script -->|"offers UDF download"| node_download

click node_main "https://github.com/mustafayildiran/lexudf/blob/main/js/main.js"
click node_form "https://github.com/mustafayildiran/lexudf/blob/main/js/core/form.js"
click node_autofill "https://github.com/mustafayildiran/lexudf/blob/main/js/core/otofill.js"
click node_icrafill "https://github.com/mustafayildiran/lexudf/blob/main/js/core/icraOtofill.js"
click node_registry "https://github.com/mustafayildiran/lexudf/blob/main/js/templates/index.js"
click node_inceleme "https://github.com/mustafayildiran/lexudf/blob/main/js/templates/inceleme.js"
click node_yetki "https://github.com/mustafayildiran/lexudf/blob/main/js/templates/yetkiBelgesi.js"
click node_cmk "https://github.com/mustafayildiran/lexudf/blob/main/js/templates/cmkKayit.js"
click node_icra "https://github.com/mustafayildiran/lexudf/blob/main/js/templates/icraItiraz.js"
click node_gerekceli "https://github.com/mustafayildiran/lexudf/blob/main/js/templates/gerekceliKarar.js"
click node_kesinlesme "https://github.com/mustafayildiran/lexudf/blob/main/js/templates/kesinlesme.js"
click node_blocks "https://github.com/mustafayildiran/lexudf/blob/main/js/core/blocks.js"
click node_builder "https://github.com/mustafayildiran/lexudf/blob/main/js/core/builder.js"
click node_placeholders "https://github.com/mustafayildiran/lexudf/blob/main/js/core/placeholders.js"
click node_xml "https://github.com/mustafayildiran/lexudf/blob/main/js/core/xml.js"
click node_zip "https://github.com/mustafayildiran/lexudf/blob/main/js/core/zip.js"
click node_utils "https://github.com/mustafayildiran/lexudf/blob/main/js/core/utils.js"
click node_profiles "https://github.com/mustafayildiran/lexudf/blob/main/js/core/profiles.js"
click node_portal_script "https://github.com/mustafayildiran/lexudf/blob/main/portal/content-uyap-sablon.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_main,node_form,node_autofill,node_icrafill,node_user toneBlue
class node_registry,node_inceleme,node_yetki,node_cmk,node_icra,node_gerekceli,node_kesinlesme toneAmber
class node_blocks,node_builder,node_placeholders,node_xml,node_zip,node_utils toneMint
class node_portal_script toneRose
class node_profiles,node_storage,node_uyap,node_download toneIndigo
```

## Components

### Panel workflow

- [Panel controller](https://github.com/mustafayildiran/lexudf/blob/main/js/main.js): `js/main.js`
- [Form validation](https://github.com/mustafayildiran/lexudf/blob/main/js/core/form.js): `js/core/form.js`
- [UYAP auto-fill](https://github.com/mustafayildiran/lexudf/blob/main/js/core/otofill.js): `js/core/otofill.js`
- [Enforcement mapping](https://github.com/mustafayildiran/lexudf/blob/main/js/core/icraOtofill.js): `js/core/icraOtofill.js`

### Document templates

- [Template registry](https://github.com/mustafayildiran/lexudf/blob/main/js/templates/index.js): `js/templates/index.js`
- [Case review request](https://github.com/mustafayildiran/lexudf/blob/main/js/templates/inceleme.js): `js/templates/inceleme.js`
- [Authority certificate](https://github.com/mustafayildiran/lexudf/blob/main/js/templates/yetkiBelgesi.js): `js/templates/yetkiBelgesi.js`
- [CMK registration](https://github.com/mustafayildiran/lexudf/blob/main/js/templates/cmkKayit.js): `js/templates/cmkKayit.js`
- [Debt objection](https://github.com/mustafayildiran/lexudf/blob/main/js/templates/icraItiraz.js): `js/templates/icraItiraz.js`
- [Reasoned judgment](https://github.com/mustafayildiran/lexudf/blob/main/js/templates/gerekceliKarar.js): `js/templates/gerekceliKarar.js`
- [Finalization request](https://github.com/mustafayildiran/lexudf/blob/main/js/templates/kesinlesme.js): `js/templates/kesinlesme.js`

### UDF generation

- [Document blocks](https://github.com/mustafayildiran/lexudf/blob/main/js/core/blocks.js): `js/core/blocks.js`
- [Document builder](https://github.com/mustafayildiran/lexudf/blob/main/js/core/builder.js): `js/core/builder.js`
- [Placeholder resolver](https://github.com/mustafayildiran/lexudf/blob/main/js/core/placeholders.js): `js/core/placeholders.js`
- [UDF XML writer](https://github.com/mustafayildiran/lexudf/blob/main/js/core/xml.js): `js/core/xml.js`
- [UDF archive](https://github.com/mustafayildiran/lexudf/blob/main/js/core/zip.js): `js/core/zip.js`
- [Filename utilities](https://github.com/mustafayildiran/lexudf/blob/main/js/core/utils.js): `js/core/utils.js`

### Portal integration

- [Portal downloader](https://github.com/mustafayildiran/lexudf/blob/main/portal/content-uyap-sablon.js): `portal/content-uyap-sablon.js`

### Local profiles

- [Attorney profiles](https://github.com/mustafayildiran/lexudf/blob/main/js/core/profiles.js): `js/core/profiles.js`
- **Chrome local storage**

### Other components

- **Extension user**
- **UYAP Avukat Portal**
- **Downloaded UDF**

## Connections

- Extension user → Panel controller: uses panel (evidence: `README.md`)
- Panel controller → Template registry: selects template (evidence: `js/main.js`)
- Panel controller → Form validation: collects and validates (evidence: `js/main.js`)
- Panel controller → Document builder: builds document (evidence: `js/main.js`)
- Panel controller → Placeholder resolver: checks placeholders (evidence: `js/main.js`)
- Panel controller → UDF archive: packages document (evidence: `js/main.js`)
- Panel controller → Filename utilities: names download (evidence: `js/main.js`)
- Panel controller → Attorney profiles: initializes profiles (evidence: `js/main.js`)
- Panel controller → UYAP auto-fill: maps portal fields (evidence: `js/main.js`)
- UYAP auto-fill → Enforcement mapping: uses enforcement mapping (evidence: `js/core/otofill.js`)
- Template registry → Case review request: registers (evidence: `js/templates/index.js`)
- Template registry → Authority certificate: registers (evidence: `js/templates/index.js`)
- Template registry → CMK registration: registers (evidence: `js/templates/index.js`)
- Template registry → Debt objection: registers (evidence: `js/templates/index.js`)
- Template registry → Reasoned judgment: registers (evidence: `js/templates/index.js`)
- Template registry → Finalization request: registers (evidence: `js/templates/index.js`)
- Case review request → Document blocks: uses layout blocks (evidence: `js/templates/inceleme.js`)
- Authority certificate → Document blocks: uses layout blocks (evidence: `js/templates/yetkiBelgesi.js`)
- Debt objection → Document blocks: uses layout blocks (evidence: `js/templates/icraItiraz.js`)
- Document builder → Placeholder resolver: resolves custom text (evidence: `js/core/builder.js`)
- Document builder → UDF XML writer: writes XML (evidence: `js/core/builder.js`)
- Attorney profiles → Template registry: fills template fields (evidence: `js/core/profiles.js`)
- Attorney profiles → Chrome local storage: reads and writes (evidence: `js/core/profiles.js`)
- UDF archive → Downloaded UDF: produces archive
- Extension user → Portal downloader: uses portal action (evidence: `README.md`)
- UYAP Avukat Portal → Portal downloader: provides case details (evidence: `README.md`)
- Portal downloader → Downloaded UDF: offers UDF download (evidence: `README.md`)
