4fae77e5262ab34091989ea77c26eec1cbd14bc4
New /opt/boocode/codecontext/ directory holding the codecontext sidecar that BooCode's tool wrappers (track B.2) will talk to. No BooCode-side changes yet — this commit lands the sidecar standalone. - Dockerfile: multi-stage golang:1.24-alpine → alpine:3.20. Clones codecontext at v3.2.1 from github.com/nmakod/codecontext (cgo build for tree-sitter bindings), builds the shim alongside (CGO_ENABLED=0). - shim.go: stdlib-only Go HTTP server wrapping codecontext's stdio MCP child. Newline-delimited JSON framing per the MCP transport spec (NOT LSP-style Content-Length). 8 POST /v1/* endpoints, one per MCP tool, plus GET /health. Child supervised via child.Wait() goroutine that os.Exit's on death so the container's restart: unless-stopped policy fires (Signal(0) on a zombie returns nil and is not a liveness check — discovered during kill-restart testing). - go.mod: no third-party deps; future Go security advisories don't apply. docker-compose service: joins boocode_net (no host port), mounts /opt:/opt:ro (BooCode projects live at /opt/<slug>, not exclusively under /opt/projects), healthcheck on /health. Verified: build clean, healthcheck reports healthy ~15s after up, multi-project queries return valid markdown, target_dir swap works on subtree paths. Kill-restart cycle completes in ~200ms with one failed health poll observed (no misleading "ok" during the gap). Memory: 24.6 MiB after 5 search_symbols calls, 5.6 MiB after 30 min idle — codecontext releases the per-call graph between target_dir swaps, so the shim doesn't hold the indexed state.
boocode
Self-hosted single-user developer chat app. v1: chat only.
Stack
- Node 20, Fastify, postgres (porsager/postgres), ws, zod
- React 18, Vite, TypeScript, Tailwind v4, shadcn/ui
- Postgres 16
- pnpm workspaces
Layout
apps/server— Fastify API + WebSocket + inference loop + file-read toolsapps/web— React frontend; served by Fastify in production, Vite in dev
Local dev
Requires Node 20, pnpm, Docker (for Postgres), and ripgrep.
# install
pnpm install
# bring up postgres only
cp .env.example .env
# edit POSTGRES_PASSWORD if you like; default DATABASE_URL points at the container
docker compose up -d boocode_db
# run server (port 3000) and web (port 5173) in two shells
DATABASE_URL=postgres://boocode:devpass@127.0.0.1:5500/boocode \
LLAMA_SWAP_URL=http://100.101.41.16:8401 \
pnpm dev:server
pnpm dev:web
The Vite dev server proxies /api and /api/ws/* to the Fastify backend with a
synthetic Remote-User: sam header so the Authelia auth layer can be skipped
during development.
Production
cd /opt/boocode
docker compose up --build -d
Binds to 100.114.205.53:9500 (Tailscale). Authelia is expected to gate the
upstream and inject Remote-User. Postgres binds loopback only.
What v1 has
Project sidebar, sessions per project, chat with streaming responses over
WebSocket, four file-read tools scoped to the project root (view_file,
list_dir, grep, find_files), and a model picker driven by llama-swap's
/v1/models.
What v1 does not have lives in v2 (terminal pane) and v3 (Coder pane).
Languages
TypeScript
94.1%
CSS
1.9%
JavaScript
1.1%
Shell
0.8%
PLpgSQL
0.6%
Other
1.5%