Skip to content

getufy/collaborate-vm

Repository files navigation

Collaborate VM

CI License: MIT

A collaborative AI coding workspace that runs sandboxed dev environments in Docker containers. Users get a browser-based IDE with a terminal, file editor, live preview, and an AI coding agent (Goose) — all without installing anything locally.

Status: early-stage / pre-1.0. APIs and configuration may change. Use in production at your own risk.

Architecture

Browser (React SPA)
    |
    ├── :4200  Vite dev server (frontend)
    |     └── proxies /api, /ws, /proxy → :4100
    |
    └── :4100  Go API server (backend)
          ├── REST API   — sessions, users, files, search
          ├── WebSocket  — terminal I/O, port scanning
          ├── Proxy      — /proxy/{sessionId}/{port}/* → container
          └── Docker provider
                |
                └── Containers (ace-workspace)
                      ├── /workspace  — user code
                      ├── Goose CLI   — AI agent
                      └── Tunnel :59000 → any internal port

Preview Proxy (:8880)
    Routes {port}-{sessionId}.preview.{domain} → container via tunnel

Tech Stack

Layer Technologies
Frontend React 19, Vite 6, TypeScript, Tailwind CSS 4, xterm, Monaco Editor
Backend Go, chi, gorilla/websocket, Docker SDK, SQLite
Preview Proxy Go, stdlib only (zero dependencies)
Infrastructure Docker, Lima (macOS), Firecracker (Linux, planned)

Project Structure

├── services/
│   ├── api/              # Go backend (REST + WebSocket + proxy)
│   └── preview-proxy/    # Subdomain-based preview routing
├── packages/
│   ├── frontend/         # Vite + React SPA
│   └── shared/           # Shared TypeScript types
├── lima/                 # Lima VM config (macOS Firecracker host)
├── scripts/              # TLS cert generation for preview proxy
├── docker-compose.yml    # Full-stack local development
└── package.json          # npm workspaces root

Quick Start

Prerequisites

  • Go 1.24+
  • Node.js 22+
  • Docker

Setup

# Install frontend dependencies
npm install

# Configure environment
cp .env.example .env
# Edit .env — set at least one AI provider API key (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.)

Option A: Local Development

Runs the frontend dev server and Go backend directly:

npm run dev

This starts:

Option B: Docker Compose

Runs the full stack in containers (API + preview proxy):

docker compose up

Environment Variables

See .env.example for all options. Key sections:

Variable Default Description
COMPUTE_PROVIDER docker Container runtime (docker or firecracker)
AI_PROVIDER anthropic AI backend (anthropic, openai, gemini, ollama)
ANTHROPIC_API_KEY Anthropic API key (if using anthropic provider)
OPENAI_API_KEY OpenAI API key (if using openai provider)
GEMINI_API_KEY Google Gemini API key (if using gemini provider)
OLLAMA_BASE_URL http://host.docker.internal:11434/v1 Ollama endpoint (free, local)
AI_MODEL Override model name (uses provider default if empty)
PORT 4100 Backend listen port
CORS_ORIGIN http://localhost:4200 Allowed CORS origins
DATABASE_URL file:./ace.db SQLite database path
PREVIEW_PROXY_API_URL Preview proxy management API URL
PREVIEW_PROXY_API_KEY dev-secret Shared secret for proxy registration

Development

Run individual components:

# Frontend only
npm run dev:frontend

# Backend only
npm run dev:backend

# Backend via Lima VM (for Firecracker testing on macOS)
npm run dev:backend:lima

# Build everything
npm run build

See per-service docs:

Contributing

We welcome contributions. Please read CONTRIBUTING.md for the development workflow, coding conventions, and how to open a pull request.

Security

If you discover a security issue, please follow the disclosure process in SECURITY.md. Do not open public issues for security reports.

License

MIT © 2026 getufy

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors