# mattiasthalen/qlik-parser architecture

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

- Interactive diagram: https://gitdiagram.com/mattiasthalen/qlik-parser
- Repository: https://github.com/mattiasthalen/qlik-parser

## Overview

qlik-parser is a CLI for scanning QlikView (.qvw) and Qlik Sense (.qvf) files and exporting embedded artifacts. The main workflow dispatches `extract`, discovers source files, parses each format, selects and encodes requested artifacts, then writes them into per-source output folders while reporting per-file results. QVW supports load scripts; QVF supports scripts, master measures, master dimensions, and variables. The documented `version` command is a separate branch. Relationships follow the sampled command and extractor code; no external service or persistent database is involved.

Main entry points: [`cmd/extract.go`](https://github.com/mattiasthalen/qlik-parser/blob/main/cmd/extract.go) (Extract command), [`cmd/root.go`](https://github.com/mattiasthalen/qlik-parser/blob/main/cmd/root.go) (Root command), [`main.go`](https://github.com/mattiasthalen/qlik-parser/blob/main/main.go) (Program entry), [`internal/extractor/walker.go`](https://github.com/mattiasthalen/qlik-parser/blob/main/internal/extractor/walker.go) (File walker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI commands"]
  node_main["Program entry<br/>[main.go]"]
  node_root["Root command<br/>[root.go]"]
  node_extract["Extract command<br/>[extract.go]"]
  node_version["Version command<br/>[version.go]"]
end

subgraph group_parse["File parsing"]
  node_walker["File walker<br/>[walker.go]"]
  node_qvw["QVW script parser<br/>[qvw.go]"]
  node_qvf["QVF artifact parser<br/>[qvf.go]"]
end

subgraph group_output["Export and reporting"]
  node_resolver["Output path resolver<br/>[exporter.go]"]
  node_writer["Artifact writer<br/>[exporter.go]"]
  node_printer["Result printer<br/>[output.go]"]
end

node_user(("CLI user"))
node_source[("Source files")]
node_destination[("Output files")]

node_user -->|"runs"| node_main
node_main -->|"executes"| node_root
node_root -->|"dispatches"| node_extract
node_root -->|"dispatches"| node_version
node_extract -->|"scans"| node_walker
node_walker -->|"finds files"| node_source
node_extract -->|"extracts script"| node_qvw
node_extract -->|"parses artifacts"| node_qvf
node_qvw -->|"reads"| node_source
node_qvf -->|"reads"| node_source
node_extract -->|"resolves path"| node_resolver
node_extract -->|"writes artifacts"| node_writer
node_writer -->|"writes"| node_destination
node_extract -->|"reports results"| node_printer

click node_main "https://github.com/mattiasthalen/qlik-parser/blob/main/main.go"
click node_root "https://github.com/mattiasthalen/qlik-parser/blob/main/cmd/root.go"
click node_extract "https://github.com/mattiasthalen/qlik-parser/blob/main/cmd/extract.go"
click node_version "https://github.com/mattiasthalen/qlik-parser/blob/main/cmd/version.go"
click node_walker "https://github.com/mattiasthalen/qlik-parser/blob/main/internal/extractor/walker.go"
click node_qvw "https://github.com/mattiasthalen/qlik-parser/blob/main/internal/extractor/qvw.go"
click node_qvf "https://github.com/mattiasthalen/qlik-parser/blob/main/internal/extractor/qvf.go"
click node_resolver "https://github.com/mattiasthalen/qlik-parser/blob/main/internal/extractor/exporter.go"
click node_writer "https://github.com/mattiasthalen/qlik-parser/blob/main/internal/extractor/exporter.go"
click node_printer "https://github.com/mattiasthalen/qlik-parser/blob/main/internal/ui/output.go"

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_root,node_extract,node_version,node_user toneBlue
class node_walker,node_qvw,node_qvf,node_source,node_destination toneAmber
class node_resolver,node_writer,node_printer toneMint
```

## Components

### CLI commands

- [Program entry](https://github.com/mattiasthalen/qlik-parser/blob/main/main.go): `main.go`
- [Root command](https://github.com/mattiasthalen/qlik-parser/blob/main/cmd/root.go): `cmd/root.go`
- [Extract command](https://github.com/mattiasthalen/qlik-parser/blob/main/cmd/extract.go): `cmd/extract.go`
- [Version command](https://github.com/mattiasthalen/qlik-parser/blob/main/cmd/version.go): `cmd/version.go`

### File parsing

- [File walker](https://github.com/mattiasthalen/qlik-parser/blob/main/internal/extractor/walker.go): `internal/extractor/walker.go`
- [QVW script parser](https://github.com/mattiasthalen/qlik-parser/blob/main/internal/extractor/qvw.go): `internal/extractor/qvw.go`
- [QVF artifact parser](https://github.com/mattiasthalen/qlik-parser/blob/main/internal/extractor/qvf.go): `internal/extractor/qvf.go`

### Export and reporting

- [Output path resolver](https://github.com/mattiasthalen/qlik-parser/blob/main/internal/extractor/exporter.go): `internal/extractor/exporter.go`
- [Artifact writer](https://github.com/mattiasthalen/qlik-parser/blob/main/internal/extractor/exporter.go): `internal/extractor/exporter.go`
- [Result printer](https://github.com/mattiasthalen/qlik-parser/blob/main/internal/ui/output.go): `internal/ui/output.go`

### Other components

- **CLI user**
- **Source files**
- **Output files**

## Connections

- CLI user → Program entry: runs
- Program entry → Root command: executes
- Root command → Extract command: dispatches
- Root command → Version command: dispatches
- Extract command → File walker: scans
- File walker → Source files: finds files
- Extract command → QVW script parser: extracts script
- Extract command → QVF artifact parser: parses artifacts
- QVW script parser → Source files: reads
- QVF artifact parser → Source files: reads
- Extract command → Output path resolver: resolves path
- Extract command → Artifact writer: writes artifacts
- Artifact writer → Output files: writes
- Extract command → Result printer: reports results
