# fahry-a/farhan-morphe-auto-build architecture

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

- Interactive diagram: https://gitdiagram.com/fahry-a/farhan-morphe-auto-build
- Repository: https://github.com/fahry-a/farhan-morphe-auto-build

## Overview

Morphe Auto Build is configuration-driven automation for selecting patch-compatible Android app versions, obtaining and validating the matching package, patching/signing it, and publishing cumulative monthly releases. Its main runtime path is documented in the README; the live mirror audit and operator-run browser downloaders are separate capabilities. Some orchestration and signing details are documented but not represented in sampled source, so those links reflect the README rather than inspected implementation.

Main entry points: [`.github/workflows/build.yml`](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/.github/workflows/build.yml) (Build workflow), [`tools/mirror_probe.py`](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/mirror_probe.py) (Mirror probe), [`tools/mirror_download.py`](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/mirror_download.py) (Mirror downloader), [`tools/common.py`](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/common.py) (Package validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Build workflow"]
  node_configs["App configurations"]
  node_workflow["Build workflow<br/>[build.yml]"]
  node_resolver["Version resolver<br/>[resolve_version.py]"]
end

subgraph group_sources["Package sources"]
  node_mirrorfetch["Mirror downloader<br/>[mirror_download.py]"]
  node_githubfetch["GitHub source downloader<br/>[github_source.py]"]
  node_directfetch["Direct URL downloader<br/>[direct.py]"]
  node_validation["Package validation<br/>[common.py]"]
  node_browsermirror["APKMirror browser transport"]
  node_uptodown["Uptodown browser downloader"]
end

subgraph group_patch["Patch and release"]
  node_patcher["Morphe patching<br/>[patch.py]"]
  node_signing["Manifest-driven signing<br/>[build.yml]"]
  node_release["Monthly release publisher<br/>[monthly_release.py]"]
end

subgraph group_audit["Mirror audit"]
  node_probe["Mirror probe<br/>[mirror_probe.py]"]
  node_auditreport["Audit report<br/>[mirror_probe.py]"]
end

node_operator(("Operator"))
node_actions(("GitHub Actions"))
node_patchrepo["Morphe patch repositories"]
node_apkproviders["APK mirror providers"]
node_upstreamgithub["Upstream GitHub releases"]
node_githubrelease[("GitHub Releases")]

node_operator -->|"selects build"| node_workflow
node_actions -->|"runs"| node_workflow
node_workflow -->|"reads config"| node_configs
node_workflow -->|"resolves version"| node_resolver
node_resolver -->|"fetches patch data"| node_patchrepo
node_workflow -->|"downloads package"| node_mirrorfetch
node_workflow -->|"downloads package"| node_githubfetch
node_workflow -->|"downloads package"| node_directfetch
node_mirrorfetch -->|"queries and downloads"| node_apkproviders
node_githubfetch -->|"fetches asset"| node_upstreamgithub
node_mirrorfetch -->|"validates package"| node_validation
node_githubfetch -->|"validates package"| node_validation
node_directfetch -->|"validates package"| node_validation
node_workflow -->|"patches package"| node_patcher
node_patcher -->|"uses patch bundle"| node_patchrepo
node_workflow -->|"signs outputs"| node_signing
node_workflow -->|"publishes builds"| node_release
node_release -->|"uploads assets"| node_githubrelease
node_operator -->|"runs audit"| node_probe
node_probe -->|"discovers targets"| node_configs
node_probe -->|"resolves supported version"| node_resolver
node_probe -->|"downloads each mirror"| node_mirrorfetch
node_probe -->|"writes results"| node_auditreport
node_operator -.->|"runs local download"| node_browsermirror
node_browsermirror -.->|"uses browser transport"| node_apkproviders
node_operator -.->|"runs manual download"| node_uptodown
node_uptodown -.->|"validates artifact"| node_validation

click node_configs "https://github.com/fahry-a/farhan-morphe-auto-build/tree/main/apps"
click node_workflow "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/.github/workflows/build.yml"
click node_resolver "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/resolve_version.py"
click node_mirrorfetch "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/mirror_download.py"
click node_githubfetch "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/github_source.py"
click node_directfetch "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/direct.py"
click node_validation "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/common.py"
click node_patcher "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/patch.py"
click node_signing "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/.github/workflows/build.yml"
click node_release "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/monthly_release.py"
click node_probe "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/mirror_probe.py"
click node_browsermirror "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/apkmirror_browser.py"
click node_uptodown "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/uptodown_browser.py"
click node_auditreport "https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/mirror_probe.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_configs,node_workflow,node_resolver toneBlue
class node_mirrorfetch,node_githubfetch,node_directfetch,node_validation,node_browsermirror,node_uptodown,node_githubrelease toneAmber
class node_patcher,node_signing,node_release toneMint
class node_probe,node_auditreport toneRose
class node_operator,node_actions,node_patchrepo,node_apkproviders,node_upstreamgithub toneIndigo
```

## Components

### Build workflow

- [App configurations](https://github.com/fahry-a/farhan-morphe-auto-build/tree/main/apps): `apps`
- [Build workflow](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/.github/workflows/build.yml): `.github/workflows/build.yml`
- [Version resolver](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/resolve_version.py): `tools/resolve_version.py`

### Package sources

- [Mirror downloader](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/mirror_download.py): `tools/mirror_download.py`
- [GitHub source downloader](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/github_source.py): `tools/github_source.py`
- [Direct URL downloader](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/direct.py): `tools/direct.py`
- [Package validation](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/common.py): `tools/common.py`
- [APKMirror browser transport](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/apkmirror_browser.py): `tools/apkmirror_browser.py`
- [Uptodown browser downloader](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/uptodown_browser.py): `tools/uptodown_browser.py`

### Patch and release

- [Morphe patching](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/patch.py): `tools/patch.py`
- [Manifest-driven signing](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/.github/workflows/build.yml): `.github/workflows/build.yml`
- [Monthly release publisher](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/monthly_release.py): `tools/monthly_release.py`

### Mirror audit

- [Mirror probe](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/mirror_probe.py): `tools/mirror_probe.py`
- [Audit report](https://github.com/fahry-a/farhan-morphe-auto-build/blob/main/tools/mirror_probe.py): `tools/mirror_probe.py`

### Other components

- **Operator**
- **GitHub Actions**
- **Morphe patch repositories**
- **APK mirror providers**
- **Upstream GitHub releases**
- **GitHub Releases**

## Connections

- Operator → Build workflow: selects build
- GitHub Actions → Build workflow: runs
- Build workflow → App configurations: reads config
- Build workflow → Version resolver: resolves version
- Version resolver → Morphe patch repositories: fetches patch data
- Build workflow → Mirror downloader: downloads package
- Build workflow → GitHub source downloader: downloads package
- Build workflow → Direct URL downloader: downloads package
- Mirror downloader → APK mirror providers: queries and downloads
- GitHub source downloader → Upstream GitHub releases: fetches asset
- Mirror downloader → Package validation: validates package
- GitHub source downloader → Package validation: validates package
- Direct URL downloader → Package validation: validates package
- Build workflow → Morphe patching: patches package
- Morphe patching → Morphe patch repositories: uses patch bundle
- Build workflow → Manifest-driven signing: signs outputs
- Build workflow → Monthly release publisher: publishes builds
- Monthly release publisher → GitHub Releases: uploads assets
- Operator → Mirror probe: runs audit
- Mirror probe → App configurations: discovers targets
- Mirror probe → Version resolver: resolves supported version
- Mirror probe → Mirror downloader: downloads each mirror
- Mirror probe → Audit report: writes results
- Operator → APKMirror browser transport: runs local download
- APKMirror browser transport → APK mirror providers: uses browser transport
- Operator → Uptodown browser downloader: runs manual download
- Uptodown browser downloader → Package validation: validates artifact
