--- title: The local software factory - from my phone date: 2026-11-01 excerpt: Type what to build on an iPhone, attach any Markdown files for context, and watch an idea become reality. tags: [engineering, aac, future-thoughts] ogImage: src/assets/posts/the-local-software-factory-from-my-phone/app.jpg --- Type what to build on an iPhone, attach any Markdown files for context, and watch an idea become reality. A local model builds it, opens a pull request, deploys it, and tests it against the live URL. ## How it works ### A · iPhone app Queue tasks, see the current step, watch the model live, interrupt anytime. ![The iPhone app: a new task, the task list, and a running task with Pause, Redirect and Stop](../../assets/posts/the-local-software-factory-from-my-phone/app.jpg) ### B · Cloudflare The Mac sits on a home network, so the question is how the phone reaches it from anywhere without exposing it. The answer is a Cloudflare Tunnel. - **Outbound only.** A small daemon, `cloudflared`, runs on the Mac as a background service and dials out to Cloudflare. The router has no open ports, there is no port forwarding, and the home IP never shows up in DNS. A scan of my network finds nothing listening. - **Works from anywhere.** The app talks to a normal HTTPS hostname. On Wi-Fi, on cellular, or on the other side of the world, the request goes to Cloudflare first and rides the tunnel back to the Mac. No VPN to toggle on the phone. - **Locked to me.** Cloudflare Access sits in front of the hostname. Every request has to carry a valid identity before it gets anywhere near the tunnel, so the job API never sees traffic from anyone else. - **Keeps the stream alive.** The tunnel carries the WebSocket that streams each step and the live model output back to the phone. Why it matters: this machine can push code, open pull requests, and trigger deploys. That power is only safe if nothing on the internet can reach it directly. The tunnel and Access give it a front door that only opens for me, and the Mac itself never has to be reachable. ### C · Mac Studio M5 Ultra, 512 GB The job API, agent and local model all run here. Everything starts at boot as a background service, so nothing needs a login. - **Job API.** Node, Fastify, SQLite in one process and one file. It holds the task queue, takes interrupts from the phone, streams each step back over a WebSocket, and sends a push notification when the app is closed. - **Agent.** It claims the next task, clones the repo onto its own branch, and reads the message and Markdown files I attached, then works in a loop of reading files, writing files, and running commands until the job is done. - **Web search.** SearXNG, self-hosted on the same Mac, is a tool the agent calls to research. A model that answers from memory is a chatbot. Once it can go find the best way to do something, it becomes an agent. > "It's not just what you know. It's knowing where to find what you don't." - **Local model.** It runs on its own server on the same machine. The agent talks to it over an OpenAI-compatible API, so swapping models is a config change. - **Interrupts.** Pause, redirect, or stop take effect at the next safe point. The agent commits what it has to its branch and reports where it is. When it's finished, it pushes and opens the pull request. ```mermaid %%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#ecedda','primaryTextColor':'#1a1f1c','primaryBorderColor':'#2f6b3e','lineColor':'#2f6b3e','edgeLabelBackground':'#f4f4ef','clusterBkg':'#f4f4ef','clusterBorder':'#d9ddd3','fontFamily':'Roboto Mono, monospace'}}}%% flowchart LR api["job API
(SQLite)"] -->|"next task"| agent["agent"] agent -->|"steps"| api agent <--> model["local model"] agent <--> web["web search tool"] agent -->|"branch + PR"| repo["GitHub repo"] ``` ### D · GitHub Actions deploys to Azure, any cloud, or local hardware and runs e2e on the live URL. iOS builds on Xcode Cloud. ```mermaid %%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#ecedda','primaryTextColor':'#1a1f1c','primaryBorderColor':'#2f6b3e','lineColor':'#2f6b3e','edgeLabelBackground':'#f4f4ef','clusterBkg':'#f4f4ef','clusterBorder':'#d9ddd3','fontFamily':'Roboto Mono, monospace'}, 'flowchart': {'subGraphTitleMargin': {'top': 6, 'bottom': 14}}}}%% flowchart TD app["A · iPhone app"] cf["B · Cloudflare tunnel + Access"] api["C · Mac Studio"] gh["D · GitHub Actions"] net@{ shape: cloud, label: "Azure, any cloud, or local hardware" } app -->|"tasks, interrupts"| cf cf --> api api -->|"live progress"| app api -->|"pull request"| gh gh -.->|"deploy + e2e on live URL"| net ```