Sign inSign up

javdet/nib-frontend

By javdet

•Updated 15 days ago

NIB web UI — nginx-served SPA for Neuro Infrastructure Builder, proxies /api to the backend

Image
Developer tools
Web servers
0

3.2K

javdet/nib-frontend repository overview

⁠NIB — web UI

Web interface for NIB (Neuro Infrastructure Builder) — a tool for planned infrastructure work. You describe a task; NIB decomposes it into stages, works each stage out into elementary steps, derives the verification checks and the rollback plan, and then either executes the steps or hands the operator instructions detailed enough to follow without guessing.

This image is a React 19 + TypeScript single-page app, built with Vite and served by nginx. The same nginx also reverse-proxies /api/* to the NIB backend, so the browser talks to exactly one origin and you get no CORS configuration, no second hostname, and no preflight round trips on every call.

It is one of four images: nib-frontend (this one), nib-backend⁠ (API and agent orchestrator), nib-kb⁠ (knowledge-base MCP server) and nib-agent⁠ (the coding-agent runner).


⁠What you do in it

  • Start a plan in Main mode and watch the orchestrator pick a specialist, ask you the questions it needs answered, and report each result in the same chat.
  • Review the decomposition — the stage DAG is rendered with Mermaid, so dependencies between stages are visible rather than implied.
  • Work through the detailed plan — every action with its commands, its verification checks and the rollback derived from the whole plan; comment on actions, reorder them, pin the ones that matter, retry a failed one.
  • Execute — run an action and follow the agent's turns live; force-stop the running execution from the action row.
  • Curate what the agent knows — rules per infrastructure component, skills as markdown playbooks, variables and encrypted secrets, knowledge-base collections and documents.
  • Manage tools — add remote MCP servers, browse the indexed tool catalogue, sort tools into categories and choose which ones each mode may use.

The current mode is always shown in the top right; the running version at the bottom of the sidebar.


⁠Quick start

The UI is useless on its own — it needs a reachable backend.

docker run -d --name nib-frontend \
  -p 8080:80 \
  -e API_UPSTREAM=http://backend:8080 \
  javdet/nib-frontend:latest

Open http://localhost:8080⁠. In practice you want the whole stack:

git clone https://github.com/javdet/nib && cd nib
cp .env.example .env          # set LLM_API_KEY
docker compose up -d          # UI on http://localhost:8080

or with the bundled Helm chart:

helm install nib ./deploy/helm/nib -n nib --create-namespace \
  --set secrets.llmApiKey="$LLM_API_KEY"
kubectl port-forward svc/nib-frontend 8080:80 -n nib

⁠Configuration

⁠Runtime
VariableDefaultPurpose
API_UPSTREAMhttp://backend:8080Where nginx proxies /api/* — a Compose service name, a Kubernetes Service, or any reachable URL

API_UPSTREAM is substituted into the nginx config from a template at container start, so one image serves every environment; no rebuild to repoint the API.

⁠Build time
Build argDefaultPurpose
VITE_API_URL/api/v1Where the SPA sends its calls. The default keeps them relative so the nginx proxy handles them; override it to point the app at another origin directly (you then own the CORS setup on the backend)

⁠What nginx does

  • GET /health → 200 ok, plain text, access log off — for Compose/Kubernetes probes and load balancers. It is answered by nginx itself and never proxied, so the UI stays "up" for an orchestrator even while the backend is restarting.
  • /api/ → proxied to ${API_UPSTREAM} over HTTP/1.1, forwarding Host, X-Real-IP, X-Forwarded-For and X-Forwarded-Proto. Read and send timeouts are 300 s: an agent turn with several tool calls in it takes far longer than nginx's 60 s default, and a truncated execution stream is worse than a slow one.
  • /assets/ → Vite's content-hashed bundles, served with Cache-Control: public, immutable for a year. Safe because the filename changes whenever the content does.
  • Everything else → try_files $uri $uri/ /index.html, so React Router client-side routes survive a page reload or a pasted deep link.
  • Baseline security headers on every response: X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, Referrer-Policy: strict-origin-when-cross-origin.

⁠Image contents

  • Runtime base nginx:1.31-alpine — static assets and a config template, nothing else. No Node, no bundler, no node_modules at runtime.
  • Built with Bun on oven/bun:1.3-alpine, type-checked with tsc -b before bundling.
  • UI stack: React 19, Radix UI primitives, Tailwind CSS 4, React Router 7, lucide-react icons, Inter as a self-hosted variable font (no call out to a font CDN), Mermaid for the stage DAG.
  • The build stage is pinned to BUILDPLATFORM: Vite output is architecture-independent static assets, so the linux/arm64 image is assembled without running the bundler under QEMU.

Exposes port 80. Healthcheck: wget -qO- http://127.0.0.1/health, 30 s interval.


⁠Tags and platforms

latest · vX.Y.Z (release, matching the repository's VERSION file) · <git-sha> (exact commit). Built for linux/amd64 and linux/arm64.

Pin vX.Y.Z in production and keep the frontend on the same tag as the backend — they are released together from one repository and the UI is written against that release's API.


  • Source, documentation and issues: https://github.com/javdet/nib⁠
  • Helm chart and Compose files: deploy/ and docker-compose.yml in the repository
  • Licence: Nib Non-Commercial License 1.0 (MIT-based, with attribution and a non-commercial-use restriction). Read LICENSE before deploying this in a commercial setting.

Tag summary

Content type

Image

Digest

sha256:14a315521…

Size

26.8 MB

Last updated

15 days ago

docker pull javdet/nib-frontend