This commit captures the current state before implementing the composable monorepo template system. Key changes included: Infrastructure: - Add CockroachDB provisioner adapter for database provisioning - Add Redis provisioner adapter for cache provisioning - Add build events system with PostgreSQL storage - Add WebSocket endpoint for real-time build progress Code agent improvements: - Fix Claude Code adapter to use default allowed tools instead of dangerously-skip-permissions - Add context-aware stream closing for cancellation support - Improve parser tests for edge cases Build system: - Add build event constants and metrics - Remove deprecated git_operations.go (replaced by pod_git_operations.go) - Add rollback logic for multi-step provisioning operations Documentation: - Add composable-monorepo feature documentation - Add DNS/Cloudflare service documentation - Update deployment and troubleshooting guides Cookbooks: - Add fullstack-app cookbook - Refactor landing-test with shared library Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3.7 KiB
3.7 KiB
Composable Monorepo Templates
Last Updated: 2026-01-30 Confidence: High (Planned)
Summary
Composable Monorepo Templates evolve rdev's project scaffolding from single templates to full monorepo architecture. Every project starts as a monorepo skeleton, with components (services, workers, apps, cli) added via API calls. Deployment can target the whole monorepo or individual components.
Key Facts:
POST /projectscreates monorepo skeleton (not single template)POST /projects/{id}/componentsadds services/workers/apps/cli- Convention-based discovery:
services/*/,workers/*/,apps/*/,cli/*/ - Optional
component.yamlper component for ports, dependencies, build order - Shared
pkg/from Aeries chassis + Colix patterns (8 packages) - Deployment supports whole-monorepo or individual-component targets
File Pointers:
- Plan:
tmp/template-monorepo-plan.md - Current templates:
internal/adapter/templates/templates/ - Port:
internal/port/template_provider.go
How It Works
Project Creation Flow
POST /projects {"name": "acme"}
↓
Creates monorepo skeleton:
- CLAUDE.md, README.md, Procfile
- docker-compose.yml, go.work, .golangci.yml
- scripts/ (discover, install, quality, dev)
- pkg/ (8 shared packages from Aeries + Colix)
- .claude/ (guides, skills, commands)
Component Addition Flow
POST /projects/acme/components {"type": "service", "name": "auth-api"}
↓
Creates services/auth-api/:
- cmd/server/main.go
- internal/, Makefile, Dockerfile
- component.yaml (port, deps)
↓
Auto-updates:
- Procfile (add service entry)
- go.work (add module)
- CLAUDE.md (add routing)
Monorepo Structure
acme/
├── CLAUDE.md # AI router
├── Procfile # Local dev (auto-updated)
├── docker-compose.yml # Local services
├── go.work # Go workspace (auto-updated)
├── scripts/ # Discovery scripts
├── pkg/ # Shared packages (8 total)
├── services/auth-api/ # Go API component
├── workers/email-worker/ # Background worker component
├── apps/dashboard/ # Frontend component
└── cli/acme-cli/ # CLI tool component
Shared Packages (pkg/)
Combines best patterns from Aeries (chassis) and Colix (modular):
| Package | Source | Purpose |
|---|---|---|
app/ |
Aeries chassis | Service bootstrapper |
middleware/ |
Colix | HTTP middleware (CORS, recovery, request_id, logger) |
httpcontext/ |
Colix | Type-safe context helpers |
httpresponse/ |
Aeries+Colix | JSON helpers + envelope pattern |
httpvalidation/ |
Colix | Request validation |
logging/ |
Both | Structured logging (slog + env detection) |
config/ |
Aeries | Configuration via viper |
httpclient/ |
Both | Resilient HTTP client with retry |
Component Types
| Type | Directory | Template | Identifier |
|---|---|---|---|
| Service | services/ |
go-api | Makefile or go.mod |
| Worker | workers/ |
worker | Makefile or go.mod |
| App | apps/ |
app-astro, app-react | package.json |
| CLI | cli/ |
cli | Makefile or go.mod |
Template Migration
| Current Template | New Location | Component Type |
|---|---|---|
go-api |
components/service/ |
services/* |
astro-landing |
components/app-astro/ |
apps/* |
default |
Becomes skeleton | N/A |
Related Topics
- Template Provider - Current template system
- Project Service - Project lifecycle
- Build Orchestration - Component builds