# barqx/pak-urdu-phonetic architecture

> Architecture diagram of the GitHub repository barqx/pak-urdu-phonetic, 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/barqx/pak-urdu-phonetic
- Repository: https://github.com/barqx/pak-urdu-phonetic

## Overview

Pak Urdu Phonetic is a cross-platform Urdu keyboard layout. Users press phonetic keys and receive Urdu Unicode characters through either Keyman or Linux XKB; the repository also includes conversion and comparison utilities for maintaining those implementations. The README documents Keyman packaging and an on-screen keyboard, while sampled implementation detail is limited to the converter scripts and part of the help page, so runtime wiring beyond documented capabilities is not asserted.

Main entry points: [`Keyman/source/pak_urdu_phonetic.kmn`](https://github.com/barqx/pak-urdu-phonetic/blob/master/Keyman/source/pak_urdu_phonetic.kmn) (Keyman mappings), [`XKB/symbols/pk`](https://github.com/barqx/pak-urdu-phonetic/blob/master/XKB/symbols/pk) (XKB mappings), [`KMN-XKB-Converter/kmn_xkb_compare.py`](https://github.com/barqx/pak-urdu-phonetic/blob/master/KMN-XKB-Converter/kmn_xkb_compare.py) (Layout comparison), [`Keyman/source/pak_urdu_phonetic.kps`](https://github.com/barqx/pak-urdu-phonetic/blob/master/Keyman/source/pak_urdu_phonetic.kps) (Keyman package)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_keyman["Keyman layout"]
  node_keyman_layout["Keyman mappings"]
  node_touch_keyboard["On-screen keyboard"]
  node_keyman_package["Keyman package"]
end

subgraph group_xkb["Linux XKB"]
  node_xkb_symbols["XKB mappings"]
  node_xkb_listing["XKB layout listing<br/>[base.xml]"]
end

subgraph group_tools["Layout utilities"]
  node_kmn_converter["KMN to XKB<br/>[kmn_to_xkb.py]"]
  node_layout_comparison["Layout comparison<br/>[kmn_xkb_compare.py]"]
  node_comparison_csv["Comparison results"]
end

subgraph group_guides["User guidance"]
  node_keyboard_help["Mapping help"]
end

node_typist(("Urdu typist"))
node_keyman_runtime{{"Keyman platform"}}
node_xkb_runtime{{"Linux XKB"}}
node_urdu_text["Urdu text"]

node_typist -->|"types with"| node_keyman_runtime
node_keyman_runtime -->|"uses mappings"| node_keyman_layout
node_typist -->|"types with"| node_xkb_runtime
node_xkb_runtime -->|"uses mappings"| node_xkb_symbols
node_keyman_layout -->|"produces Unicode"| node_urdu_text
node_xkb_symbols -->|"produces Unicode"| node_urdu_text
node_keyman_runtime -->|"supports touch input"| node_touch_keyboard
node_keyman_package -.->|"packages layout"| node_keyman_layout
node_keyman_package -.->|"packages keyboard"| node_touch_keyboard
node_xkb_listing -.->|"lists layout"| node_xkb_symbols
node_kmn_converter -->|"reads KMN"| node_keyman_layout
node_kmn_converter -->|"generates XKB"| node_xkb_symbols
node_layout_comparison -->|"reads KMN"| node_keyman_layout
node_layout_comparison -->|"reads XKB"| node_xkb_symbols
node_layout_comparison -->|"writes results"| node_comparison_csv
node_typist -.->|"consults mappings"| node_keyboard_help

click node_keyman_layout "https://github.com/barqx/pak-urdu-phonetic/blob/master/Keyman/source/pak_urdu_phonetic.kmn"
click node_touch_keyboard "https://github.com/barqx/pak-urdu-phonetic/blob/master/Keyman/source/pak_urdu_phonetic.kvks"
click node_keyman_package "https://github.com/barqx/pak-urdu-phonetic/blob/master/Keyman/source/pak_urdu_phonetic.kps"
click node_xkb_symbols "https://github.com/barqx/pak-urdu-phonetic/blob/master/XKB/symbols/pk"
click node_xkb_listing "https://github.com/barqx/pak-urdu-phonetic/blob/master/XKB/rules/base.xml"
click node_kmn_converter "https://github.com/barqx/pak-urdu-phonetic/blob/master/KMN-XKB-Converter/kmn_to_xkb.py"
click node_layout_comparison "https://github.com/barqx/pak-urdu-phonetic/blob/master/KMN-XKB-Converter/kmn_xkb_compare.py"
click node_comparison_csv "https://github.com/barqx/pak-urdu-phonetic/blob/master/KMN-XKB-Converter/kmn_xkb_compare.csv"
click node_keyboard_help "https://github.com/barqx/pak-urdu-phonetic/blob/master/Keyman/source/help/pak_urdu_phonetic.php"

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_keyman_layout,node_touch_keyboard,node_keyman_package toneBlue
class node_xkb_symbols,node_xkb_listing toneAmber
class node_kmn_converter,node_layout_comparison,node_comparison_csv toneMint
class node_keyboard_help toneRose
class node_typist,node_keyman_runtime,node_xkb_runtime,node_urdu_text toneIndigo
```

## Components

### Keyman layout

- [Keyman mappings](https://github.com/barqx/pak-urdu-phonetic/blob/master/Keyman/source/pak_urdu_phonetic.kmn): `Keyman/source/pak_urdu_phonetic.kmn`
- [On-screen keyboard](https://github.com/barqx/pak-urdu-phonetic/blob/master/Keyman/source/pak_urdu_phonetic.kvks): `Keyman/source/pak_urdu_phonetic.kvks`
- [Keyman package](https://github.com/barqx/pak-urdu-phonetic/blob/master/Keyman/source/pak_urdu_phonetic.kps): `Keyman/source/pak_urdu_phonetic.kps`

### Linux XKB

- [XKB mappings](https://github.com/barqx/pak-urdu-phonetic/blob/master/XKB/symbols/pk): `XKB/symbols/pk`
- [XKB layout listing](https://github.com/barqx/pak-urdu-phonetic/blob/master/XKB/rules/base.xml): `XKB/rules/base.xml`

### Layout utilities

- [KMN to XKB](https://github.com/barqx/pak-urdu-phonetic/blob/master/KMN-XKB-Converter/kmn_to_xkb.py): `KMN-XKB-Converter/kmn_to_xkb.py`
- [Layout comparison](https://github.com/barqx/pak-urdu-phonetic/blob/master/KMN-XKB-Converter/kmn_xkb_compare.py): `KMN-XKB-Converter/kmn_xkb_compare.py`
- [Comparison results](https://github.com/barqx/pak-urdu-phonetic/blob/master/KMN-XKB-Converter/kmn_xkb_compare.csv): `KMN-XKB-Converter/kmn_xkb_compare.csv`

### User guidance

- [Mapping help](https://github.com/barqx/pak-urdu-phonetic/blob/master/Keyman/source/help/pak_urdu_phonetic.php): `Keyman/source/help/pak_urdu_phonetic.php`

### Other components

- **Urdu typist**
- **Keyman platform**
- **Linux XKB**
- **Urdu text**

## Connections

- Urdu typist → Keyman platform: types with (evidence: `README.md`)
- Keyman platform → Keyman mappings: uses mappings (evidence: `README.md`)
- Urdu typist → Linux XKB: types with (evidence: `README.md`)
- Linux XKB → XKB mappings: uses mappings (evidence: `README.md`)
- Keyman mappings → Urdu text: produces Unicode (evidence: `README.md`)
- XKB mappings → Urdu text: produces Unicode (evidence: `README.md`)
- Keyman platform → On-screen keyboard: supports touch input (evidence: `README.md`)
- Keyman package → Keyman mappings: packages layout
- Keyman package → On-screen keyboard: packages keyboard
- XKB layout listing → XKB mappings: lists layout
- KMN to XKB → Keyman mappings: reads KMN (evidence: `KMN-XKB-Converter/kmn_to_xkb.py`)
- KMN to XKB → XKB mappings: generates XKB (evidence: `KMN-XKB-Converter/kmn_to_xkb.py`)
- Layout comparison → Keyman mappings: reads KMN (evidence: `KMN-XKB-Converter/kmn_xkb_compare.py`)
- Layout comparison → XKB mappings: reads XKB (evidence: `KMN-XKB-Converter/kmn_xkb_compare.py`)
- Layout comparison → Comparison results: writes results (evidence: `KMN-XKB-Converter/kmn_xkb_compare.py`)
- Urdu typist → Mapping help: consults mappings
