Development Setup¶
Prerequisites¶
- Go 1.26+
- Node.js 20+
- npm
Clone and Setup¶
Build CLI¶
Initialize Database¶
VisionStudio uses Dolt (MySQL-compatible) for persistent storage:
Install Frontend Dependencies¶
Regenerate Types¶
After modifying Go API types in pkg/apitypes/types.go:
# Generate JSON schemas from Go types
go generate ./pkg/apitypes
# Generate Zod/TypeScript from JSON schemas
cd web && npm run generate:types
See Type Pipeline for details.
Development Workflow¶
Unified Dashboard (Recommended)¶
Run the Go daemon with embedded frontend:
Open http://127.0.0.1:9401 in your browser.
Frontend Hot Reload¶
For frontend development with hot reload:
Terminal 1: Go API Server
Terminal 2: Vite Dev Server
Open http://localhost:5173 (Vite proxies API calls to port 9401).
Hot Reload¶
- Frontend: Vite provides instant hot reload
- Go Daemon: Restart manually after changes
Building for Production¶
# Build CLI
go build -o bin/visionstudio ./cmd/visionstudio
# Build frontend (embedded in unified mode)
cd web
npm run build
Running Tests¶
Common Tasks¶
| Task | Command |
|---|---|
| Run dashboard | go run ./cmd/visionstudio dashboard --port 9401 --unified |
| Initialize DB | go run ./cmd/visionstudio db init --migrate |
| Regenerate Go→TS types | go generate ./pkg/apitypes && cd web && npm run generate:types |
| Lint | golangci-lint run |
| Test | go test ./... |