# mlohajner/sftp-tree-first architecture

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

- Interactive diagram: https://gitdiagram.com/mlohajner/sftp-tree-first
- Repository: https://github.com/mlohajner/sftp-tree-first

## Overview

This repository packages an OpenSSH server patch that streams non-regular directory entries before regular files, so clients see directory trees sooner on slow links. The documented flow is patching the server, installing the patched binary, then streaming directory entries to an unchanged SFTP client. The README describes the patch and installer behavior; source excerpts were unavailable, so relationships are limited to those documented there.

Main entry points: [`patch/1001-sftp-server-directory-first.patch`](https://github.com/mlohajner/sftp-tree-first/blob/main/patch/1001-sftp-server-directory-first.patch) (Directory-first patch), [`install/sftp-server-swap.sh`](https://github.com/mlohajner/sftp-tree-first/blob/main/install/sftp-server-swap.sh) (Swap installer), [`binary/sftp-server`](https://github.com/mlohajner/sftp-tree-first/blob/main/binary/sftp-server) (SFTP server binary)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_patch["Directory-first patch"]
node_server["Patched SFTP server"]
node_binary["SFTP server binary"]
node_installer["Swap installer"]
node_client(("SFTP client"))

node_patch -->|"modifies"| node_server
node_installer -->|"installs"| node_binary
node_server -->|"streams entries"| node_client

click node_patch "https://github.com/mlohajner/sftp-tree-first/blob/main/patch/1001-sftp-server-directory-first.patch"
click node_binary "https://github.com/mlohajner/sftp-tree-first/blob/main/binary/sftp-server"
click node_installer "https://github.com/mlohajner/sftp-tree-first/blob/main/install/sftp-server-swap.sh"

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_patch,node_installer toneTeal
class node_server,node_binary toneMint
class node_client toneBlue
```

## Components

### Other components

- [Directory-first patch](https://github.com/mlohajner/sftp-tree-first/blob/main/patch/1001-sftp-server-directory-first.patch): `patch/1001-sftp-server-directory-first.patch`
- **Patched SFTP server**
- [SFTP server binary](https://github.com/mlohajner/sftp-tree-first/blob/main/binary/sftp-server): `binary/sftp-server`
- [Swap installer](https://github.com/mlohajner/sftp-tree-first/blob/main/install/sftp-server-swap.sh): `install/sftp-server-swap.sh`
- **SFTP client**

## Connections

- Directory-first patch → Patched SFTP server: modifies (evidence: `README.md`)
- Swap installer → SFTP server binary: installs (evidence: `README.md`)
- Patched SFTP server → SFTP client: streams entries (evidence: `README.md`)
