Skip to main content

Development setup

Repository layout​

backend/ Go: Huma, pgx + sqlc, goose, client-go; PostgreSQL, Valkey
frontend/ Vue 3 + TypeScript + Vite single-page application
proto/ Control plane to worker contract (protobuf)
deploy/ Helm chart, Dockerfiles, local development stack
docs/ This site (Docusaurus)
scripts/ Developer scripts by purpose (test/, cluster/), not part of the product

AGENTS.md at the root states the conventions for code, comments and commits. Read it before a first change.

Tools​

Go (the version in backend/go.mod), a C compiler for sqlc, Node.js 22 with pnpm, Docker with Compose and Buildx, Helm, and make. Everything goes through the root Makefile; make help lists the targets.

The developer tools (buf, sqlc, golangci-lint) are pinned in backend/tools.mod; the Makefile runs them with go tool -modfile=tools.mod, so there is nothing else to install.

Run it locally​

make dev.up # PostgreSQL and Valkey in Docker, on 127.0.0.1:5432 and :6379
make backend.run # apply migrations, then the API server on :8080
make frontend.run # Vite dev server on :5173, proxying /v1 to :8080

Open http://localhost:5173. The first make backend.run creates the user admin and logs its generated password once (created the first administrator ... password=...). Set IDEKUBE_BOOTSTRAP_ADMIN_PASSWORD beforehand to choose it.

The API server serves interactive API documentation at http://127.0.0.1:8080/docs.

note

The API server does not drive any cluster; agents do. To run workspaces from a local backend, run the local worker's agent too:

make agent.run # the agent of the worker local, against your kubeconfig's current context

It creates StatefulSets and claims in your context's namespace, or IDEKUBE_NAMESPACE. Point your context at a disposable cluster such as minikube. Without an agent, workspaces stay in starting and their worker shows as offline.

To give the local backend deployment-level settings, write a YAML file keyed by section and set IDEKUBE_SETTINGS_FILE to its path. The other variables are listed under Process configuration.

make dev.down stops the two services and drops their data.

For the complete system, images and chart included, use make minikube.up.

Make targets​

TargetDoes
dev.up, dev.downStart, or stop and wipe, PostgreSQL and Valkey for development.
backend.runMigrate, then run the API server on :8080.
agent.runRun the agent of the worker local against the kubeconfig's current context.
frontend.runRun the web UI on :5173.
docs.runServe this site with live reload.
genRegenerate everything derived from proto/, the SQL and the API (gen.proto, gen.sql, gen.openapi, gen.client).
gen.checkRegenerate and fail when the committed files are stale.
fmtFormat the backend (gofmt, goimports) and the frontend (prettier).
lintLint the backend and the frontend, type-check the frontend, helm lint the chart.
testRun backend and frontend tests (GROUP=<name>, TIER=standard|extended, NOCACHE=1).
test.unitRun backend and frontend unit tests without PostgreSQL or Valkey (GROUP=<name>).
imagesBuild both images for this machine and load them into Docker.
images.pushBuild linux/amd64 and linux/arm64 images and push them to REGISTRY.
chartPackage the Helm chart into dist/.
docsBuild this site into docs/build.
minikube.up, minikube.downInstall into, or remove from, a local minikube.
minikube.servicesRun the development stand-ins of the services plugins talk to. See What plugins talk to.
minikube.accountsMake it hold the test accounts of e2e/accounts.yaml.
minikube.canvasRun a Canvas LMS for the Canvas plugin, with the test accounts' people and courses.
minikube.zitadelRun a Zitadel OIDC identity provider for the @zitadel end-to-end specs.
minikube.certsIssue the certificate of the minikube installation's own domain.
minikube.deleteDelete the minikube node and its network.
e2eRun the browser end-to-end suite against it.

VERSION defaults to git describe; REGISTRY defaults to ghcr.io/idekube-project.

Tests​

Tests across the backend, frontend and end-to-end suite are organized into subsystem groups defined in scripts/test/groups.json (core, auth, teams, templates, workspaces, network, cluster, workers, ops, plugins) and two tiers:

  • standard (default): high-signal, fast tests that cover core contracts, security boundaries, distributed invariants and zero-external-dependency unit tests.
  • extended: slower, heavier, secondary edge-case, DB/Valkey-backed unit tests, optional-plugin suites, and extra-infrastructure E2E specs.
make test # standard tier across all subsystems
make test TIER=extended # standard + extended across all subsystems
make test GROUP=auth # standard tests for one subsystem
make test GROUP=auth,teams TIER=extended
make test.unit GROUP=network # backend and frontend unit tests only, no PostgreSQL or Valkey needed

make test starts the development services, creates the database idekube_test if needed, and invokes scripts/test/run.sh, which runs go test -race (-short in standard, full in extended, plus -count=1 when NOCACHE=1) and vitest for the chosen group(s). Pull-request CI runs standard; pushes to main and make ci run extended with NOCACHE=1.

The tests in backend/tests/ run the assembled server against real PostgreSQL and Valkey, and replace the Kubernetes driver with a fake that converges instantly or reports what a test tells it to. No cluster is needed; IDEKUBE_TEST_DATABASE_URL and IDEKUBE_TEST_VALKEY_URL point them elsewhere. Every integration test in backend/tests/ carries its subsystem prefix (TestCore_, TestAuth_, TestWorkspaces_, etc.) and extended tests call extended(t); backend/archtest verifies that every backend, frontend and E2E test belongs to one declared subsystem.

They run in parallel, each on a platform of its own:

  • A database per test. The first test of a run migrates and sets up a template database, idekube_tpl_<digest>, named after the migrations and the test configuration; every test then gets a clone, which is dropped when it ends. Changing a migration builds a new template and drops the old one. The template and the clones are created from idekube_test, which itself stays empty.
  • A Valkey namespace per test, named after its database, so that keys, rate limits and pub/sub are its own.
  • Settings through the API. A section's value lives in the platform's settings store, and tests change it with PATCH /v1/settings/<section> (e.configure), as an administrator does.

Nothing a test does may rely on running alone: no package-level state, no fixed names in shared places. To narrow directly with go test:

cd backend && go test -short ./tests -run '^TestWorkers_'
cd backend && go test -short ./worker/...

Against a running installation, make e2e drives the platform in a browser and checks what lands in the cluster using the same GROUP and TIER controls; see Local cluster.

Before pushing​

make hooks # once: check each commit message as CI does
make ci # what main CI runs: gen.check, lint, full uncached extended tests and the docs

make lint holds the code to the rules of AGENTS.md that tools can check: golangci-lint with depguard and forbidigo for the backend's boundaries (no Kubernetes client outside worker/, no plugin named by the platform, no environment read outside core/config, every operation through api.Register), buf lint for the worker contract, eslint for the frontend's (no string a person reads outside vue-i18n, no colour outside the design tokens, no fetch outside src/api, Reka UI only in src/components/ui, where shadcn-vue's components are), and prettier. backend/archtest checks what no linter states: a module uses no other module's generated store and reads only the schema of the modules below it, every table has one writer, a plugin imports nothing of the worker contract, nothing is internal, migrations only expand, and every error code is listed; where the code breaks a rule today, the test lists the break as known and fails on any new one. On a pull request, CI also runs buf breaking against the branch it goes to and checks every commit's subject.

Generated code​

Four kinds of artifacts are generated and committed:

TargetFromTo
make gen.protoproto/backend/gen/
make gen.sqlthe migrations and each module's or plugin's queries.sqlbackend/modules/*/store/, backend/plugins/*/store/
make gen.openapiThe API operations and their types, the sidecar's toobackend/openapi.json, backend/sidecar.openapi.json
make gen.clientThose documents and the error codesfrontend/src/api/schema.ts, sidecar.d.ts, errorCodes.ts

Run make gen after touching proto/, a migration, a query, an API type or an operation, and commit the result. CI runs make gen.check and fails when the output is stale. Never edit the generated files, and never hand-write a request or response type in the frontend.