Railway

Deploy JXLR Boilerplate

Turborepo Express Start Boilerplate

Deploy JXLR Boilerplate

JXLR Boilerplate

Just deployed

Just deployed

/data

/var/lib/grafana/

/prometheus

/var/lib/postgresql/data

Bucket

Bucket

Just deployed

Deploy and Host JXLR Boilerplate on Railway

JXLR Boilerplate is a production-ready full-stack TypeScript monorepo. It ships an Express API with type-safe Zod contracts shared with the frontend, React 19 with TanStack Router and Query, PostgreSQL via Kysely, Redis-backed jobs, S3 object storage, multi-organisation authentication, and a complete Grafana observability stack — everything a new product needs on day one.

About Hosting JXLR Boilerplate

Hosting involves ten services wired together: the API and frontend, each built from its own Dockerfile inside a shared pnpm monorepo; a Caddy reverse proxy that gives both a single public domain; PostgreSQL, Redis and an S3-compatible bucket; and Grafana, Loki, Prometheus and Tempo for logs, metrics and traces. Railway's reference variables connect everything over private networking, so no credentials are copied by hand. Database migrations run as a pre-deploy step and abort the release if they fail, auth secrets are generated per deployment, and volumes persist your database and observability data. Nothing requires configuration before the first deploy.

Common Use Cases

  • Launching a new multi-tenant SaaS product without rebuilding auth, organisations, user management and an admin backoffice from scratch
  • Standing up an internal tool or client dashboard that needs real authentication, file uploads and audit-quality logging on day one
  • Running a reference full-stack architecture with logs, metrics and distributed traces already correlated in Grafana

Dependencies for JXLR Boilerplate Hosting

  • PostgreSQL — primary datastore, schema managed by Kysely migrations
  • Redis — background job queue and distributed rate limiting
  • S3-compatible object storage — file uploads via presigned URLs
  • Caddy reverse proxy — single public domain, routing /api/* to the backend
  • Grafana + Loki + Prometheus + Tempo — the observability stack

Deployment Dependencies

Implementation Details

Single domain, path-routed. Caddy uses handle_path {$BACKEND_PATH:/api}/*, which strips the prefix before proxying. The browser calls https:///api/web/users; the API receives /web/users. Frontend and API are same-origin, so session cookies work without CORS.

VITE_API_URL = https://${{Caddy Proxy.RAILWAY_PUBLIC_DOMAIN}}/api
BASE_URL     = https://${{Caddy Proxy.RAILWAY_PUBLIC_DOMAIN}}/api

VITE_API_URL is inlined by Vite at build time, so changing it requires a rebuild rather than a restart.

Migrations gate the release. apps/api/railway.json runs them before the new build takes traffic, so a failed migration leaves the previous version serving:

"deploy": {
  "preDeployCommand": ["pnpm --filter @repo/api db:migrate"],
  "healthcheckPath": "/health",
  "drainingSeconds": 15,
  "overlapSeconds": 20
}

Graceful shutdown. On SIGTERM the API stops accepting connections, closes idle keep-alive sockets, closes the database pool and flushes pending traces, with a 5s backstop — comfortably inside Railway's draining window.

Secrets are generated, not shared. BETTER_AUTH_SECRET, INTERNAL_RPC_SECRET and the Grafana admin password use ${{ secret(n) }}, so every deployment of this template mints its own.

Optional integrations. Email (RESEND_API_KEY), Slack error alerting (SLACK_BOT_TOKEN) and Google OAuth are unset by default. The app degrades cleanly without them — email logs to stdout and Slack alerting no-ops.

Why Deploy JXLR Boilerplate on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying JXLR Boilerplate on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Rocky Linux
[Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
37
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51