# xiaoling6028/packageinstaller architecture

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

- Interactive diagram: https://gitdiagram.com/xiaoling6028/packageinstaller
- Repository: https://github.com/xiaoling6028/packageinstaller

## Overview

CachyOS Package Installer is a desktop app store for repository packages, AUR builds, Flatpak apps, and AppImages. The main workflow loads repository data enriched with AppStream metadata, presents package results through the backend, then plans and runs confirmed changes through the privileged helper. Separate branches handle AUR review and builds, Flatpak discovery and updates, AppImage imports and GitHub releases, and static PKGBUILD checks. The excerpts do not include the UI or transaction implementation; those links rely on README documentation, and unsampled behavior is not inferred beyond it.

Main entry points: [`src/backend.hpp`](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/backend.hpp) (Application backend), [`src/aurclient.cpp`](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/aurclient.cpp) (AUR client), [`src/appimageclient.cpp`](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/appimageclient.cpp) (AppImage manager), [`src/main.cpp`](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/main.cpp) (Application entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and catalog"]
  node_entry["Application entry<br/>[main.cpp]"]
  node_backend["Application backend<br/>[backend.hpp]"]
  node_catalog["Package catalog<br/>[catalog.cpp]"]
  node_alpm[("Repository access<br/>[alpmdb.cpp]")]
  node_model["Package list model<br/>[packagemodel.cpp]"]
  node_icons["Package icons<br/>[iconprovider.cpp]"]
end

subgraph group_packages["Package operations"]
  node_transaction["Transaction workflow<br/>[transaction.cpp]"]
  node_helper["Privilege helper<br/>[main.cpp]"]
  node_pacman["Pacman"]
end

subgraph group_integrations["App integrations"]
  node_aur["AUR client<br/>[aurclient.cpp]"]
  node_git["Git checkout and diff<br/>[gitoutput.cpp]"]
  node_flatpak["Flatpak client<br/>[flatpakclient.cpp]"]
  node_flatpakcmd["Flatpak command"]
  node_appimage["AppImage manager<br/>[appimageclient.cpp]"]
  node_desktop["Menu entries"]
  node_import["AppImage import<br/>[appimageimport.cpp]"]
  node_github["GitHub releases"]
end

subgraph group_support["Review and utilities"]
  node_scan["PKGBUILD review<br/>[pkgscan.cpp]"]
  node_scancli["Scan command<br/>[main.cpp]"]
  node_process["Process utilities<br/>[process.hpp]"]
  node_libpi["Shared utilities<br/>[process.hpp]"]
end

node_user(("User"))

node_user -->|"starts"| node_entry
node_entry -->|"creates"| node_backend
node_entry -->|"registers"| node_icons
node_backend -->|"uses"| node_catalog
node_catalog -->|"loads databases"| node_alpm
node_catalog -.->|"supplies packages"| node_model
node_backend -->|"provides"| node_model
node_model -.->|"requests icons"| node_icons
node_backend -->|"coordinates"| node_transaction
node_transaction -->|"runs privileged changes"| node_helper
node_helper -->|"invokes"| node_pacman
node_backend -->|"provides"| node_aur
node_aur -->|"reviews checkout"| node_git
node_aur -->|"checks recipes"| node_scan
node_aur -->|"runs commands"| node_process
node_scancli -->|"checks package"| node_scan
node_backend -->|"provides"| node_flatpak
node_flatpak -->|"runs commands"| node_flatpakcmd
node_flatpak -->|"runs commands"| node_process
node_backend -->|"provides"| node_appimage
node_appimage -->|"rewrites entries"| node_desktop
node_appimage -->|"handles imports"| node_import
node_appimage -->|"checks releases"| node_github
node_process -.->|"uses utilities"| node_libpi

click node_entry "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/main.cpp"
click node_backend "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/backend.hpp"
click node_catalog "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/catalog.cpp"
click node_alpm "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/alpmdb.cpp"
click node_model "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/packagemodel.cpp"
click node_icons "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/iconprovider.cpp"
click node_transaction "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/transaction.cpp"
click node_helper "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/helper/main.cpp"
click node_aur "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/aurclient.cpp"
click node_git "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/gitoutput.cpp"
click node_scan "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/pkgscan.cpp"
click node_scancli "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/scan/main.cpp"
click node_flatpak "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/flatpakclient.cpp"
click node_appimage "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/appimageclient.cpp"
click node_desktop "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/appimagedesktop.cpp"
click node_import "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/appimageimport.cpp"
click node_process "https://github.com/xiaoling6028/packageinstaller/blob/develop/src/process.hpp"
click node_libpi "https://github.com/xiaoling6028/packageinstaller/blob/develop/libpi/include/pi/process.hpp"

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_entry,node_backend,node_catalog,node_alpm,node_model,node_icons,node_user toneBlue
class node_transaction,node_helper,node_pacman toneAmber
class node_aur,node_git,node_flatpak,node_flatpakcmd,node_appimage,node_desktop,node_import,node_github toneMint
class node_scan,node_scancli,node_process,node_libpi toneRose
```

## Components

### App and catalog

- [Application entry](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/main.cpp): `src/main.cpp`
- [Application backend](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/backend.hpp): `src/backend.hpp`
- [Package catalog](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/catalog.cpp): `src/catalog.cpp`
- [Repository access](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/alpmdb.cpp): `src/alpmdb.cpp`
- [Package list model](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/packagemodel.cpp): `src/packagemodel.cpp`
- [Package icons](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/iconprovider.cpp): `src/iconprovider.cpp`

### Package operations

- [Transaction workflow](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/transaction.cpp): `src/transaction.cpp`
- [Privilege helper](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/helper/main.cpp): `src/helper/main.cpp`
- **Pacman**

### App integrations

- [AUR client](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/aurclient.cpp): `src/aurclient.cpp`
- [Git checkout and diff](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/gitoutput.cpp): `src/gitoutput.cpp`
- [Flatpak client](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/flatpakclient.cpp): `src/flatpakclient.cpp`
- **Flatpak command**
- [AppImage manager](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/appimageclient.cpp): `src/appimageclient.cpp`
- [Menu entries](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/appimagedesktop.cpp): `src/appimagedesktop.cpp`
- [AppImage import](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/appimageimport.cpp): `src/appimageimport.cpp`
- **GitHub releases**

### Review and utilities

- [PKGBUILD review](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/pkgscan.cpp): `src/pkgscan.cpp`
- [Scan command](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/scan/main.cpp): `src/scan/main.cpp`
- [Process utilities](https://github.com/xiaoling6028/packageinstaller/blob/develop/src/process.hpp): `src/process.hpp`
- [Shared utilities](https://github.com/xiaoling6028/packageinstaller/blob/develop/libpi/include/pi/process.hpp): `libpi/include/pi/process.hpp`

### Other components

- **User**

## Connections

- User → Application entry: starts (evidence: `src/main.cpp`)
- Application entry → Application backend: creates (evidence: `src/main.cpp`)
- Application entry → Package icons: registers (evidence: `src/main.cpp`)
- Application backend → Package catalog: uses (evidence: `src/backend.hpp`)
- Package catalog → Repository access: loads databases (evidence: `README.md`)
- Package catalog → Package list model: supplies packages
- Application backend → Package list model: provides (evidence: `src/backend.hpp`)
- Package list model → Package icons: requests icons
- Application backend → Transaction workflow: coordinates (evidence: `src/backend.hpp`)
- Transaction workflow → Privilege helper: runs privileged changes (evidence: `README.md`)
- Privilege helper → Pacman: invokes (evidence: `src/helper/main.cpp`)
- Application backend → AUR client: provides (evidence: `src/backend.hpp`)
- AUR client → Git checkout and diff: reviews checkout (evidence: `src/aurclient.cpp`)
- AUR client → PKGBUILD review: checks recipes (evidence: `src/aurclient.cpp`)
- AUR client → Process utilities: runs commands (evidence: `src/aurclient.cpp`)
- Scan command → PKGBUILD review: checks package (evidence: `src/scan/main.cpp`)
- Application backend → Flatpak client: provides (evidence: `src/backend.hpp`)
- Flatpak client → Flatpak command: runs commands (evidence: `README.md`)
- Flatpak client → Process utilities: runs commands (evidence: `src/flatpakclient.cpp`)
- Application backend → AppImage manager: provides (evidence: `src/backend.hpp`)
- AppImage manager → Menu entries: rewrites entries (evidence: `src/appimageclient.cpp`)
- AppImage manager → AppImage import: handles imports (evidence: `src/appimageclient.cpp`)
- AppImage manager → GitHub releases: checks releases (evidence: `README.md`)
- Process utilities → Shared utilities: uses utilities (evidence: `src/process.hpp`)
