docs/deployment.md
This document describes how to deploy the Happy backend (packages/happy-server) and the infrastructure it expects.
tsx ./sources/main.ts (Fastify + Socket.IO)./metrics server on a separate port.Postgres
DATABASE_URL.Redis
redis.ping() is called).REDIS_URL.S3-compatible storage
S3_HOST, S3_PORT, S3_ACCESS_KEY, S3_SECRET_KEY, S3_BUCKET, S3_PUBLIC_URL, S3_USE_SSL.Required
DATABASE_URL: Postgres connection string.HANDY_MASTER_SECRET: master key for auth tokens and server-side encryption.REDIS_URL: Redis connection string.S3_HOST, S3_ACCESS_KEY, S3_SECRET_KEY, S3_BUCKET, S3_PUBLIC_URL: object storage config.Common
PORT: API server port (default 3005).METRICS_ENABLED: set to false to disable metrics server.METRICS_PORT: metrics server port (default 9090).S3_PORT: optional S3 port.S3_USE_SSL: true/false (default true).Optional integrations
GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, GITHUB_APP_ID, GITHUB_PRIVATE_KEY, GITHUB_WEBHOOK_SECRET, plus redirect URL/URI.
GITHUB_REDIRECT_URL is used by the OAuth callback handler.GITHUB_REDIRECT_URI is used by the GitHub App initializer.ELEVENLABS_API_KEY (required for /v1/voice/token in production).DANGEROUSLY_LOG_TO_SERVER_FOR_AI_AUTO_DEBUGGING (enables file logging + dev log endpoint).A production Dockerfile is provided at Dockerfile.server.
Key notes:
3005 (set PORT explicitly in container environments).Example manifests live in packages/happy-server/deploy:
handy.yaml: Deployment + Service + ExternalSecrets for the server.happy-redis.yaml: Redis StatefulSet + Service + ConfigMap.The deployment config expects:
9090.handy-secrets populated by ExternalSecrets.3000 to container port 3005.The server package includes scripts for local infrastructure:
yarn workspace happy-server db (Postgres in Docker)yarn workspace happy-server redisyarn workspace happy-server s3 + s3:initUse .env/.env.dev to load local settings when running yarn workspace happy-server dev.
packages/happy-server/sources/main.tsDockerfile.serverpackages/happy-server/deploypackages/happy-server/sources (rg -n "process.env")