Metanow Docs
Contributing

Deployment

Environment variables, infrastructure, and the Turbo build pipeline.

Infrastructure requirements

ServiceNotes
PostgreSQL 15+Must have the pgvector extension. Get from: Railway, Supabase, or self-hosted.
RedisUsed by BullMQ job queues. Get from: Railway Dashboard → Redis service → Connect.
Hetzner Object StorageS3-compatible. Used for brief export files (PDF, PNG). Get from: Hetzner Console → Object Storage → Access Keys.
StripeUsed for subscription management and webhook handling. Get from: dashboard.stripe.com → Developers.
AI providerAnthropic or Gemini API key. At least one required.
OpenAIRequired for embedding generation (text-embedding-3-small).

Build

pnpm build

Turbo builds all apps in dependency order:

  1. packages/db — generates Drizzle client
  2. packages/types, packages/env, packages/ui, packages/api-client
  3. apps/server — NestJS build via nest build
  4. apps/web — Next.js build
  5. apps/fumadocs — Next.js build

Environment variables

All server-side variables are validated at startup by packages/env/src/server.ts using Zod. The server will not boot if a required variable is missing or invalid.

Server (apps/server)

Prop

Type

Running migrations in production

Migrations must be applied before the server starts. In a Railway-style deployment, add a release command:

pnpm db:migrate

Ensure DATABASE_URL is available in the migration runner environment. The pgvector extension must already be installed in the database.

BullMQ workers

The NestJS server runs BullMQ workers in the same process as the HTTP server (@Processor classes). No separate worker process is needed for the current workload. Worker classes:

  • BriefPromptsProcessor — handles AI prompt generation jobs
  • BriefExportsProcessor — handles PDF/PNG export jobs

Both queues use the REDIS_URL connection.

Generating the API client

After deploying a new version of the server, regenerate the typed API client so the web app stays in sync:

pnpm generate-spec    # boots NestJS in-process (no HTTP, no DB) and writes openapi.json
pnpm openapi-ts       # generates packages/api-client/src/*.gen.ts

This is safe to run locally before a release — no live server is required.

On this page