# kauanmezavila/harbor architecture

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

- Interactive diagram: https://gitdiagram.com/kauanmezavila/harbor
- Repository: https://github.com/kauanmezavila/harbor

## Overview

Harbor is a CLI for packaging projects into portable .harb containers, checking compatibility and integrity, and installing compatible variants described by HarborSpecs. The main workflow is project scanning and packaging; the install workflow reads a HarborMap, selects a variant, and installs it. The graph also includes extraction, encryption, verification, and install-script execution. Source excerpts and the README support the shown relationships; unsampled implementation details are omitted where their connections are not evidenced.

Main entry points: [`main.py`](https://github.com/kauanmezavila/harbor/blob/master/main.py) (Harbor CLI), [`ContainerStuff/wrapper.py`](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/wrapper.py) (Container builder), [`Dumpster/main-cli.py`](https://github.com/kauanmezavila/harbor/blob/master/Dumpster/main-cli.py) (Interactive CLI), [`ContainerStuff/install.py`](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/install.py) (Variant installer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command-line entrypoints"]
  node_cli["Harbor CLI<br/>[main.py]"]
  node_interactive["Interactive CLI<br/>[main-cli.py]"]
end

subgraph group_packaging["Container packaging"]
  node_scaffold["Project scaffold<br/>[init.py]"]
  node_wrapper["Container builder<br/>[wrapper.py]"]
  node_metadata["Metadata header<br/>[header.py]"]
  node_projectscan["Project scanner<br/>[dirtrain.py]"]
  node_stackdetect["Stack detection<br/>[stack.py]"]
  node_filecopy["Filtered file copy<br/>[containerflux.py]"]
  node_container["Harbor container"]
  node_archive["Archive extraction<br/>[wrapper.py]"]
end

subgraph group_integrity["Integrity and encryption"]
  node_hashing["Hash generation<br/>[hashflux.py]"]
  node_verification["Integrity verifier<br/>[verifyflux.py]"]
  node_crypto["Password encryption<br/>[crypto.py]"]
  node_restore["Encrypted restore<br/>[access.py]"]
end

subgraph group_distribution["Compatibility and installation"]
  node_compatibility["Container compatibility<br/>[compatibility.py]"]
  node_installer["Variant installer<br/>[install.py]"]
  node_harborspecs["HarborSpecs map<br/>[HarborMap.yaml]"]
end

subgraph group_execution["Project execution"]
  node_installrunner["Install script runner<br/>[runinstall.py]"]
end

node_user(("Developer or user"))
node_github["GitHub repository"]

node_user -->|"runs commands"| node_cli
node_user -->|"uses commands"| node_interactive
node_cli -->|"creates scaffold"| node_scaffold
node_cli -->|"builds container"| node_wrapper
node_cli -->|"inflates archive"| node_archive
node_cli -->|"restores export"| node_restore
node_cli -->|"checks compatibility"| node_compatibility
node_cli -->|"installs project"| node_installer
node_cli -->|"runs installer"| node_installrunner
node_cli -->|"updates hashes"| node_hashing
node_cli -->|"verifies hashes"| node_verification
node_interactive -->|"builds container"| node_wrapper
node_interactive -->|"restores export"| node_restore
node_interactive -->|"checks compatibility"| node_compatibility
node_interactive -->|"updates hashes"| node_hashing
node_interactive -->|"verifies hashes"| node_verification
node_wrapper -->|"builds metadata"| node_metadata
node_wrapper -->|"copies project"| node_filecopy
node_wrapper -->|"creates hashes"| node_hashing
node_wrapper -->|"encrypts export"| node_crypto
node_metadata -->|"scans project"| node_projectscan
node_metadata -->|"validates requirements"| node_compatibility
node_projectscan -->|"detects stacks"| node_stackdetect
node_wrapper -->|"produces container"| node_container
node_container -->|"inflates from archive"| node_archive
node_verification -->|"calculates hashes"| node_hashing
node_restore -->|"decrypts export"| node_crypto
node_installer -->|"reads variant map"| node_harborspecs
node_installer -->|"selects compatible"| node_compatibility
node_installer -->|"downloads project"| node_github
node_installer -.->|"runs selected setup"| node_installrunner
node_user -.->|"downloads result"| node_container
node_installrunner -->|"executes install file"| node_container

click node_cli "https://github.com/kauanmezavila/harbor/blob/master/main.py"
click node_interactive "https://github.com/kauanmezavila/harbor/blob/master/Dumpster/main-cli.py"
click node_scaffold "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/init.py"
click node_wrapper "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/wrapper.py"
click node_metadata "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/header.py"
click node_projectscan "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/dirtrain.py"
click node_stackdetect "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/stack.py"
click node_filecopy "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/WrapperStuff/containerflux.py"
click node_archive "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/wrapper.py"
click node_hashing "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/WrapperStuff/hashflux.py"
click node_verification "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/WrapperStuff/verifyflux.py"
click node_crypto "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/Obsidian/BaseSystem/crypto.py"
click node_restore "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/access.py"
click node_compatibility "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/compatibility.py"
click node_installer "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/install.py"
click node_harborspecs "https://github.com/kauanmezavila/harbor/blob/master/HarborSpecs/HarborMap.yaml"
click node_installrunner "https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/runinstall.py"

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_cli,node_interactive,node_user toneBlue
class node_scaffold,node_wrapper,node_metadata,node_projectscan,node_stackdetect,node_filecopy,node_container,node_archive toneAmber
class node_hashing,node_verification,node_crypto,node_restore toneMint
class node_compatibility,node_installer,node_harborspecs toneRose
class node_installrunner,node_github toneIndigo
```

## Components

### Command-line entrypoints

- [Harbor CLI](https://github.com/kauanmezavila/harbor/blob/master/main.py): `main.py`
- [Interactive CLI](https://github.com/kauanmezavila/harbor/blob/master/Dumpster/main-cli.py): `Dumpster/main-cli.py`

### Container packaging

- [Project scaffold](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/init.py): `ContainerStuff/init.py`
- [Container builder](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/wrapper.py): `ContainerStuff/wrapper.py`
- [Metadata header](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/header.py): `ContainerStuff/header.py`
- [Project scanner](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/dirtrain.py): `ContainerStuff/dirtrain.py`
- [Stack detection](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/stack.py): `ContainerStuff/stack.py`
- [Filtered file copy](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/WrapperStuff/containerflux.py): `ContainerStuff/WrapperStuff/containerflux.py`
- **Harbor container**
- [Archive extraction](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/wrapper.py): `ContainerStuff/wrapper.py`

### Integrity and encryption

- [Hash generation](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/WrapperStuff/hashflux.py): `ContainerStuff/WrapperStuff/hashflux.py`
- [Integrity verifier](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/WrapperStuff/verifyflux.py): `ContainerStuff/WrapperStuff/verifyflux.py`
- [Password encryption](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/Obsidian/BaseSystem/crypto.py): `ContainerStuff/Obsidian/BaseSystem/crypto.py`
- [Encrypted restore](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/access.py): `ContainerStuff/access.py`

### Compatibility and installation

- [Container compatibility](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/compatibility.py): `ContainerStuff/compatibility.py`
- [Variant installer](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/install.py): `ContainerStuff/install.py`
- [HarborSpecs map](https://github.com/kauanmezavila/harbor/blob/master/HarborSpecs/HarborMap.yaml): `HarborSpecs/HarborMap.yaml`

### Project execution

- [Install script runner](https://github.com/kauanmezavila/harbor/blob/master/ContainerStuff/runinstall.py): `ContainerStuff/runinstall.py`

### Other components

- **Developer or user**
- **GitHub repository**

## Connections

- Developer or user → Harbor CLI: runs commands (evidence: `README.md`)
- Developer or user → Interactive CLI: uses commands (evidence: `Dumpster/main-cli.py`)
- Harbor CLI → Project scaffold: creates scaffold (evidence: `main.py`)
- Harbor CLI → Container builder: builds container (evidence: `main.py`)
- Harbor CLI → Archive extraction: inflates archive (evidence: `main.py`)
- Harbor CLI → Encrypted restore: restores export (evidence: `main.py`)
- Harbor CLI → Container compatibility: checks compatibility (evidence: `main.py`)
- Harbor CLI → Variant installer: installs project (evidence: `main.py`)
- Harbor CLI → Install script runner: runs installer (evidence: `main.py`)
- Harbor CLI → Hash generation: updates hashes (evidence: `main.py`)
- Harbor CLI → Integrity verifier: verifies hashes (evidence: `main.py`)
- Interactive CLI → Container builder: builds container (evidence: `Dumpster/main-cli.py`)
- Interactive CLI → Encrypted restore: restores export (evidence: `Dumpster/main-cli.py`)
- Interactive CLI → Container compatibility: checks compatibility (evidence: `Dumpster/main-cli.py`)
- Interactive CLI → Hash generation: updates hashes (evidence: `Dumpster/main-cli.py`)
- Interactive CLI → Integrity verifier: verifies hashes (evidence: `Dumpster/main-cli.py`)
- Container builder → Metadata header: builds metadata (evidence: `ContainerStuff/wrapper.py`)
- Container builder → Filtered file copy: copies project (evidence: `ContainerStuff/wrapper.py`)
- Container builder → Hash generation: creates hashes (evidence: `ContainerStuff/wrapper.py`)
- Container builder → Password encryption: encrypts export (evidence: `ContainerStuff/wrapper.py`)
- Metadata header → Project scanner: scans project (evidence: `ContainerStuff/header.py`)
- Metadata header → Container compatibility: validates requirements (evidence: `ContainerStuff/header.py`)
- Project scanner → Stack detection: detects stacks (evidence: `ContainerStuff/dirtrain.py`)
- Container builder → Harbor container: produces container (evidence: `README.md`)
- Harbor container → Archive extraction: inflates from archive (evidence: `README.md`)
- Integrity verifier → Hash generation: calculates hashes (evidence: `ContainerStuff/WrapperStuff/verifyflux.py`)
- Encrypted restore → Password encryption: decrypts export (evidence: `ContainerStuff/access.py`)
- Variant installer → HarborSpecs map: reads variant map (evidence: `README.md`)
- Variant installer → Container compatibility: selects compatible (evidence: `README.md`)
- Variant installer → GitHub repository: downloads project (evidence: `README.md`)
- Variant installer → Install script runner: runs selected setup (evidence: `ContainerStuff/install.py`)
- Developer or user → Harbor container: downloads result
- Install script runner → Harbor container: executes install file (evidence: `ContainerStuff/runinstall.py`)
