Backend maintainer guide
What it does
The backend is a FastAPI app with one endpoint: POST /generate.
It receives a values dict from the UI, writes it to a temp file, runs helm template, and returns the rendered manifests (or an error string from stderr).
In production it also serves the compiled React frontend as static files.
Running locally
cd ui/backend
pip install -r requirements.txt
uvicorn main:app --port 8000 --reload
The React dev server (npm run dev in ui/frontend, or npm start in ui/docs) proxies /generate to http://localhost:8000 automatically — no extra config needed.
Endpoint
POST /generate
Request body:
| Field | Type | Default | Description |
|---|---|---|---|
values | object | — | The values dict (same content as values.yaml, parsed to JSON) |
release_name | string | my-app | Helm release name |
oci_chart_ref | string | oci://ghcr.io/my-github-repo/helm/base-chart | OCI chart reference |
oci_chart_version | string | 1.0.0 | Chart version |
Success response: { "manifests": "<yaml string>" }
Error response: { "error": "<helm stderr>" }
Requirements
helmmust be installed and in$PATH- For private OCI registries, run
helm registry login <registry>first
Production build
cd ui/frontend
npm run build # outputs to ui/frontend/dist/
cd ui/backend
uvicorn main:app --port 8000 # serves React + /generate on port 8000
Adding a new endpoint
Add a route in main.py before the static-files mount at the bottom:
@app.get("/health")
async def health():
return {"status": "ok"}
The app.mount("/", ...) line must stay last — it acts as a catch-all for the React frontend.