Shared local development infrastructure for Kiven. Manages Docker Compose, kind, CNPG, and Tilt. Service repos live as sibling directories.
# 1. Clone
git clone git@github.com:kivenio/kiven-dev.git
cd kiven-dev
# 2. Init (installs mise, tools, git hooks, checks Docker)
task init
# 3. Clone all service repos
task repos:clone
# 4. Start everything
task dev
tilt upcd kiven-dev
task dev # Start infra + kind + CNPG
tilt up # Start all services (auto-reload on code changes)
# Code in any sibling repo → Tilt rebuilds automatically
# Dashboard: http://localhost:3000
# API: http://localhost:8080
# Tilt UI: http://localhost:10350
tilt down # Stop services
task dev:stop # Stop everything~/workshops/kivenio/
├── kiven-dev/ ← THIS REPO (shared infra + orchestration)
│ ├── deploy/
│ │ ├── docker-compose.yml ← PostgreSQL, Redpanda, Valkey, MinIO
│ │ ├── seed.sql ← Dev seed data (org, user)
│ │ └── kind/ ← kind cluster + CNPG test cluster
│ ├── migrations/ ← Database migrations (golang-migrate)
│ │ ├── 000001_initial_schema.up.sql
│ │ ├── 000001_initial_schema.down.sql
│ │ └── ...
│ ├── templates/ ← Template files for new service repos
│ ├── Tiltfile ← Orchestrates all services
│ ├── Taskfile.yml ← task init, task dev, task infra:up...
│ └── .mise.toml ← Shared tool versions + env vars
│
├── svc-api/ ← Service repos (each has task init + task run)
├── svc-agent-relay/
├── svc-provisioner/
├── kiven-agent/
├── provider-cnpg/
├── kiven-go-sdk/
├── dashboard/
└── ...
When you cd into this repo (with mise shell hook):
- mise auto-activates: tools are available, env vars set
- First time: run
task initto bootstrap everything
Each service repo has the same pattern:
cd ../svc-api
task init # mise trust + install + go mod download + git hooks
task run # Start the service
task test # Run teststask --list # See all tasks
# Init & Setup
task init # First time: mise + tools + hooks + Docker check
task repos:clone # Clone all service repos as siblings
task repos:status # Git status of all repos
# Infrastructure
task infra:up # Start Docker Compose (PG, Kafka, Valkey, MinIO)
task infra:down # Stop Docker Compose
task infra:reset # Stop + delete all data
# Kubernetes
task kind:create # Create kind cluster + CNPG operator
task kind:delete # Delete kind cluster
task cnpg:deploy # Deploy test PostgreSQL cluster
task cnpg:status # Check CNPG status
task cnpg:connect # Port-forward to test PG
# Services (from sibling repos)
task svc:api # Run svc-api
task svc:relay # Run svc-agent-relay
task svc:provisioner # Run svc-provisioner
task agent # Run kiven-agent
task frontend # Run dashboard
# Database Migrations
task db:migrate # Run all pending migrations
task db:rollback # Rollback the last migration
task db:status # Show current migration version
task db:create NAME=... # Create a new migration
task db:seed # Insert local dev seed data
task db:reset # Drop everything, re-migrate, re-seed
# Database Connect
task psql # Connect to Kiven product DB
task psql:cnpg # Connect to test CNPG cluster
# Dev lifecycle
task dev # Start everything (infra + kind + CNPG)
task dev:stop # Stop everythingSchema is managed by golang-migrate. Migrations live in migrations/ and run automatically when Docker Compose starts.
task db:create NAME=add_user_avatar
# Creates:
# migrations/000003_add_user_avatar.up.sql
# migrations/000003_add_user_avatar.down.sqlEdit both files — the .up.sql applies the change, the .down.sql reverses it. Wrap DDL in BEGIN; ... COMMIT; for atomicity.
# Docker Compose runs migrations automatically on `task infra:up`
# To run manually against a running database:
task db:migrate # Apply all pending
task db:rollback # Undo the last one
task db:status # Show current version
task db:reset # Nuclear option: drop everything, re-migrate, re-seed- Never edit a migration that has been applied — create a new one instead
- Every
.up.sqlmust have a matching.down.sql— rollbacks must work - Wrap DDL in transactions —
BEGIN; ... COMMIT;so failures don't leave dirty state - Service plans seed data lives in migration 001 (needed in all environments)
- Dev seed data (test org/user) lives in
deploy/seed.sql(local dev only)
templates/ contains complete starter configs for all repo types. See templates/README.md.
task scaffold:service NAME=svc-foo # Scaffold a new Go service
task scaffold:sdk NAME=kiven-foo # Scaffold a new Go SDK/libraryTemplates include: .editorconfig, .mise.toml, Taskfile.yml, .golangci.yml, .pre-commit-config.yaml, .vscode/, .github/workflows/ci.yml, Dockerfile, .air.toml.
.github/workflows/ contains reusable GitHub Actions workflows:
ci-go-reusable.yml— Go: lint, test, build, security, Dockerci-terraform-reusable.yml— Terraform: fmt, validate, lint, Trivy, Checkovci-frontend-reusable.yml— Frontend: lint, type check, test, builddocker-build-reusable.yml— Build & push Docker image to GHCR