This is the official repository for Convos backend service.
See our contribution guide to learn more about contributing to this project.
Use nvm (or any Node version manager) and pick
the version in .nvmrc:
nvm install
nvm usepnpm is provisioned via Corepack — the
version is pinned in package.json#packageManager:
corepack enable
corepack prepare pnpm@10.33.4 --activateSee Docker's documentation for installation instructions.
Note
If you're on a Mac, you can also use OrbStack to run Docker containers.
Copy .env.example to .env. Every var tagged # REQUIRED in .env.example
must be set or the server will refuse to start.
For secure communication with the XMTP notification server, generate a secret:
pnpm generate:notification-secretAdd the generated value to your .env file.
For JWT authentication, generate an ECDSA P-256 key pair:
pnpm tsx dev/scripts/generateEcdsaKeys.tsAdd the JWT_PRIVATE_KEY to your backend .env file and share the JWT_PUBLIC_KEY with the gateway service.
# Bring up the dev compose stack (Postgres + XMTP node + notification server)
./dev/up
# Install dependencies
pnpm install
# Apply migrations to the local database
pnpm migrate:deploy
# Generate Prisma client + zod schemas + protobufs
pnpm prisma:generate
pnpm buf:generate
# Run the app in watch mode
pnpm dev# Bring up the dev compose stack (Postgres + XMTP node + notification server)
./dev/up
# Build the Docker image
docker build -t "convos-api-service" .
# Run the Docker container
docker run --env-file .env -d -p 4000:4000 convos-api-serviceAdjust the -p 4000:4000 flag to match the port in the .env file. The default port is 4000.
pnpm clean: Removesnode_modulesfolderpnpm dev: Run the app in watch modepnpm eval:models: Bake off generation models for agent-prompt quality, scored on Braintrust (seetests/evals/README.md)pnpm eval:prompt: Compare the working-tree generator prompt against the default branch (prompt regression)pnpm format:check: Run prettier format checkpnpm format: Run prettier format and write changespnpm generate:key: Generate a key for XMTP database encryptionpnpm generate:notification-secret: Generate a secure token for XMTP notification authenticationpnpm tsx dev/scripts/generateEcdsaKeys.ts: Generate ECDSA P-256 key pair for JWT authenticationpnpm install: Installs all dependenciespnpm lint: Lint with ESLintpnpm migrate:dev: Create a Prisma migration from changes in the Prisma schema, apply to the database, and generate Prisma client codepnpm migrate:deploy: Apply pending migrations to the databasepnpm build: Builds the apppnpm start: Run the built apppnpm test: Run testspnpm typecheck: Typecheck withtscpnpm check: Run typecheck + format:check + lint together (CI gate)