Skip to main content

Development Setup

This guide covers IDE configuration, pre-commit hooks, environment variables, Docker services, and the full set of Makefile commands for day-to-day development.

IDE Recommendations​

VS Code​

Recommended extensions:

  • Go (golang.go) -- Go language support, debugging, and test runner
  • ESLint (dbaeumer.vscode-eslint) -- JavaScript/TypeScript linting
  • Prettier (esbenp.prettier-vscode) -- Code formatting
  • Tailwind CSS IntelliSense (bradlc.vscode-tailwindcss) -- Tailwind class autocomplete
  • EditorConfig (editorconfig.editorconfig) -- Consistent editor settings

GoLand / WebStorm​

JetBrains IDEs have built-in support for Go, TypeScript, and ESLint. Enable the following:

  • Go modules integration (enabled by default)
  • ESLint -- Settings > Languages & Frameworks > JavaScript > Code Quality Tools > ESLint > Automatic Configuration
  • Prettier -- Settings > Languages & Frameworks > JavaScript > Prettier > On save
  • File Watchers for gofmt on save

Pre-commit Hooks​

The project uses pre-commit to run checks before every commit. Install the hooks after cloning:

pip install pre-commit
pre-commit install

The hooks defined in .pre-commit-config.yaml include:

HookScopeWhat it does
gofmtagent/, backend/Formats Go source files
golangci-lintagent/, backend/Runs the full Go linter suite
eslintfrontend/src/Lints TypeScript/TSX. Reports only — it does not pass --fix, unlike the prettier hook below.
prettier --writefrontend/src/Formats TypeScript, TSX, and CSS files
swagger-validatebackend/docs/swagger.*Validates swagger spec is well-formed Swagger 2.0
swagger-freshnessbackend/internal/**.goVerifies the swagger spec is up to date with annotations
check-yamlAll filesValidates YAML syntax
check-jsonAll filesValidates JSON syntax
check-merge-conflictAll filesDetects leftover merge conflict markers
detect-private-keyAll filesPrevents accidental commit of private keys
changelog-checkcommit-msgEnsures CHANGELOG.md is updated for the commit

Environment Variables​

Copy .env.example to .env and adjust values as needed:

cp .env.example .env

Key Variables​

VariableDefaultDescription
PROXIMA_DB_URLpostgres://proxima:proxima_dev@localhost:5432/proxima?sslmode=disablePostgreSQL connection string
PROXIMA_NATS_URLnats://localhost:4222NATS server address
PROXIMA_SERVER_PORT8080Backend HTTP port
PROXIMA_INSTALL_TOKEN—One-time install token for agent enrollment (generate via API)
PROXIMA_LOG_LEVELdebugLog verbosity (debug, info, warn, error)
PROXIMA_CORS_ORIGINShttp://localhost:5173Allowed CORS origins
PROXIMA_CLIENT_SLUGinternalClient identifier for the agent
PROXIMA_ENVIRONMENT_SLUGdevelopmentEnvironment identifier for the agent
VITE_API_BASE_URLhttp://localhost:8080/api/v1Frontend API base URL

OpenTelemetry (Optional)​

Tracing is disabled by default. To enable it, uncomment these variables in .env:

PROXIMA_OTEL_ENABLED=true
PROXIMA_OTEL_EXPORTER_ENDPOINT=localhost:4317
PROXIMA_OTEL_SERVICE_NAME=proxima-backend

Docker Services​

make docker-up starts the following containers via Docker Compose:

ServiceContainer NameImagePorts
PostgreSQL 18proxima-postgrespgvector/pgvector:pg185432
NATS + JetStreamproxima-natsnats:2.10-alpine4222 (client), 8222 (HTTP monitor)
Vaultproxima-vaulthashicorp/vault:1.188200 (API/UI, localhost only)
Valkeyproxima-valkeyvalkey/valkey:8-alpine6379
Tempoproxima-tempografana/tempo:2.7.23200 (HTTP API), 4317 (OTLP gRPC), 4318 (OTLP HTTP)
VictoriaMetrics (vmstorage)proxima-vmstoragevictoriametrics/vmstorage:v1.136.0-cluster8482 (API), 8400 (insert), 8401 (select)
VictoriaMetrics (vminsert)proxima-vminsertvictoriametrics/vminsert:v1.136.0-cluster8480
VictoriaMetrics (vmselect)proxima-vmselectvictoriametrics/vmselect:v1.136.0-cluster8481

Data is persisted in Docker volumes (proxima-pg-data, proxima-nats-data, proxima-vm-data, proxima-vault-data), so it survives docker compose down. To fully reset data, remove the volumes:

docker compose down -v

First-Time Vault & NATS JWT Setup​

After starting Docker services for the first time, initialize Vault and generate NATS JWT credentials:

# 1. Initialize Vault (operator init + unseal + PKI + KV + AppRole)
# Saves unseal key and root token to infra/vault/.vault-keys
make vault-init

# 2. Generate NATS operator/account JWTs and backend credentials
make nats-jwt-init

# 3. Issue NATS TLS server certificate from Vault PKI
make nats-cert-issue

# 4. Add Vault credentials to your .env file
# (vault-init prints VAULT_ROLE_ID and VAULT_SECRET_ID)

On subsequent runs, Vault auto-unseals using the saved key. You only need to re-run these steps if you reset the Vault volume.

Running without Vault

make nats-jwt-init is not Vault-only. With --keystore=disk (or PROXIMA_KEYSTORE=disk in the environment) it persists the operator and account nkey seeds on the keys volume and constructs no Vault client, so a rig without Vault can still stand up NATS JWT mode:

PROXIMA_KEYS_DIR=/absolute/path/to/keys \
sh -c 'cd backend && go run ./cmd/nats-jwt-init --keystore=disk'

Give PROXIMA_KEYS_DIR an absolute path: this tool runs from backend/ and the server runs from the repo root, so the relative default ./keys would put the seeds in backend/keys/ where the server never looks.

Steps 1 and 4 above then do not apply, and Step 3 needs the NATS server certificate from somewhere other than Vault PKI. See Disk Keystore for creating the keys volume.

Useful URLs​

URLDescription
http://localhost:8080Backend API
http://localhost:8080/healthzLiveness probe
http://localhost:8080/readyzReadiness probe
http://localhost:5173Frontend (Vite dev server)
http://localhost:8222NATS HTTP monitoring
http://localhost:8200/uiVault UI
http://localhost:3004Grafana (Tempo tracing datasource)

Makefile Commands​

The Makefile in the project root provides all standard development commands. Run make help to see them all.

CommandDescription
make helpShow all available commands
make buildBuild agent, backend, and frontend
make build-agentBuild the agent binary
make build-backendBuild the backend binary
make build-frontendBuild frontend static files
make testRun all tests (agent + backend + frontend)
make test-raceRun Go tests with the race detector
make test-integrationRun integration tests. Each run clones proxima_test_template into a throwaway proxima_test_run_<pid>_<rand> database and drops it afterwards, so runs never collide.
make test-e2eBuild locally, then run the E2E suite (BATS and Playwright) on the remote E2E server over SSH. Use make test-e2e-ci for a purely local BATS run.
make test-db-setupCreate proxima_test database, run migrations, seed
make test-db-resetDrop and recreate proxima_test from scratch
make test-coverageRun tests with coverage reports
make lintRun all linters (Go + frontend)
make lint-goRun golangci-lint on agent and backend
make lint-frontendRun ESLint and Prettier on frontend
make run-backendStart the backend server
make run-agentStart the agent
make run-frontendStart the frontend dev server
make docker-upStart PostgreSQL, NATS, VictoriaMetrics, Tempo, and Grafana containers
make docker-downStop all Docker containers
make docker-logsTail Docker service logs
make migrate-upApply all pending database migrations
make migrate-downRoll back the last migration
make migrate-createCreate a new migration (usage: make migrate-create name=add_users)
make migrate-statusShow current migration version
make seedSeed development data (clients, environments)
make vault-initInitialize Vault (operator init, unseal, PKI, AppRole)
make nats-jwt-initGenerate NATS operator/account JWTs and credentials
make nats-cert-issueIssue NATS TLS server certificate from Vault PKI
make swaggerGenerate Swagger/OpenAPI docs
make swagger-validateValidate swagger spec is well-formed
make swagger-checkVerify swagger spec is up to date with annotations
make cleanRemove build artifacts