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.
Dockerised development
Section titled “Dockerised development”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.
supervisorctl status # see all servicescd frontend && npm run dev # start the frontendTest pyramid
Section titled “Test pyramid”The project enforces testing at four levels, each catching different classes of bugs:
Unit tests (fast, isolated)
Section titled “Unit tests (fast, isolated)”- 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.
Integration tests (services + database)
Section titled “Integration tests (services + database)”- 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.
E2E tests (browser automation)
Section titled “E2E tests (browser automation)”- 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.
Smoke tests (production-like)
Section titled “Smoke tests (production-like)”- 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).
Pre-commit hooks
Section titled “Pre-commit hooks”The pre-commit hook runs 8 checks. You cannot push until all pass:
deno lint: backend lintingdeno task check: backend type-checking (56 files)deno task test: backend unit testsnpx @biomejs/biome check src/: frontend lintingtsc --noEmit: frontend type-checkingvitest run: frontend unit tests- Smoke tests (if services are running locally)
- Integration tests (if services are running locally)
Code conventions
Section titled “Code conventions”- 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/httpnot../lib/http.ts - Conventional commits:
feat(risk):,fix(ci):,refactor:,docs: