TxLoomTxLoom
Home
  • What is TxLoom?
  • How It Works
  • Features
  • Screenshots
  • Demo Videos
  • Installation Guide
  • Configuration
  • Scenario Spec
  • Under the Hood
Home
  • What is TxLoom?
  • How It Works
  • Features
  • Screenshots
  • Demo Videos
  • Installation Guide
  • Configuration
  • Scenario Spec
  • Under the Hood
  • Under the Hood

    • Architecture
    • Technical Stack
    • Generation Engine
    • Sinks & Wire Format
    • Agent Authoring
    • Agent Reference
    • Extending TxLoom

Technical Stack

TxLoom is TypeScript end to end, organized as a pnpm workspace.

Repository Layout

PathContents
apps/apiFastify REST API, WebSocket, MCP endpoint, migrations
apps/workerBullMQ job consumers and the generation thread pool
apps/webReact studio
apps/clitxloom command-line client
apps/e2ePlaywright end-to-end suite
packages/specSpec types, JSON Schema, invariants
packages/engineSimulation engine
packages/sinksFile and broker sinks, delivery pump
packages/agent-toolsMCP tool definitions and authoring docs
benchmarksBatch generation and Kafka benchmarks, plus an install smoke test
analytics, analytics-flinkOptional downstream analytics stacks (see Infrastructure)
documentationThis documentation site

Backend

ComponentTechnologyNotes
LanguageTypeScript 5Strict mode
RuntimeNode.js 22+
Web frameworkFastify 5REST, static hosting, WebSocket via @fastify/websocket
Job queueBullMQ 5On Redis
Thread poolPiscinaworker_threads for CPU-bound generation
DatabaseMySQL 8.4Scenarios, versions, run metadata, connections
Query builderKnex 3Migrations and queries, no ORM
Queue backendRedis 7
ValidationAjv 8JSON Schema for specs and connection bodies
Analytical queriesDuckDBQueries run output Parquet files for the ground-truth views
MCP@modelcontextprotocol/sdkStreamable HTTP transport

Why BullMQ and Worker Threads

Generation is split into partitions of the consumer population. Each partition is one job, so a failed partition is retried on its own and a crashed run resumes where it stopped. Inside the worker, partitions run in a thread pool, which keeps CPU-bound work off the event loop.

The pool is bounded by both CPU and memory: min(cores − 1, 0.6 × RAM in GiB), with a minimum of one thread. At a budget of about 1 GiB per thread, concurrent partitions never use more than about 60% of the machine's memory. Set TXLOOM_MAX_WORKER_THREADS to override the computed size.

Why Files for Event Data

A reference-scale run is tens of millions of events. Writing them as Parquet files per partition keeps generation fast and memory flat, keeps MySQL small, and makes a run's output a plain folder that can be copied or deleted.

Why No ORM

The relational data is small and simple. Knex gives explicit SQL and migrations without a mapping layer.

Engine

ComponentTechnologyNotes
Random numberspure-randxoroshiro128+, seeded from the full 64-bit seed
Distributionsd3-randomLognormal, normal, exponential, driven by the seeded generator
Event IDsULIDDerived deterministically from the seeded generator and virtual clock

Sinks

ComponentTechnologyNotes
Kafka@confluentinc/kafka-javascriptlibrdkafka-based producer
RabbitMQamqplibConfirm channels
WebhookNode fetchJSON POST
Parquet@dsnp/parquetjsIncremental writers; the format for run output
CSV, JSONBuilt-in writersExport formats alongside Parquet

Frontend

ComponentTechnologyNotes
UI frameworkReact 18
Build toolVite
RoutingReact Router 7
StylingTailwind CSS 4
ComponentsRadix UI primitives, Lucide icons
Spec editorMonacoJSON Schema autocomplete and inline markers
ChartsRecharts
Real-timeNative WebSocketRun progress and stream metrics

Command-Line Client

The txloom CLI has no runtime dependencies. It calls the REST API with Node's built-in fetch.

Testing and Quality

LayerTechnologyNotes
Unit, contract, componentVitest
Property testsfast-checkFor engine invariants such as achieved fraud rate
Golden masterVitestPins engine output for a reference spec and seed
IntegrationTestcontainersReal MySQL, Redis, Kafka and RabbitMQ
End to endPlaywrightBlack-box suite against a real stack
PerformanceSmoke benchmarksKafka and batch generation, checked against a committed baseline
Lint and formatESLint, PrettierLint rules forbid wall-clock reads and Math.random in the engine

Infrastructure

ComponentTechnology
PackagingDocker images for api and worker
OrchestrationDocker Compose, with an optional demo-brokers profile
Package managerpnpm 9 workspaces
CIGitHub Actions
DocumentationVuePress 2, deployed to GitHub Pages

Compose Profiles

The demo-brokers profile adds a local Kafka 3.9 broker and Redpanda Console for browsing topics. RabbitMQ is not part of the profile. To try the RabbitMQ sink, point a connection at your own broker.

CI Gates

The CI workflow runs these gates as parallel jobs:

  • Static checks: typecheck, lint and format.
  • Unit, contract and component tests, including the golden master.
  • Integration tests on Testcontainers.
  • Kafka and batch generation smoke benchmarks, which fail on a regression against the baseline.
  • The Playwright end-to-end suite.

Analytics Stacks

Two optional Compose files add downstream analytics. Each runs on top of docker-compose.yml and consumes the demo-brokers Kafka broker.

FileStack
docker-compose-analytics.yamlKafka → ClickHouse 25.8 → Grafana 12
docker-compose-flink.yamlKafka → Flink 2.2 jobs → ClickHouse, with MinIO, Prometheus and Grafana

See analytics/README.md and analytics-flink/README.md for setup and dashboards.

Prev
Architecture
Next
Generation Engine