# as-offical/harammute-linux architecture

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

- Interactive diagram: https://gitdiagram.com/as-offical/harammute-linux
- Repository: https://github.com/as-offical/harammute-linux

## Overview

HaramMute Linux is a local audio-separation server for the HaramMute browser extension, with a desktop tray launcher. The main workflow accepts a media URL, creates and persists a job, downloads and converts audio, separates vocals (including chunked processing for longer media), and exposes status and result files through the API. The graph also preserves subscription handling and opt-in desktop telemetry as distinct capabilities. Source excerpts show the pipeline and processing stages; some API routes and telemetry wiring are only partially sampled, so uncertain links are omitted.

Main entry points: [`app/main.py`](https://github.com/as-offical/harammute-linux/blob/main/app/main.py) (Local API server), [`app/local_processing.py`](https://github.com/as-offical/harammute-linux/blob/main/app/local_processing.py) (Local processing), [`app/pipeline.py`](https://github.com/as-offical/harammute-linux/blob/main/app/pipeline.py) (Job pipeline), [`app/desktop_telemetry.py`](https://github.com/as-offical/harammute-linux/blob/main/app/desktop_telemetry.py) (Desktop telemetry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop runtime"]
  node_tray["Tray launcher<br/>[tray_launcher.py]"]
  node_telemetry["Desktop telemetry"]
end

subgraph group_api["API and access"]
  node_server["Local API server<br/>[main.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_subscriptions["Subscriptions<br/>[main.py]"]
  node_settings["Runtime settings<br/>[config.py]"]
end

subgraph group_jobs["Job workflow"]
  node_jobstore[("Persistent job store<br/>[jobs.py]")]
  node_pipeline["Job pipeline<br/>[pipeline.py]"]
  node_limits["Job limits<br/>[limits.py]"]
  node_results["Job result files<br/>[pipeline.py]"]
end

subgraph group_processing["Audio processing"]
  node_localproc["Local processing"]
  node_model_cache[("Model cache")]
end

node_extension(("Browser extension"))
node_polar["Polar service"]
node_media_source["Media source"]
node_audio_tools["FFmpeg tools"]
node_separator["Audio separator"]
node_telemetry_service["Telemetry endpoint"]

node_extension -->|"submits jobs"| node_server
node_tray -->|"starts and probes"| node_server
node_server -->|"validates requests"| node_schemas
node_server -->|"reads configuration"| node_settings
node_server -->|"checks access"| node_subscriptions
node_subscriptions -->|"checks and creates checkout"| node_polar
node_server -->|"creates and queries jobs"| node_jobstore
node_server -.->|"enforces limits"| node_limits
node_server -.->|"dispatches processing"| node_pipeline
node_pipeline -->|"updates job state"| node_jobstore
node_pipeline -->|"converts and separates"| node_localproc
node_localproc -.->|"downloads media"| node_media_source
node_localproc -.->|"converts and probes"| node_audio_tools
node_localproc -.->|"separates stems"| node_separator
node_localproc -.->|"loads model"| node_model_cache
node_pipeline -->|"writes encoded output"| node_results
node_server -.->|"serves job results"| node_results
node_server -->|"imports telemetry module"| node_telemetry
node_telemetry -.->|"sends event batches"| node_telemetry_service

click node_tray "https://github.com/as-offical/harammute-linux/blob/main/tray_launcher.py"
click node_server "https://github.com/as-offical/harammute-linux/blob/main/app/main.py"
click node_schemas "https://github.com/as-offical/harammute-linux/blob/main/app/schemas.py"
click node_subscriptions "https://github.com/as-offical/harammute-linux/blob/main/app/main.py"
click node_settings "https://github.com/as-offical/harammute-linux/blob/main/app/config.py"
click node_jobstore "https://github.com/as-offical/harammute-linux/blob/main/app/jobs.py"
click node_pipeline "https://github.com/as-offical/harammute-linux/blob/main/app/pipeline.py"
click node_limits "https://github.com/as-offical/harammute-linux/blob/main/app/limits.py"
click node_localproc "https://github.com/as-offical/harammute-linux/blob/main/app/local_processing.py"
click node_model_cache "https://github.com/as-offical/harammute-linux/tree/main/assets/model_cache/audio-separator"
click node_results "https://github.com/as-offical/harammute-linux/blob/main/app/pipeline.py"
click node_telemetry "https://github.com/as-offical/harammute-linux/blob/main/app/desktop_telemetry.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_tray,node_telemetry,node_extension toneBlue
class node_server,node_schemas,node_subscriptions,node_settings toneAmber
class node_jobstore,node_pipeline,node_limits,node_results toneMint
class node_localproc,node_model_cache toneRose
class node_polar,node_media_source,node_audio_tools,node_separator,node_telemetry_service toneIndigo
```

## Components

### Desktop runtime

- [Tray launcher](https://github.com/as-offical/harammute-linux/blob/main/tray_launcher.py): `tray_launcher.py`
- [Desktop telemetry](https://github.com/as-offical/harammute-linux/blob/main/app/desktop_telemetry.py): `app/desktop_telemetry.py`

### API and access

- [Local API server](https://github.com/as-offical/harammute-linux/blob/main/app/main.py): `app/main.py`
- [API schemas](https://github.com/as-offical/harammute-linux/blob/main/app/schemas.py): `app/schemas.py`
- [Subscriptions](https://github.com/as-offical/harammute-linux/blob/main/app/main.py): `app/main.py`
- [Runtime settings](https://github.com/as-offical/harammute-linux/blob/main/app/config.py): `app/config.py`

### Job workflow

- [Persistent job store](https://github.com/as-offical/harammute-linux/blob/main/app/jobs.py): `app/jobs.py`
- [Job pipeline](https://github.com/as-offical/harammute-linux/blob/main/app/pipeline.py): `app/pipeline.py`
- [Job limits](https://github.com/as-offical/harammute-linux/blob/main/app/limits.py): `app/limits.py`
- [Job result files](https://github.com/as-offical/harammute-linux/blob/main/app/pipeline.py): `app/pipeline.py`

### Audio processing

- [Local processing](https://github.com/as-offical/harammute-linux/blob/main/app/local_processing.py): `app/local_processing.py`
- [Model cache](https://github.com/as-offical/harammute-linux/tree/main/assets/model_cache/audio-separator): `assets/model_cache/audio-separator`

### Other components

- **Browser extension**
- **Polar service**
- **Media source**
- **FFmpeg tools**
- **Audio separator**
- **Telemetry endpoint**

## Connections

- Browser extension → Local API server: submits jobs (evidence: `README.md`)
- Tray launcher → Local API server: starts and probes (evidence: `tray_launcher.py`)
- Local API server → API schemas: validates requests (evidence: `app/main.py`)
- Local API server → Runtime settings: reads configuration (evidence: `app/main.py`)
- Local API server → Subscriptions: checks access (evidence: `app/main.py`)
- Subscriptions → Polar service: checks and creates checkout (evidence: `app/main.py`)
- Local API server → Persistent job store: creates and queries jobs (evidence: `app/main.py`)
- Local API server → Job limits: enforces limits (evidence: `app/main.py`)
- Local API server → Job pipeline: dispatches processing (evidence: `app/main.py`)
- Job pipeline → Persistent job store: updates job state (evidence: `app/pipeline.py`)
- Job pipeline → Local processing: converts and separates (evidence: `app/pipeline.py`)
- Local processing → Media source: downloads media
- Local processing → FFmpeg tools: converts and probes
- Local processing → Audio separator: separates stems
- Local processing → Model cache: loads model
- Job pipeline → Job result files: writes encoded output (evidence: `app/pipeline.py`)
- Local API server → Job result files: serves job results (evidence: `app/main.py`)
- Local API server → Desktop telemetry: imports telemetry module (evidence: `app/main.py`)
- Desktop telemetry → Telemetry endpoint: sends event batches
