# jmseb3/mtk architecture

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

- Interactive diagram: https://gitdiagram.com/jmseb3/mtk
- Repository: https://github.com/jmseb3/mtk

## Overview

MTK is a Kotlin Multiplatform library that converts Long, Int, and comma-formatted numeric strings into Korean won words, with options for group spacing, digit spacing, and the space before “원”. Its demo UI accepts an amount and options, calls the converter, and displays the result; Android, iOS, JVM, and web entry points host that UI. The conversion logic is concentrated in one runtime file, so its parsing, grouping, and rendering are kept together. Relationships for the sampled platform hosts are evidenced in source; broader platform support is visible in the tree.

Main entry points: [`composeApp/src/commonMain/kotlin/io/github/jmseb3/App.kt`](https://github.com/jmseb3/mtk/blob/main/composeApp/src/commonMain/kotlin/io/github/jmseb3/App.kt) (Input and options UI), [`moneytokorean/src/commonMain/kotlin/io/github/jmseb3/MTK.kt`](https://github.com/jmseb3/mtk/blob/main/moneytokorean/src/commonMain/kotlin/io/github/jmseb3/MTK.kt) (Korean amount converter), [`composeApp/src/iosMain/kotlin/io/github/jmseb3/MainViewController.kt`](https://github.com/jmseb3/mtk/blob/main/composeApp/src/iosMain/kotlin/io/github/jmseb3/MainViewController.kt) (iOS Compose host), [`iosApp/iosApp/ContentView.swift`](https://github.com/jmseb3/mtk/blob/main/iosApp/iosApp/ContentView.swift) (SwiftUI bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_converter["Conversion library"]
  node_converter_api["Korean amount converter<br/>[MTK.kt]"]
end

subgraph group_demo["Demo application"]
  node_demo_ui["Input and options UI<br/>[App.kt]"]
  node_android_host["Android host<br/>[MainActivity.kt]"]
  node_ios_kotlin_host["iOS Compose host"]
  node_ios_swift_view["SwiftUI bridge<br/>[ContentView.swift]"]
  node_ios_app["iOS app entry<br/>[iOSApp.swift]"]
  node_jvm_host["JVM host<br/>[main.kt]"]
  node_web_host["Web host<br/>[main.kt]"]
end

node_user(("User"))

node_user -.->|"enters amount"| node_demo_ui
node_demo_ui -->|"converts input"| node_converter_api
node_converter_api -->|"returns words"| node_demo_ui
node_android_host -->|"hosts UI"| node_demo_ui
node_ios_kotlin_host -->|"hosts UI"| node_demo_ui
node_ios_app -->|"shows view"| node_ios_swift_view
node_ios_swift_view -->|"bridges to"| node_ios_kotlin_host
node_jvm_host -->|"hosts UI"| node_demo_ui
node_web_host -->|"hosts UI"| node_demo_ui

click node_converter_api "https://github.com/jmseb3/mtk/blob/main/moneytokorean/src/commonMain/kotlin/io/github/jmseb3/MTK.kt"
click node_demo_ui "https://github.com/jmseb3/mtk/blob/main/composeApp/src/commonMain/kotlin/io/github/jmseb3/App.kt"
click node_android_host "https://github.com/jmseb3/mtk/blob/main/composeApp/src/androidMain/kotlin/io/github/jmseb3/MainActivity.kt"
click node_ios_kotlin_host "https://github.com/jmseb3/mtk/blob/main/composeApp/src/iosMain/kotlin/io/github/jmseb3/MainViewController.kt"
click node_ios_swift_view "https://github.com/jmseb3/mtk/blob/main/iosApp/iosApp/ContentView.swift"
click node_ios_app "https://github.com/jmseb3/mtk/blob/main/iosApp/iosApp/iOSApp.swift"
click node_jvm_host "https://github.com/jmseb3/mtk/blob/main/composeApp/src/jvmMain/kotlin/io/github/jmseb3/main.kt"
click node_web_host "https://github.com/jmseb3/mtk/blob/main/composeApp/src/webMain/kotlin/io/github/jmseb3/main.kt"

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_converter_api,node_user toneBlue
class node_demo_ui,node_android_host,node_ios_kotlin_host,node_ios_swift_view,node_ios_app,node_jvm_host,node_web_host toneAmber
```

## Components

### Conversion library

- [Korean amount converter](https://github.com/jmseb3/mtk/blob/main/moneytokorean/src/commonMain/kotlin/io/github/jmseb3/MTK.kt): `moneytokorean/src/commonMain/kotlin/io/github/jmseb3/MTK.kt`

### Demo application

- [Input and options UI](https://github.com/jmseb3/mtk/blob/main/composeApp/src/commonMain/kotlin/io/github/jmseb3/App.kt): `composeApp/src/commonMain/kotlin/io/github/jmseb3/App.kt`
- [Android host](https://github.com/jmseb3/mtk/blob/main/composeApp/src/androidMain/kotlin/io/github/jmseb3/MainActivity.kt): `composeApp/src/androidMain/kotlin/io/github/jmseb3/MainActivity.kt`
- [iOS Compose host](https://github.com/jmseb3/mtk/blob/main/composeApp/src/iosMain/kotlin/io/github/jmseb3/MainViewController.kt): `composeApp/src/iosMain/kotlin/io/github/jmseb3/MainViewController.kt`
- [SwiftUI bridge](https://github.com/jmseb3/mtk/blob/main/iosApp/iosApp/ContentView.swift): `iosApp/iosApp/ContentView.swift`
- [iOS app entry](https://github.com/jmseb3/mtk/blob/main/iosApp/iosApp/iOSApp.swift): `iosApp/iosApp/iOSApp.swift`
- [JVM host](https://github.com/jmseb3/mtk/blob/main/composeApp/src/jvmMain/kotlin/io/github/jmseb3/main.kt): `composeApp/src/jvmMain/kotlin/io/github/jmseb3/main.kt`
- [Web host](https://github.com/jmseb3/mtk/blob/main/composeApp/src/webMain/kotlin/io/github/jmseb3/main.kt): `composeApp/src/webMain/kotlin/io/github/jmseb3/main.kt`

### Other components

- **User**

## Connections

- User → Input and options UI: enters amount
- Input and options UI → Korean amount converter: converts input (evidence: `composeApp/src/commonMain/kotlin/io/github/jmseb3/App.kt`)
- Korean amount converter → Input and options UI: returns words (evidence: `composeApp/src/commonMain/kotlin/io/github/jmseb3/App.kt`)
- Android host → Input and options UI: hosts UI (evidence: `composeApp/src/androidMain/kotlin/io/github/jmseb3/MainActivity.kt`)
- iOS Compose host → Input and options UI: hosts UI (evidence: `composeApp/src/iosMain/kotlin/io/github/jmseb3/MainViewController.kt`)
- iOS app entry → SwiftUI bridge: shows view (evidence: `iosApp/iosApp/iOSApp.swift`)
- SwiftUI bridge → iOS Compose host: bridges to (evidence: `iosApp/iosApp/ContentView.swift`)
- JVM host → Input and options UI: hosts UI (evidence: `composeApp/src/jvmMain/kotlin/io/github/jmseb3/main.kt`)
- Web host → Input and options UI: hosts UI (evidence: `composeApp/src/webMain/kotlin/io/github/jmseb3/main.kt`)
