Repository navigation
Architecture
FormPromo is three parts that run as separate processes on one computer.
| Part | Where | What it does |
|---|---|---|
| Engine |
backend/app (Python, FastAPI) |
Kits, templates, the resolver that turns a kit and a template into a promo document, ingest, music fitting, the outputs (film, FormCut, FormVFX, FormEncoder), jobs, the MCP server and the terminals |
| Window |
frontend/src (vanilla TypeScript, Vite) |
Home, the rail of panels (kits, templates, style, info, preview, outputs, agents, terminal), the menu bar, Preferences, the status bar and the jobs list |
| Desktop shell |
src-tauri (Rust, Tauri 2) |
Starts the frozen engine (one folder in Resources/engine on macOS, the sidecar elsewhere) on a free port with a fresh launch token, opens the window, builds the native menus, checks for updates and stops the engine on exit |
The window reaches the engine over HTTP and one WebSocket on 127.0.0.1. Every request carries the launch token, which travels only inside the address handed to the window. The engine's guard refuses other hosts, other origins and cross-site requests.
Agents reach the engine through the MCP server, over stdio (./formpromo mcp) or HTTP at /mcp. The FormVFX panel uses a second loopback socket with its own token; see docs/PLUGINS.md.
-
engine/: the work itself (kits, templates, resolve, music, beatgrid, bedfit, captions, credits, lint, qa, stage, outputs). -
agent/: the agent substrate (local guard, consent, MCP over HTTP and stdio, client install, terminals, workspace). -
routers/: every HTTP route, one module per area (the window's API, jobs, preview, the window session, the file browser, agents, install, Claude Code, terminals, MCP), mounted in order bymain.py. -
panel.py: the panel socket. -
cli.pyandlaunch.py: the command line and the launcher.
The window draws without a flash: the theme is applied before first paint, panels keep their size while they load, and every layout is checked for shift at 4x CPU slowdown. Icons are inline currentColor SVG, and colours come from the family tokens in styles/tokens.css.
contracts/ holds the JSON Schemas for a kit, a template and a promo document; contracts/README.md says what each may hold.