Infrastructure Overview
Docker services for shared infrastructure, local process runners for applications
tx-agent-kit splits infrastructure into two layers: shared services managed by Docker Compose, and application processes run as local Node.js processes during development.
Shared infrastructure (Docker)
All backing services run inside Docker containers through a single docker-compose.yml with the infra profile. These services are shared across all git worktrees.
| Service | Port | Purpose |
|---|---|---|
| PostgreSQL | 5432 | Application database |
| Redis | 6379 | Caching and session state |
| OTEL Collector | 4318 (HTTP), 4317 (gRPC) | Telemetry signal routing |
| Jaeger | 16686 | Distributed trace viewer |
| Prometheus | 9090 | Metrics storage and querying |
| Grafana | 3001 | Dashboards and visualization |
| Loki | 3100 | Log aggregation |
The pnpm infra:ensure command starts all services idempotently. If they are already running, it exits immediately. Services are health-checked before the command returns.
Temporal runtime is managed separately:
- Local:
pnpm temporal:dev:upstarts host Temporal CLI (TEMPORAL_RUNTIME_MODE=cli). - Deployed environments:
TEMPORAL_RUNTIME_MODE=cloudwith Temporal Cloud address/namespace/API key.
Application processes (local Node.js)
During development, applications run as local Node.js processes managed by Turborepo.
| Application | Package | Description | Port |
|---|---|---|---|
| API | apps/api | Effect HTTP server | 4000 |
| Web | apps/web | Next.js dev server | 3000 |
| Worker | apps/worker | Temporal worker process | n/a |
| Mobile | apps/mobile | Expo development server | 8081 |
This split is intentional. Infrastructure services are long-lived and shared; application code changes frequently and benefits from fast local reload.
Why not Docker for everything?
Running applications inside containers during development adds friction: slower rebuilds, volume mount overhead, and debugging complexity. By keeping infra in Docker and apps as local processes, you get the reliability of containerized services with the speed of native Node.js hot-reload.
In staging and production, applications are deployed as container images. The deploy:build-images script builds immutable images for api and worker. See Deployment for details.
Quick start
# Configure local environment variables
pnpm env:configure
# Start Docker infrastructure
pnpm infra:ensure
# Start local Temporal runtime
pnpm temporal:dev:up
# Run database migrations
pnpm db:migrate
# Start all applications
pnpm devRelated pages
| Page | Description |
|---|---|
| Docker Stack | Service configuration details |
| Local Development | Full development workflow |
| Worktrees | Parallel development with git worktrees |
| Secrets Management | 1Password CLI integration |