Scaffold backend: Hono + Rivet Kit + per-user Docker stack

Backend that provisions per-user OpenCode + Gitea Docker pair via
dockerode and exposes the Grow Agent / sub-agent Rivet Kit actors
described in the PRD. Sub-agent workflows route through the parent
Grow Agent's OpenCode Docker.

- src/docker/manager.ts spawns growqr-gitea-<userId> and growqr-opencode-<userId>
- src/actors/{grow-agent,sub-agent,registry}.ts: Rivet Kit actors
- src/routes/{actors,opencode,git}.ts: PRD section 5.2-5.4 HTTP API
- docker-compose.yml runs rivet-engine + backend (mounts host Docker socket)
- PRD updated to lock in per-user OpenCode/Gitea Docker topology

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
sai karthik
2026-05-18 15:12:34 +05:30
commit 5eaf52b8a5
19 changed files with 6106 additions and 0 deletions

20
.env.example Normal file
View File

@@ -0,0 +1,20 @@
PORT=4000
LOG_LEVEL=info
# Rivet Kit engine (self-hosted in docker-compose)
RIVET_ENDPOINT=http://localhost:6420
# Docker images used for per-user containers
GITEA_IMAGE=gitea/gitea:1.22
OPENCODE_IMAGE=ghcr.io/sst/opencode:latest
# Host where spawned containers expose their ports (usually localhost in dev)
USER_CONTAINER_HOST=127.0.0.1
# Workspace root on the host that gets bind-mounted into per-user containers.
# Each user gets a subdir: ${USER_DATA_ROOT}/<userId>/{gitea,workspace}
USER_DATA_ROOT=./.data/users
# Port range allocated to spawned per-user containers
USER_PORT_RANGE_START=20000
USER_PORT_RANGE_END=29999