Skip to content

Coding Approach

VETA runs the entire platform inside a Docker-based Dev Container so every developer starts with the same environment. Every change goes through automated testing at four levels before it can reach production.

The repository ships a .devcontainer/devcontainer.json that configures VS Code (or JetBrains) to build and run the full platform inside a container. This includes:

  • Deno 2.7 for all backend services
  • Node 24 for the React frontend
  • PostgreSQL 16 for journal, user, and replay data
  • Redpanda (Kafka-compatible) for the message bus
  • Supervisord managing 30+ microservices

When you open the repository in VS Code and accept "Reopen in Container", you get a functional trading platform with zero local setup. The MOTD shows available commands.

Terminal window
supervisorctl status # see all services
cd frontend && npm run dev # start the frontend

The project enforces testing at four levels, each catching different classes of bugs:

  • Backend: 782 tests across 68 files via deno task test. Pure function tests for OMS validation, algo slicing, FIX parsing, analytics maths, grid filtering.
  • Frontend: 2019 tests across 174 files via Vitest. Redux slices, React components, panel registry, layout models, ticket resolution rules, hooks.
  • Coverage: v8 provider via Vitest; backend via Deno --coverage. Coverage badge auto-updated on every push to main.

See Testing for the full breakdown and current counts.

  • 7 test files (105 cases) run against the full service stack with PostgreSQL and Redpanda; a further 20 files (221 cases) run the same suites via testcontainers.
  • Test real order flow: submit via WebSocket, OMS validates, algo routes, EMS fills, journal persists.
  • Each algo strategy verified: LIMIT, TWAP, POV, VWAP, ICEBERG, SNIPER, ARRIVAL_PRICE, IS, MOMENTUM.
  • Intelligence pipeline: feature engine, signal engine, recommendation engine.
  • Journal and market-data HTTP contract tests.
  • 19 Playwright spec files running headless Chromium against the Vite dev server.
  • GatewayMock intercepts WebSocket and HTTP to test frontend behaviour without real services.
  • Auth flows, order submission, market data rendering, fixed income panels, algo order lifecycle, session replay, observability layouts.
  • Page object pattern: AppPage, OrderTicketPage, OrderBlotterPage, MarketLadderPage.
  • 5 end-user-flow assertions gate every deploy; the backend testcontainers smoke suite (smoke.full.tc.test.ts) covers 65 end-to-end checks against an ephemeral stack in CI.
  • Health checks for all backend services.
  • Full OAuth login flow with browser-style headers.
  • Order lifecycle: submit, then fill or expire within timeout.
  • Risk-engine CRUD: create session, upload chunks, query events, delete.
  • Disk usage assertion: fail if >95% full (prevents the disk-fill incident from recurring).

The pre-commit hook runs 8 checks. You cannot push until all pass:

  1. deno lint: backend linting
  2. deno task check: backend type-checking (56 files)
  3. deno task test: backend unit tests
  4. npx @biomejs/biome check src/: frontend linting
  5. tsc --noEmit: frontend type-checking
  6. vitest run: frontend unit tests
  7. Smoke tests (if services are running locally)
  8. Integration tests (if services are running locally)
  • TypeScript everywhere: Deno for backend, Vite + React for frontend
  • No comments: code should be self-documenting
  • Functional where possible: pure functions over mutable module state
  • Single source of truth: shared types in @veta/types/*, shared utilities in @veta/*
  • Import map aliases: @veta/http not ../lib/http.ts
  • Conventional commits: feat(risk):, fix(ci):, refactor:, docs: