Deploy swift-wild
Deploy and Host swift-wild with Railway
team-01-app
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
- Railway PostgreSQL Plugin
- Railway Redis Plugin
- Hono Framework
- Drizzle ORM
- Better Auth
- Socket.IO
- Vercel Frontend
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:
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL connection string from Railway plugin |
REDIS_URL | Redis connection string from Railway plugin |
BETTER_AUTH_SECRET | Random 32+ character string for JWT signing |
BETTER_AUTH_URL | Public Railway API URL |
API_CORS_ORIGIN | Frontend URL for CORS policy |
API_PORT | Server listen port (default 3001) |
NODE_ENV | Set 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
team-01-app
vibe-code-tours/team-01-app