# enerzilius/convert architecture

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

- Interactive diagram: https://gitdiagram.com/enerzilius/convert
- Repository: https://github.com/enerzilius/convert

## Overview

Convert.to.it is a browser-based, privacy-oriented universal file converter. The user selects or drops files, chooses source and target formats, and requests conversion; the runtime searches a conversion path and invokes handlers for its steps, then offers generated files for download. The graph preserves the format catalog, handler registry, path search, and broad media/document/archive conversion capabilities. Source excerpts show initialization and path execution; the README documents the user workflow. Individual unsampled handler implementations are represented collectively.

Main entry points: [`src/handlers/index.ts`](https://github.com/enerzilius/convert/blob/master/src/handlers/index.ts) (Handler registry), [`src/main.ts`](https://github.com/enerzilius/convert/blob/master/src/main.ts) (Conversion coordinator), [`src/ui/pages/Conversion/index.tsx`](https://github.com/enerzilius/convert/blob/master/src/ui/pages/Conversion/index.tsx) (Format selection), [`src/Converter.ts`](https://github.com/enerzilius/convert/blob/master/src/Converter.ts) (Conversion executor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_upload["File upload<br/>[index.tsx]"]
  node_conversion_ui["Format selection<br/>[index.tsx]"]
  node_ui_shell["UI shell<br/>[index.tsx]"]
  node_download["Converted files<br/>[index.tsx]"]
end

subgraph group_runtime["Conversion runtime"]
  node_main["Conversion coordinator<br/>[main.ts]"]
  node_converter["Conversion executor<br/>[Converter.ts]"]
  node_path_search["Path search<br/>[TraversionGraph.ts]"]
  node_progress["Progress state<br/>[ProgressStore.ts]"]
end

subgraph group_catalog["Formats and handlers"]
  node_format_model["Format definitions<br/>[FormatHandler.ts]"]
  node_format_catalog["Format catalog<br/>[Formats.ts]"]
  node_registry["Handler registry<br/>[index.ts]"]
end

subgraph group_engines["Conversion capabilities"]
  node_media_handlers["Media handlers"]
  node_document_handlers["Document handlers"]
  node_archive_handlers["Archive and data handlers"]
end

node_user(("User"))

node_user -->|"selects files"| node_upload
node_upload -->|"continues to"| node_conversion_ui
node_user -->|"chooses formats"| node_conversion_ui
node_ui_shell -->|"renders"| node_upload
node_ui_shell -->|"renders"| node_conversion_ui
node_main -->|"initializes definitions"| node_registry
node_main -->|"initializes and queries"| node_path_search
node_main -->|"executes path steps"| node_converter
node_main -->|"reads conversion signal"| node_progress
node_path_search -->|"uses path nodes"| node_format_model
node_path_search -->|"uses categories"| node_format_catalog
node_format_model -->|"uses category types"| node_format_catalog
node_registry -->|"strips handler definitions"| node_format_model
node_converter -->|"gets handlers"| node_registry
node_converter -->|"reports progress"| node_progress
node_registry -.->|"loads handlers"| node_media_handlers
node_registry -.->|"loads handlers"| node_document_handlers
node_registry -.->|"loads handlers"| node_archive_handlers
node_conversion_ui -.->|"requests conversion"| node_main
node_conversion_ui -->|"downloads outputs"| node_download
node_converter -->|"produces outputs"| node_download

click node_upload "https://github.com/enerzilius/convert/blob/master/src/ui/pages/Upload/index.tsx"
click node_conversion_ui "https://github.com/enerzilius/convert/blob/master/src/ui/pages/Conversion/index.tsx"
click node_ui_shell "https://github.com/enerzilius/convert/blob/master/src/ui/index.tsx"
click node_main "https://github.com/enerzilius/convert/blob/master/src/main.ts"
click node_converter "https://github.com/enerzilius/convert/blob/master/src/Converter.ts"
click node_path_search "https://github.com/enerzilius/convert/blob/master/src/TraversionGraph.ts"
click node_progress "https://github.com/enerzilius/convert/blob/master/src/ui/ProgressStore.ts"
click node_format_model "https://github.com/enerzilius/convert/blob/master/src/FormatHandler.ts"
click node_format_catalog "https://github.com/enerzilius/convert/blob/master/src/Formats.ts"
click node_registry "https://github.com/enerzilius/convert/blob/master/src/handlers/index.ts"
click node_media_handlers "https://github.com/enerzilius/convert/tree/master/src/handlers"
click node_document_handlers "https://github.com/enerzilius/convert/tree/master/src/handlers"
click node_archive_handlers "https://github.com/enerzilius/convert/tree/master/src/handlers"
click node_download "https://github.com/enerzilius/convert/blob/master/src/ui/pages/Conversion/index.tsx"

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_upload,node_conversion_ui,node_ui_shell,node_download,node_user toneBlue
class node_main,node_converter,node_path_search,node_progress toneAmber
class node_format_model,node_format_catalog,node_registry toneMint
class node_media_handlers,node_document_handlers,node_archive_handlers toneRose
```

## Components

### User interface

- [File upload](https://github.com/enerzilius/convert/blob/master/src/ui/pages/Upload/index.tsx): `src/ui/pages/Upload/index.tsx`
- [Format selection](https://github.com/enerzilius/convert/blob/master/src/ui/pages/Conversion/index.tsx): `src/ui/pages/Conversion/index.tsx`
- [UI shell](https://github.com/enerzilius/convert/blob/master/src/ui/index.tsx): `src/ui/index.tsx`
- [Converted files](https://github.com/enerzilius/convert/blob/master/src/ui/pages/Conversion/index.tsx): `src/ui/pages/Conversion/index.tsx`

### Conversion runtime

- [Conversion coordinator](https://github.com/enerzilius/convert/blob/master/src/main.ts): `src/main.ts`
- [Conversion executor](https://github.com/enerzilius/convert/blob/master/src/Converter.ts): `src/Converter.ts`
- [Path search](https://github.com/enerzilius/convert/blob/master/src/TraversionGraph.ts): `src/TraversionGraph.ts`
- [Progress state](https://github.com/enerzilius/convert/blob/master/src/ui/ProgressStore.ts): `src/ui/ProgressStore.ts`

### Formats and handlers

- [Format definitions](https://github.com/enerzilius/convert/blob/master/src/FormatHandler.ts): `src/FormatHandler.ts`
- [Format catalog](https://github.com/enerzilius/convert/blob/master/src/Formats.ts): `src/Formats.ts`
- [Handler registry](https://github.com/enerzilius/convert/blob/master/src/handlers/index.ts): `src/handlers/index.ts`

### Conversion capabilities

- [Media handlers](https://github.com/enerzilius/convert/tree/master/src/handlers): `src/handlers`
- [Document handlers](https://github.com/enerzilius/convert/tree/master/src/handlers): `src/handlers`
- [Archive and data handlers](https://github.com/enerzilius/convert/tree/master/src/handlers): `src/handlers`

### Other components

- **User**

## Connections

- User → File upload: selects files (evidence: `README.md`)
- File upload → Format selection: continues to (evidence: `README.md`)
- User → Format selection: chooses formats (evidence: `README.md`)
- UI shell → File upload: renders (evidence: `src/ui/index.tsx`)
- UI shell → Format selection: renders (evidence: `src/ui/index.tsx`)
- Conversion coordinator → Handler registry: initializes definitions (evidence: `src/main.ts`)
- Conversion coordinator → Path search: initializes and queries (evidence: `src/main.ts`)
- Conversion coordinator → Conversion executor: executes path steps (evidence: `src/main.ts`)
- Conversion coordinator → Progress state: reads conversion signal (evidence: `src/main.ts`)
- Path search → Format definitions: uses path nodes (evidence: `src/TraversionGraph.ts`)
- Path search → Format catalog: uses categories (evidence: `src/TraversionGraph.ts`)
- Format definitions → Format catalog: uses category types (evidence: `src/FormatHandler.ts`)
- Handler registry → Format definitions: strips handler definitions (evidence: `src/handlers/index.ts`)
- Conversion executor → Handler registry: gets handlers (evidence: `src/Converter.ts`)
- Conversion executor → Progress state: reports progress (evidence: `src/Converter.ts`)
- Handler registry → Media handlers: loads handlers
- Handler registry → Document handlers: loads handlers
- Handler registry → Archive and data handlers: loads handlers
- Format selection → Conversion coordinator: requests conversion
- Format selection → Converted files: downloads outputs (evidence: `src/ui/pages/Conversion/index.tsx`)
- Conversion executor → Converted files: produces outputs
