cvm-server
Effect v4 HTTP service backing the portal's /cvm clip recording, transcription, and rendering feature.
Overview
cvm-server is a standalone Effect v4 HTTP service paired with the
portal app's /cvm feature. It currently ships stub endpoints so the
front-end recording -> upload path can be exercised end-to-end before the
heavy lifting (FFmpeg concat/silencedetect, OpenAI Whisper,
@remotion/renderer) is wired in. It is for engineers building out the
video-clip-capture pipeline, not an end-user-facing surface.
All request/response payload schemas live in @repo/cvm-domain/rpc, so the portal client and
this server share one contract.
Stack
- Effect v4 (
effect,@effect/platform-node) for the HTTP server and layering @repo/cvm-domainfor shared RPC payload schemas@repo/telemetryand@repo/utilsworkspace packagestsxfor dev/run,vitestfor tests- TypeScript, run via
tsc --noEmit --incremental
Develop
pnpm --filter cvm-server dev # http://localhost:3032
pnpm --filter portal dev # proxies /cvm-api/* → :3032Endpoints (stub behavior today):
GET /health—{ ok: true, service: "cvm-server" }POST /clips/upload— decodesCvmRpc.UploadClipPayload, writes/tmp/cvm/<id>.webmPOST /transcribe— decodesCvmRpc.TranscribePayload, returns{ status: "queued" }POST /render— decodesCvmRpc.RenderClipPayload, returns{ status: "queued" }
Test
pnpm --filter cvm-server test # vitest
pnpm --filter cvm-server test:ci # vitest run w/ junit reportersrc/__tests__/http.unit.test.ts is currently a smoke import; spinning the
server on an ephemeral port for full RPC round-trips is planned next.
Build & deploy
Internal / not separately deployed. It runs as a plain Node process
(pnpm --filter cvm-server start, tsx --import src/main.ts) alongside
portal in development; there is no dedicated build script or hosting
target yet.
Structure
src/main.ts— server entry point, layer composition (HealthRoute+UploadClipRoute+TranscribeRoute+RenderRoute->StorageService.layer->NodeHttpServer.layer)src/__tests__/— vitest smoke tests
See the apps overview and the monorepo overview.