Deployment

Deployment Guide

Deploy the complete Project Noir platform: the Next.js dashboard on Vercel, and the Python services on Railway.

Service Overview

Dashboard (Next.js)

Landing page, dashboard, all API routes

Vercel

Port Auto

Voice Agent (Python)

Pipecat voice pipeline, Twilio integration

Railway

Port 7860

Telegram Worker (Python)

Telethon client pool, message sending

Railway

Port 7861

Dashboard on Vercel

Vercel auto-detects Next.js -- zero configuration needed. Simply connect your repository and set environment variables.

Steps

  1. Connect the telephonia-react repository to Vercel
  2. Set all environment variables in the Vercel dashboard (see below)
  3. Deploy -- Vercel handles the build automatically
  4. Configure webhook URLs after deployment:
    • Stripe: https://yourdomain.com/api/webhook/stripe
    • LiqPay: https://yourdomain.com/api/webhook/liqpay

Do not set output: "standalone"in next.config.js -- that's only needed for Docker deployments.

Voice Agent on Railway

  1. Create a Railway project from the voice-agent directory
  2. Railway auto-detects the Dockerfile
  3. Set all environment variables (see table below)
  4. Service exposes on port 7860
  5. Set BASE_URL to the Railway public URL
  6. Configure Twilio incoming call webhook: {BASE_URL}/twilio/incoming

Telegram Worker on Railway

  1. Create a Railway project from the telegram-worker directory
  2. Railway auto-detects the Dockerfile
  3. Set all environment variables (see table below)
  4. Service exposes on port 7861

Environment Variables

Next.js Dashboard

VariableDescription
DATABASE_URLNeon PostgreSQL connection string
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYClerk publishable key
CLERK_SECRET_KEYClerk secret key
STRIPE_SECRET_KEYStripe API secret key
STRIPE_PUBLISHABLE_KEYStripe publishable key
STRIPE_WEBHOOK_SECRETStripe webhook signing secret
LIQPAY_PUBLIC_KEYLiqPay public key (Ukraine payments)
LIQPAY_PRIVATE_KEYLiqPay private key
TWILIO_ACCOUNT_SIDTwilio account SID
TWILIO_AUTH_TOKENTwilio auth token
RESEND_API_KEYResend email API key
OPENROUTER_API_KEYOpenRouter API key (email generation)
RAILWAY_VOICE_AGENT_URLVoice agent Railway URL
SENTRY_DSNSentry DSN for error tracking

Voice Agent

VariableDescription
DATABASE_URLNeon PostgreSQL connection string
ORG_IDDefault organization ID for call attribution
DEEPGRAM_API_KEYDeepgram STT API key
ELEVENLABS_API_KEYElevenLabs TTS API key
ELEVENLABS_VOICE_IDDefault ElevenLabs voice ID
OPENROUTER_API_KEYOpenRouter API key (GPT-4o)
TWILIO_ACCOUNT_SIDTwilio account SID
TWILIO_AUTH_TOKENTwilio auth token
TWILIO_PHONE_NUMBERTwilio phone number for outbound calls
BASE_URLPublic URL of this service
DAILY_API_KEYDaily.co API key for WebRTC transport

Telegram Worker

VariableDescription
DATABASE_URLNeon PostgreSQL connection string
MAX_DAILY_MESSAGES_PER_ACCOUNTDaily message cap per account (default: 30)
MESSAGE_DELAY_MINMin seconds between sends (default: 30)
MESSAGE_DELAY_MAXMax seconds between sends (default: 90)

Deployment Checklist

All environment variables set in Vercel dashboard

Stripe webhook URL configured to /api/webhook/stripe

LiqPay webhook URL configured to /api/webhook/liqpay

Database schema pushed via drizzle-kit push

Voice agent deployed on Railway (port 7860)

RAILWAY_VOICE_AGENT_URL set in Vercel env

Twilio incoming call webhook set to voice agent BASE_URL/twilio/incoming

Telegram worker deployed on Railway (port 7861)

Clerk sign-in/sign-up redirect URLs configured

Sentry DSN configured for error monitoring