Railway

Deploy swift-wild

Deploy and Host swift-wild with Railway

Deploy swift-wild

Just deployed

Deploy and Host Water Delivery API on Railway

Water Delivery is a full-stack water delivery management system featuring a Next.js 15 frontend, Hono v4 API server, real-time Socket.IO, PostgreSQL via Drizzle ORM, Redis caching, and JWT authentication for managing products, subscriptions, orders, and delivery schedules.

About Hosting Water Delivery API

Deploying the Water Delivery API on Railway involves running a Hono-based Node.js 22 server with Socket.IO for real-time features. The monorepo requires installing workspace dependencies from @water-delivery/shared and @water-delivery/db before starting. Railway provisions managed PostgreSQL and Redis, injects connection strings as environment variables, and handles SSL, networking, and autoscaling. The API listens on port 3001 and exposes /health for Railway health checks.

Common Use Cases

  • SaaS water delivery platform managing subscriptions, orders, delivery schedules, and customer accounts
  • E-commerce backend API serving product catalogs with image uploads, payment verification, and real-time status updates
  • Multi-tenant admin system with role-based access for super admins, delivery staff, and end users

Dependencies for Water Delivery API Hosting

  • PostgreSQL 16 — primary relational database for all application data
  • Redis 7 — caching layer, session store, and pub/sub for Socket.IO
  • Node.js 22 — runtime for Hono API and TypeScript execution
  • Socket.IO v4 — WebSocket server for real-time order and admin notifications
  • Better Auth — JWT sessions, passkeys, and user management
  • Drizzle ORM — TypeScript ORM with migration support

Deployment Dependencies

Implementation Details

FROM node:22-slim
WORKDIR /app
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
COPY package.json package-lock.json ./
COPY packages/shared/package.json ./packages/shared/
COPY packages/db/package.json ./packages/db/
COPY apps/api/package.json ./apps/api/
RUN npm install
COPY packages/shared/ ./packages/shared/
COPY packages/db/ ./packages/db/
COPY apps/api/ ./apps/api/
WORKDIR /app/apps/api
EXPOSE 3001
CMD ["npx", "tsx", "src/index.ts"]
[build]
builder = "dockerfile"
dockerfilePath = "Dockerfile"

[deploy]
startCommand = "npx tsx src/index.ts"
healthcheckPath = "/health"
healthcheckTimeout = 300
restartPolicyType = "on_failure"
restartPolicyMaxRetries = 5

Required environment variables:

VariableDescription
DATABASE_URLPostgreSQL connection string from Railway plugin
REDIS_URLRedis connection string from Railway plugin
BETTER_AUTH_SECRETRandom 32+ character string for JWT signing
BETTER_AUTH_URLPublic Railway API URL
API_CORS_ORIGINFrontend URL for CORS policy
API_PORTServer listen port (default 3001)
NODE_ENVSet to production

Why Deploy

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 Water Delivery API 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
23
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
49