Deploy
Vercel-only. One target, one command.
Everything deploys to Vercel. No Docker, no Fly, no separate worker processes.
First-time setup
# 1. Link the project
vercel link --yes --project soma
# 2. Push env from Doppler → Vercel
doppler secrets download --project soma --config prod --no-file --format env \
| while IFS='=' read -r key val; do
printf '%s' "${val%\"}" | sed 's/^"//' \
| vercel env add "$key" production --force
done
# 3. Deploy
vercel --prod --yesOngoing deploys
vercel --prod --yesOr push to main when the Vercel Git integration is wired (not yet; we deploy via CLI for now).
What's in vercel.json
The monorepo needs explicit install + build commands since apps/web doesn't have its own pnpm-lock.yaml:
{
"installCommand": "cd ../.. && corepack enable && pnpm install --frozen-lockfile",
"buildCommand": "cd ../.. && pnpm --filter @soma/web build",
"outputDirectory": ".next",
"framework": "nextjs"
}Project-level setting rootDirectory: apps/web is configured via the Vercel API (set during project creation).
DB migrations
Separate from app deploys. Run manually when schema changes:
doppler run --project soma --config prod -- pnpm db:setupOrder of operations (handled by scripts/db-setup.ts):
- Apply
packages/db/rls/0001_extensions.sql(createsvector,pg_trgm,uuid-ossp). - Run Drizzle migrations from
packages/db/migrations/. - Apply the rest of
packages/db/rls/*.sql(RLS policies, triggers, auth mirror).
Idempotent — re-running is safe.
Post-deploy wiring
One-time, after the first deploy:
-
Inngest Cloud —
Apps → Sync a new app → https://soma-ai.cc/api/inngest. Subsequent deploys auto-sync viaPUT /api/inngestintrospection. -
Telegram webhook — one
curlto register:TG=$(doppler secrets get TELEGRAM_BOT_TOKEN --project soma --config prod --plain) WS=$(doppler secrets get TELEGRAM_WEBHOOK_SECRET --project soma --config prod --plain) curl -X POST "https://api.telegram.org/bot${TG}/setWebhook" \ -H "Content-Type: application/json" \ -d "{\"url\":\"https://soma-ai.cc/api/telegram/webhook\",\"secret_token\":\"${WS}\",\"allowed_updates\":[\"message\"]}" -
Google Pub/Sub — create a Pub/Sub topic in Google Cloud, subscribe it with a push endpoint to
https://soma-ai.cc/api/webhooks/gmail?token=<GMAIL_PUBSUB_TOKEN>, and callusers.watchper connected user.
Rollback
vercel rollbackRolls the alias back to the previous deployment. Instant.