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.

Service Production URL
API https://api-production-02d9.up.railway.app
Web See 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.

Service Path Timeout
API /health 30s
Web / 30s

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

Set these in the Railway service settings.

Variable Description
DATABASE_URL PostgreSQL connection string
BETTER_AUTH_SECRET Secret key for Better Auth session signing
BETTER_AUTH_URL API origin (used to derive secure cookie flag from https)
BETTER_AUTH_TRUSTED_ORIGINS Comma-separated list of trusted origins (web app, API)
WEB_URL Web app origin, used for CORS (e.g. https://…)
R2_ACCOUNT_ID Cloudflare account ID for R2 storage
R2_ACCESS_KEY_ID R2 API token access key
R2_SECRET_ACCESS_KEY R2 API token secret key
R2_BUCKET_NAME R2 bucket name for avatar and evidence uploads
Variable Description
API_URL Full URL of the API service