# haythamkhalil-dev/contact-card-builder architecture

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

- Interactive diagram: https://gitdiagram.com/haythamkhalil-dev/contact-card-builder
- Repository: https://github.com/haythamkhalil-dev/contact-card-builder

## Overview

Contact Card Builder is a browser-only tool that turns contact details into print-ready business cards and downloadable contact assets. The main workflow is form input and validation, vCard generation, QR creation, then shared card layout used by the live preview and PDF export; users can also download the vCard and QR image. Major branches include bilingual/RTL cards, full-sheet printing, optional backs, and browser-only detail persistence. The excerpts show the central app flow, but not every handler or storage call, so undocumented connections are omitted.

Main entry points: [`app.js`](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js) (Card layout), [`index.html`](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/index.html) (Contact form), [`lib/amiri-font.js`](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/lib/amiri-font.js) (Amiri font), [`lib/qrcode.js`](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/lib/qrcode.js) (QR generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Contact input"]
  node_form["Contact form<br/>[index.html]"]
  node_validation["Validation<br/>[app.js]"]
  node_persistence[("Saved details<br/>[app.js]")]
end

subgraph group_contact["Contact data"]
  node_formread["Read form<br/>[app.js]"]
  node_vcard["vCard builder<br/>[app.js]"]
  node_qr["QR generator<br/>[qrcode.js]"]
  node_qrmodel["QR model<br/>[app.js]"]
end

subgraph group_design["Card design"]
  node_layout["Card layout<br/>[app.js]"]
  node_bilingual["English and Arabic<br/>[app.js]"]
  node_amiri["Amiri font<br/>[amiri-font.js]"]
end

subgraph group_outputs["Preview and exports"]
  node_preview["Live preview<br/>[app.js]"]
  node_pdf["PDF export<br/>[app.js]"]
  node_vcfdownload["VCF download<br/>[app.js]"]
  node_qrdownload["QR PNG download<br/>[app.js]"]
end

node_user(("Card creator"))

node_user -->|"enters details"| node_form
node_form -->|"validates"| node_validation
node_form -->|"reads input"| node_formread
node_formread -->|"builds contact"| node_vcard
node_vcard -->|"encodes vCard"| node_qrmodel
node_qrmodel -.->|"generates code"| node_qr
node_qrmodel -->|"supplies QR"| node_layout
node_formread -->|"supplies details"| node_layout
node_layout -->|"draws preview"| node_preview
node_layout -->|"draws PDF"| node_pdf
node_vcard -.->|"downloads contact"| node_vcfdownload
node_qrmodel -.->|"downloads image"| node_qrdownload
node_form -.->|"remembers details"| node_persistence
node_bilingual -.->|"localizes card"| node_layout
node_amiri -.->|"renders Arabic"| node_layout

click node_form "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/index.html"
click node_validation "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js"
click node_persistence "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js"
click node_formread "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js"
click node_vcard "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js"
click node_qr "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/lib/qrcode.js"
click node_qrmodel "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js"
click node_layout "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js"
click node_bilingual "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js"
click node_amiri "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/lib/amiri-font.js"
click node_preview "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js"
click node_pdf "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js"
click node_vcfdownload "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js"
click node_qrdownload "https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.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_form,node_validation,node_persistence toneBlue
class node_formread,node_vcard,node_qr,node_qrmodel toneAmber
class node_layout,node_bilingual,node_amiri toneMint
class node_preview,node_pdf,node_vcfdownload,node_qrdownload toneRose
class node_user toneIndigo
```

## Components

### Contact input

- [Contact form](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/index.html): `index.html`
- [Validation](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js): `app.js`
- [Saved details](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js): `app.js`

### Contact data

- [Read form](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js): `app.js`
- [vCard builder](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js): `app.js`
- [QR generator](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/lib/qrcode.js): `lib/qrcode.js`
- [QR model](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js): `app.js`

### Card design

- [Card layout](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js): `app.js`
- [English and Arabic](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js): `app.js`
- [Amiri font](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/lib/amiri-font.js): `lib/amiri-font.js`

### Preview and exports

- [Live preview](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js): `app.js`
- [PDF export](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js): `app.js`
- [VCF download](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js): `app.js`
- [QR PNG download](https://github.com/haythamkhalil-dev/contact-card-builder/blob/main/app.js): `app.js`

### Other components

- **Card creator**

## Connections

- Card creator → Contact form: enters details (evidence: `README.md`)
- Contact form → Validation: validates (evidence: `README.md`)
- Contact form → Read form: reads input (evidence: `app.js`)
- Read form → vCard builder: builds contact (evidence: `app.js`)
- vCard builder → QR model: encodes vCard (evidence: `app.js`)
- QR model → QR generator: generates code
- QR model → Card layout: supplies QR (evidence: `app.js`)
- Read form → Card layout: supplies details (evidence: `app.js`)
- Card layout → Live preview: draws preview (evidence: `README.md`)
- Card layout → PDF export: draws PDF (evidence: `app.js`)
- vCard builder → VCF download: downloads contact (evidence: `app.js`)
- QR model → QR PNG download: downloads image (evidence: `app.js`)
- Contact form → Saved details: remembers details (evidence: `README.md`)
- English and Arabic → Card layout: localizes card (evidence: `app.js`)
- Amiri font → Card layout: renders Arabic (evidence: `README.md`)
