Skip to content
  • System
  • Light
  • Dark
  • High contrast

Deployment

Inntrig deploys two independent services to Railway: the API and the web app. Both are deployed automatically on every push to main.

ServiceProduction URL
APIhttps://api-production-02d9.up.railway.app
WebSee Railway dashboard

Configuration lives in railway.json in each app directory.

build: pnpm turbo build --filter=@inntrig/api
start: node apps/api/dist/index.mjs
build: pnpm turbo build --filter=@inntrig/web
start: node apps/web/node_modules/@react-router/serve/bin.js apps/web/build/server/index.js

Migrations run automatically on API startup, before the server binds to a port. There is no separate migration step required in CI or Railway.

ServicePathTimeout
API/health30s
Web/30s

Both services are configured to restart on failure (max 3 retries).

Set these in the Railway service settings.

VariableDescription
DATABASE_URLPostgreSQL connection string
BETTER_AUTH_SECRETSecret key for Better Auth session signing
BETTER_AUTH_URLAPI origin (used to derive secure cookie flag from https)
BETTER_AUTH_TRUSTED_ORIGINSComma-separated list of trusted origins (web app, API)
WEB_URLWeb app origin, used for CORS (e.g. https://…)
R2_ACCOUNT_IDCloudflare account ID for R2 storage
R2_ACCESS_KEY_IDR2 API token access key
R2_SECRET_ACCESS_KEYR2 API token secret key
R2_BUCKET_NAMER2 bucket name for avatar and evidence uploads
VariableDescription
API_URLFull URL of the API service