Skip to content

Level 2: Containers ​

The processes and data stores inside Hevkar, as deployed by infra/docker-compose.yml. The three browser apps are shown as containers only; they are not detailed further.

Containers ​

ContainerTechnologyResponsibility
CaddyCaddy 2The only container with public ports. TLS, CSP / HSTS / frame-ancestors headers, one host each for api, console, ops, docs and the S3 endpoint (signed downloads). Sends the realtime WebSocket path to api-realtime.
consoleReact, Vite, TanStack Router/Query, shadcn/uiCustomer console. Frontend, not detailed here.
opssame stackSuper-admin console on its own host. Frontend, not detailed here.
docsVitePressThis site. Frontend, not detailed here.
apiNode.js, NestJS 12, Drizzle, Vercel AI SDKnode dist/main.js. Console API (/console, session + org guards), public API (/v1, API-key guard, rate limits), super-admin API (/ops). Runs sync and streaming (SSE) agent runs in process, enqueues async runs, workflow steps, ingestion and webhook deliveries. Mounts better-auth.
api-realtimesame image as apiSame command as api; Caddy sends only WS /v1/realtime here, so long-lived voice sockets scale and restart separately from request traffic. Bridges client audio to the realtime provider and meters it.
workersame image, node dist/main.js workerBoots the same module graph without HTTP (QUEUE_ROLE=worker), so feature modules register their BullMQ processors. Queues: runs, workflows, ingestion, webhooks, files. Repeating jobs: scheduled data source syncs, workflow recovery, hourly file expiry. Scales independently of api.
migratesame image, node dist/db/migrate.jsOne-shot: applies pending Drizzle migrations (tables, RLS policies, grants) as the owner role; api and worker start after it succeeds.
doc-workerPython, FastAPI, Docling, Tesseract, pdfiumInternal only (bearer token required in production). /parse, /chunk, /parse-and-chunk, /render-pages, /extract-url. Layout-aware parsing of PDF, DOCX, PPTX, HTML; OCR for scans; page rendering for vision models. Holds no tenant data. Only container besides api/worker with outbound web access.
PostgresPostgres 17 + pgvectorSystem of record. Tenant tables carry org_id with row-level security on app.org_id (the app role cannot bypass it). Chunks with HNSW vector indexes plus full-text search for hybrid retrieval. better-auth tables in the same schema.
RedisRedisBullMQ queues and job schedulers, sliding-window /v1 rate limits (fail open, logged), run cancellation flags polled by running runs.
SeaweedFSSeaweedFS (S3 API)Object storage for uploaded run inputs and data source documents. Clients download through short-lived signed URLs served via Caddy. storage-init creates the bucket at start.

Networks ​

Compose splits traffic into networks: backend (api, worker, migrate, doc-worker and the data stores), frontend (Caddy, the browser apps and api / api-realtime / worker, which also gives api and worker their outbound access), files (Caddy to SeaweedFS for signed downloads) and doc-worker-egress (doc-worker's outbound access for /extract-url).

Observability (optional overlay) ​

infra/docker-compose.observability.yml adds an OpenTelemetry collector, Prometheus, Loki, Tempo and Grafana. api, api-realtime and worker export traces and metrics to the collector; logs are pino JSON.

Previous: Level 1: System context. Next: Level 3: Components.

Hevkar public API v1