Deployment
Inntrig deploys two independent services to Railway: the API and the web app. Both are deployed automatically on every push to main.
Services
Section titled “Services”| Service | Production URL |
|---|---|
| API | https://api-production-02d9.up.railway.app |
| Web | See Railway dashboard |
Build and start commands
Section titled “Build and start commands”Configuration lives in railway.json in each app directory.
API (apps/api/railway.json)
Section titled “API (apps/api/railway.json)”build: pnpm turbo build --filter=@inntrig/apistart: node apps/api/dist/index.mjsWeb (apps/web/railway.json)
Section titled “Web (apps/web/railway.json)”build: pnpm turbo build --filter=@inntrig/webstart: node apps/web/node_modules/@react-router/serve/bin.js apps/web/build/server/index.jsDatabase migrations
Section titled “Database migrations”Migrations run automatically on API startup, before the server binds to a port. There is no separate migration step required in CI or Railway.
Health checks
Section titled “Health checks”| Service | Path | Timeout |
|---|---|---|
| API | /health | 30s |
| Web | / | 30s |
Both services are configured to restart on failure (max 3 retries).
Environment variables
Section titled “Environment variables”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 |