# el4cteo/fast-anything architecture

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

- Interactive diagram: https://gitdiagram.com/el4cteo/fast-anything
- Repository: https://github.com/el4cteo/fast-anything

## Overview

fast-anything profiles an existing application, selects portable hot functions, records real calls, scaffolds Rust ports, verifies them against recorded and derived cases, then enables or disables the replacements and benchmarks the whole app. The CLI and MCP server share the pipeline. Language backends implement profiling, recording, bridging and reversible source edits. The map includes the documented reporting and diagnostic capabilities; backend internals beyond the supplied excerpts are represented at their module paths.

Main entry points: [`src/backend.rs`](https://github.com/el4cteo/fast-anything/blob/main/src/backend.rs) (Backend dispatch), [`src/pipeline.rs`](https://github.com/el4cteo/fast-anything/blob/main/src/pipeline.rs) (Shared pipeline), [`src/main.rs`](https://github.com/el4cteo/fast-anything/blob/main/src/main.rs) (CLI commands), [`src/hotspot.rs`](https://github.com/el4cteo/fast-anything/blob/main/src/hotspot.rs) (Hotspot ranking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Port workflow"]
  node_cli["CLI commands<br/>[main.rs]"]
  node_pipeline["Shared pipeline<br/>[pipeline.rs]"]
  node_hotspots["Hotspot ranking<br/>[hotspot.rs]"]
end

subgraph group_backends["Language backends"]
  node_backend["Backend dispatch<br/>[backend.rs]"]
  node_python["Python backend<br/>[python.rs]"]
  node_node["Node backend<br/>[node.rs]"]
  node_cfamily["C/C++ backend<br/>[cfamily.rs]"]
  node_ruby["Ruby backend<br/>[ruby.rs]"]
  node_java["Java backend<br/>[java.rs]"]
  node_golang["Go backend<br/>[golang.rs]"]
  node_php["PHP backend<br/>[php.rs]"]
  node_csharp["C&#35; backend<br/>[csharp.rs]"]
  node_native["C bridge<br/>[native.rs]"]
end

subgraph group_interfaces["Interfaces and results"]
  node_agent["Coding agent<br/>[agent.rs]"]
  node_mcp["MCP server<br/>[mcp.rs]"]
  node_show["Status output<br/>[show.rs]"]
  node_report["Reports<br/>[report.rs]"]
end

subgraph group_support["Project support"]
  node_state[("Project state<br/>[state.rs]")]
  node_doctor["Environment checks<br/>[doctor.rs]"]
  node_ui["Terminal output<br/>[ui.rs]"]
  node_util["Process utilities<br/>[util.rs]"]
end

node_developer(("Developer"))
node_app["Target application"]

node_developer -->|"runs commands"| node_cli
node_cli -->|"dispatches workflow"| node_pipeline
node_developer -->|"starts server"| node_mcp
node_mcp -->|"invokes commands"| node_pipeline
node_pipeline -->|"uses language operations"| node_backend
node_backend -->|"dispatches Python"| node_python
node_backend -->|"dispatches Node"| node_node
node_backend -->|"dispatches C/C++"| node_cfamily
node_backend -->|"dispatches Ruby"| node_ruby
node_backend -->|"dispatches Java"| node_java
node_backend -->|"dispatches Go"| node_golang
node_backend -->|"dispatches PHP"| node_php
node_backend -->|"dispatches C&#35;"| node_csharp
node_pipeline -->|"ranks candidates"| node_hotspots
node_hotspots -->|"identifies hot functions"| node_app
node_pipeline -->|"loads and saves"| node_state
node_pipeline -->|"runs porting agent"| node_agent
node_pipeline -->|"renders results"| node_show
node_pipeline -->|"creates report"| node_report
node_python -->|"profiles and records"| node_app
node_node -->|"profiles and records"| node_app
node_cfamily -->|"profiles and records"| node_app
node_pipeline -->|"verifies bridge ports"| node_native
node_native -->|"uses port metadata"| node_state
node_cli -->|"checks environment"| node_doctor
node_doctor -->|"prints checks"| node_ui
node_cli -->|"prints command errors"| node_ui
node_backend -->|"runs processes"| node_util
node_developer -->|"provides runtime command"| node_app

click node_cli "https://github.com/el4cteo/fast-anything/blob/main/src/main.rs"
click node_pipeline "https://github.com/el4cteo/fast-anything/blob/main/src/pipeline.rs"
click node_hotspots "https://github.com/el4cteo/fast-anything/blob/main/src/hotspot.rs"
click node_backend "https://github.com/el4cteo/fast-anything/blob/main/src/backend.rs"
click node_python "https://github.com/el4cteo/fast-anything/blob/main/src/python.rs"
click node_node "https://github.com/el4cteo/fast-anything/blob/main/src/node.rs"
click node_cfamily "https://github.com/el4cteo/fast-anything/blob/main/src/cfamily.rs"
click node_ruby "https://github.com/el4cteo/fast-anything/blob/main/src/ruby.rs"
click node_java "https://github.com/el4cteo/fast-anything/blob/main/src/java.rs"
click node_golang "https://github.com/el4cteo/fast-anything/blob/main/src/golang.rs"
click node_php "https://github.com/el4cteo/fast-anything/blob/main/src/php.rs"
click node_csharp "https://github.com/el4cteo/fast-anything/blob/main/src/csharp.rs"
click node_native "https://github.com/el4cteo/fast-anything/blob/main/src/native.rs"
click node_state "https://github.com/el4cteo/fast-anything/blob/main/src/state.rs"
click node_agent "https://github.com/el4cteo/fast-anything/blob/main/src/agent.rs"
click node_mcp "https://github.com/el4cteo/fast-anything/blob/main/src/mcp.rs"
click node_show "https://github.com/el4cteo/fast-anything/blob/main/src/show.rs"
click node_report "https://github.com/el4cteo/fast-anything/blob/main/src/report.rs"
click node_doctor "https://github.com/el4cteo/fast-anything/blob/main/src/doctor.rs"
click node_ui "https://github.com/el4cteo/fast-anything/blob/main/src/ui.rs"
click node_util "https://github.com/el4cteo/fast-anything/blob/main/src/util.rs"

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_cli,node_pipeline,node_hotspots toneBlue
class node_backend,node_python,node_node,node_cfamily,node_ruby,node_java,node_golang,node_php,node_csharp,node_native toneAmber
class node_agent,node_mcp,node_show,node_report toneMint
class node_state,node_doctor,node_ui,node_util toneRose
class node_developer,node_app toneIndigo
```

## Components

### Port workflow

- [CLI commands](https://github.com/el4cteo/fast-anything/blob/main/src/main.rs): `src/main.rs`
- [Shared pipeline](https://github.com/el4cteo/fast-anything/blob/main/src/pipeline.rs): `src/pipeline.rs`
- [Hotspot ranking](https://github.com/el4cteo/fast-anything/blob/main/src/hotspot.rs): `src/hotspot.rs`

### Language backends

- [Backend dispatch](https://github.com/el4cteo/fast-anything/blob/main/src/backend.rs): `src/backend.rs`
- [Python backend](https://github.com/el4cteo/fast-anything/blob/main/src/python.rs): `src/python.rs`
- [Node backend](https://github.com/el4cteo/fast-anything/blob/main/src/node.rs): `src/node.rs`
- [C/C++ backend](https://github.com/el4cteo/fast-anything/blob/main/src/cfamily.rs): `src/cfamily.rs`
- [Ruby backend](https://github.com/el4cteo/fast-anything/blob/main/src/ruby.rs): `src/ruby.rs`
- [Java backend](https://github.com/el4cteo/fast-anything/blob/main/src/java.rs): `src/java.rs`
- [Go backend](https://github.com/el4cteo/fast-anything/blob/main/src/golang.rs): `src/golang.rs`
- [PHP backend](https://github.com/el4cteo/fast-anything/blob/main/src/php.rs): `src/php.rs`
- [C# backend](https://github.com/el4cteo/fast-anything/blob/main/src/csharp.rs): `src/csharp.rs`
- [C bridge](https://github.com/el4cteo/fast-anything/blob/main/src/native.rs): `src/native.rs`

### Interfaces and results

- [Coding agent](https://github.com/el4cteo/fast-anything/blob/main/src/agent.rs): `src/agent.rs`
- [MCP server](https://github.com/el4cteo/fast-anything/blob/main/src/mcp.rs): `src/mcp.rs`
- [Status output](https://github.com/el4cteo/fast-anything/blob/main/src/show.rs): `src/show.rs`
- [Reports](https://github.com/el4cteo/fast-anything/blob/main/src/report.rs): `src/report.rs`

### Project support

- [Project state](https://github.com/el4cteo/fast-anything/blob/main/src/state.rs): `src/state.rs`
- [Environment checks](https://github.com/el4cteo/fast-anything/blob/main/src/doctor.rs): `src/doctor.rs`
- [Terminal output](https://github.com/el4cteo/fast-anything/blob/main/src/ui.rs): `src/ui.rs`
- [Process utilities](https://github.com/el4cteo/fast-anything/blob/main/src/util.rs): `src/util.rs`

### Other components

- **Developer**
- **Target application**

## Connections

- Developer → CLI commands: runs commands (evidence: `README.md`)
- CLI commands → Shared pipeline: dispatches workflow (evidence: `src/main.rs`)
- Developer → MCP server: starts server (evidence: `README.md`)
- MCP server → Shared pipeline: invokes commands (evidence: `src/mcp.rs`)
- Shared pipeline → Backend dispatch: uses language operations (evidence: `src/pipeline.rs`)
- Backend dispatch → Python backend: dispatches Python (evidence: `src/backend.rs`)
- Backend dispatch → Node backend: dispatches Node (evidence: `src/backend.rs`)
- Backend dispatch → C/C++ backend: dispatches C/C++ (evidence: `src/backend.rs`)
- Backend dispatch → Ruby backend: dispatches Ruby (evidence: `src/backend.rs`)
- Backend dispatch → Java backend: dispatches Java (evidence: `src/backend.rs`)
- Backend dispatch → Go backend: dispatches Go (evidence: `src/backend.rs`)
- Backend dispatch → PHP backend: dispatches PHP (evidence: `src/backend.rs`)
- Backend dispatch → C# backend: dispatches C# (evidence: `src/backend.rs`)
- Shared pipeline → Hotspot ranking: ranks candidates (evidence: `src/pipeline.rs`)
- Hotspot ranking → Target application: identifies hot functions (evidence: `README.md`)
- Shared pipeline → Project state: loads and saves (evidence: `src/pipeline.rs`)
- Shared pipeline → Coding agent: runs porting agent (evidence: `src/pipeline.rs`)
- Shared pipeline → Status output: renders results (evidence: `src/pipeline.rs`)
- Shared pipeline → Reports: creates report (evidence: `src/pipeline.rs`)
- Python backend → Target application: profiles and records (evidence: `README.md`)
- Node backend → Target application: profiles and records (evidence: `README.md`)
- C/C++ backend → Target application: profiles and records (evidence: `src/cfamily.rs`)
- Shared pipeline → C bridge: verifies bridge ports (evidence: `src/native.rs`)
- C bridge → Project state: uses port metadata (evidence: `src/native.rs`)
- CLI commands → Environment checks: checks environment (evidence: `src/main.rs`)
- Environment checks → Terminal output: prints checks (evidence: `src/doctor.rs`)
- CLI commands → Terminal output: prints command errors (evidence: `src/main.rs`)
- Backend dispatch → Process utilities: runs processes (evidence: `src/backend.rs`)
- Developer → Target application: provides runtime command (evidence: `README.md`)
