# wasi-master/13ft architecture

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

- Interactive diagram: https://gitdiagram.com/wasi-master/13ft
- Repository: https://github.com/wasi-master/13ft

## Overview

#### Purpose and Entry Points
13 Feet Ladder is a self-hosted Python service that retrieves article pages through crawler-like and fallback fetch strategies, then presents content without typical paywall/ad barriers. Its primary application is a Flask app in `app/portable.py`; it can run directly, under Gunicorn, or in containers. A separate serverless entry point exists at `api/index.py` for Vercel-style deployment.

#### HTTP Application Layer
`app/portable.py` owns the user-facing HTTP interface: a landing/input flow and URL-addressable article retrieval (`/<target-url>`). It coordinates status/loading display, URL handling, content retrieval attempts, and rendering responses. `app/gunicorn.conf.py` supplies production-process configuration when launched with Gunicorn.

#### Retrieval and Bypass Pipeline
The central control flow is:
1. Browser submits or embeds a target article URL.
2. The app requests it while impersonating Googlebot, seeking indexable full-page content.
3. If the primary approach fails, it tries multiple source/fallback methods.
4. Retrieved content or a failure/status result is returned to the browser.

The upstream target publisher is the principal external dependency and trust boundary; its paywall, bot detection, availability, and markup determine success. Core implementation is concentrated in `app/portable.py`.

#### Presentation and Localization
The service serves a lightweight browser interface rather than a separate frontend application. Runtime locale selection is controlled through `LOCALE`; translation catalogs are JSON assets loaded by the application. Key paths: `app/portable.py`, `app/locales/en.json`, and `app/locales/de.json` (with additional language catalogs under `app/locales/`).

#### Deployment Shapes
The application supports local Python execution and production WSGI serving, with dependencies defined in `app/requirements.txt`. Containerized deployment is defined by `Dockerfile` and Compose manifests (`docker-compose.yaml`, `docker-compose.dev.yaml`), allowing the same service to run standalone or behind a reverse proxy. Root `requirements.txt` likely supports the Vercel/API deployment path alongside `api/index.py`.

#### Serverless Boundary
`api/index.py` is the platform-facing API handler for deployment configured by `vercel.json`. This creates a second runtime boundary from the Flask/Gunicorn path: Vercel invokes the API module, while conventional hosts invoke `app/portable.py`. Engineers changing retrieval behavior should verify whether logic is duplicated or delegated across these two entry points.

#### Build and Distribution
CI is defined in `.github/workflows/build.yaml`; published images are intended for Docker registries. The material runtime stack is Python + Flask/Gunicorn, optionally Docker/Compose, and optionally Vercel serverless infrastructure. No database, queue, authentication provider, or persistent storage is indicated by the repository structure.

Main entry points: [`app/portable.py`](https://github.com/wasi-master/13ft/blob/main/app/portable.py) (Flask retrieval app), [`api/index.py`](https://github.com/wasi-master/13ft/blob/main/api/index.py) (Serverless API handler), [`Dockerfile`](https://github.com/wasi-master/13ft/blob/main/Dockerfile) (Docker image), [`app/locales/en.json`](https://github.com/wasi-master/13ft/blob/main/app/locales/en.json) (Translation catalogs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtimes"]
  node_flask["Flask retrieval app<br/>[portable.py]"]
  node_locales["Translation catalogs<br/>JSON locale assets<br/>[en.json]"]
  node_gunicorn["Gunicorn<br/>WSGI server<br/>[gunicorn.conf.py]"]
  node_serverless["Serverless API handler<br/>Python API<br/>[index.py]"]
end

subgraph group_deploy["Deployment paths"]
  node_vercel{{"Vercel platform<br/>serverless platform<br/>[vercel.json]"}}
  node_python["Direct Python run<br/>local runtime<br/>[portable.py]"]
  node_container["Docker image<br/>container runtime"]
  node_compose["Compose deployment<br/>container orchestration"]
  node_app_deps["App dependencies<br/>Python requirements<br/>[requirements.txt]"]
  node_api_deps["API dependencies<br/>Python requirements<br/>[requirements.txt]"]
  node_ci["Image build CI<br/>GitHub Actions<br/>[build.yaml]"]
end

node_browser(("Browser<br/>client"))
node_publisher{{"Target publisher<br/>external upstream"}}

node_browser -->|"submits target URL"| node_flask
node_flask -->|"Googlebot-like fetch, then fallbacks"| node_publisher
node_publisher -->|"article content or failure"| node_flask
node_flask -->|"renders content/status"| node_browser
node_locales -->|"localized UI text"| node_flask
node_gunicorn -->|"serves WSGI app"| node_flask
node_python -->|"runs directly"| node_flask
node_compose -->|"runs"| node_container
node_container -->|"hosts service"| node_flask
node_app_deps -.->|"installs runtime packages"| node_flask
node_vercel -->|"invokes"| node_serverless
node_api_deps -.->|"installs API packages"| node_serverless
node_serverless -.->|"retrieval behavior may be delegated or duplicated"| node_publisher
node_ci -->|"builds image"| node_container

click node_flask "https://github.com/wasi-master/13ft/blob/main/app/portable.py"
click node_locales "https://github.com/wasi-master/13ft/blob/main/app/locales/en.json"
click node_gunicorn "https://github.com/wasi-master/13ft/blob/main/app/gunicorn.conf.py"
click node_serverless "https://github.com/wasi-master/13ft/blob/main/api/index.py"
click node_vercel "https://github.com/wasi-master/13ft/blob/main/vercel.json"
click node_python "https://github.com/wasi-master/13ft/blob/main/app/portable.py"
click node_container "https://github.com/wasi-master/13ft/blob/main/Dockerfile"
click node_compose "https://github.com/wasi-master/13ft/blob/main/docker-compose.yaml"
click node_app_deps "https://github.com/wasi-master/13ft/blob/main/app/requirements.txt"
click node_api_deps "https://github.com/wasi-master/13ft/blob/main/requirements.txt"
click node_ci "https://github.com/wasi-master/13ft/blob/main/.github/workflows/build.yaml"

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_flask,node_locales,node_gunicorn,node_serverless toneBlue
class node_vercel,node_python,node_container,node_compose,node_app_deps,node_api_deps,node_ci toneAmber
class node_browser,node_publisher toneNeutral
```

## Components

### Application runtimes

- [Flask retrieval app](https://github.com/wasi-master/13ft/blob/main/app/portable.py): Flask · Owns HTTP routes, retrieval orchestration, and response rendering. · `app/portable.py`
- [Translation catalogs](https://github.com/wasi-master/13ft/blob/main/app/locales/en.json): JSON locale assets · Loaded according to the LOCALE setting. · `app/locales/en.json`
- [Gunicorn](https://github.com/wasi-master/13ft/blob/main/app/gunicorn.conf.py): WSGI server · Production host for the Flask application. · `app/gunicorn.conf.py`
- [Serverless API handler](https://github.com/wasi-master/13ft/blob/main/api/index.py): Python API · Platform-facing entry point separate from the Flask runtime. · `api/index.py`

### Deployment paths

- [Vercel platform](https://github.com/wasi-master/13ft/blob/main/vercel.json): serverless platform · `vercel.json`
- [Direct Python run](https://github.com/wasi-master/13ft/blob/main/app/portable.py): local runtime · `app/portable.py`
- [Docker image](https://github.com/wasi-master/13ft/blob/main/Dockerfile): container runtime · `Dockerfile`
- [Compose deployment](https://github.com/wasi-master/13ft/blob/main/docker-compose.yaml): container orchestration · Runs the service standalone or behind a reverse proxy. · `docker-compose.yaml`
- [App dependencies](https://github.com/wasi-master/13ft/blob/main/app/requirements.txt): Python requirements · `app/requirements.txt`
- [API dependencies](https://github.com/wasi-master/13ft/blob/main/requirements.txt): Python requirements · `requirements.txt`
- [Image build CI](https://github.com/wasi-master/13ft/blob/main/.github/workflows/build.yaml): GitHub Actions · Builds images for registry publication. · `.github/workflows/build.yaml`

### Other components

- **Browser**: client · Submits article URLs and receives rendered results.
- **Target publisher**: external upstream · Paywall, bot detection, availability, and markup affect retrieval.

## Connections

- Browser → Flask retrieval app: submits target URL
- Flask retrieval app → Target publisher: Googlebot-like fetch, then fallbacks
- Target publisher → Flask retrieval app: article content or failure
- Flask retrieval app → Browser: renders content/status
- Translation catalogs → Flask retrieval app: localized UI text
- Gunicorn → Flask retrieval app: serves WSGI app
- Direct Python run → Flask retrieval app: runs directly
- Compose deployment → Docker image: runs
- Docker image → Flask retrieval app: hosts service
- App dependencies → Flask retrieval app: installs runtime packages
- Vercel platform → Serverless API handler: invokes
- API dependencies → Serverless API handler: installs API packages
- Serverless API handler → Target publisher: retrieval behavior may be delegated or duplicated
- Image build CI → Docker image: builds image
