# gomartin94/proxyflare architecture

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

- Interactive diagram: https://gitdiagram.com/gomartin94/proxyflare
- Repository: https://github.com/gomartin94/proxyflare

## Overview

Proxyflare for Cloudflare Pages adapts Pages middleware requests to the separately packaged Proxyflare core. The principal flow is: a site developer supplies route configuration, Cloudflare Pages invokes the middleware, and the middleware builds a request container before calling the core router. The README documents the core’s route capabilities: proxying services and websites, redirects, and static responses. The core implementation is not present in this repository, so its internal stages are not expanded; the graph shows only the integration boundary and documented traffic destination.

Main entry points: [`functions/_middleware.ts`](https://github.com/gomartin94/proxyflare/blob/main/functions/_middleware.ts) (Pages middleware)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages_adapter["Pages adapter"]
  node_middleware["Pages middleware<br/>[_middleware.ts]"]
  node_container["Request container"]
end

subgraph group_proxy_runtime["Proxy runtime"]
  node_core["Proxyflare core router"]
end

node_developer(("Site developer"))
node_pages(("Cloudflare Pages"))
node_destination(("Target services"))

node_developer -->|"configures routes"| node_middleware
node_pages -->|"invokes"| node_middleware
node_middleware -->|"creates"| node_container
node_middleware -->|"calls router"| node_core
node_core -->|"proxies traffic"| node_destination

click node_middleware "https://github.com/gomartin94/proxyflare/blob/main/functions/_middleware.ts"

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_middleware,node_container toneBlue
class node_core toneAmber
class node_developer,node_pages,node_destination toneIndigo
```

## Components

### Pages adapter

- [Pages middleware](https://github.com/gomartin94/proxyflare/blob/main/functions/_middleware.ts): `functions/_middleware.ts`
- **Request container**

### Proxy runtime

- **Proxyflare core router**

### Other components

- **Site developer**
- **Cloudflare Pages**
- **Target services**

## Connections

- Site developer → Pages middleware: configures routes (evidence: `README.md`)
- Cloudflare Pages → Pages middleware: invokes (evidence: `README.md`)
- Pages middleware → Request container: creates (evidence: `functions/_middleware.ts`)
- Pages middleware → Proxyflare core router: calls router (evidence: `functions/_middleware.ts`)
- Proxyflare core router → Target services: proxies traffic (evidence: `README.md`)
