Skip to content
This repository was archived by the owner on Aug 7, 2026. It is now read-only.

Latest commit

 

History

History
178 lines (131 loc) · 4.76 KB

File metadata and controls

178 lines (131 loc) · 4.76 KB

HyperDAG Railway Deployment Guide

Quick Start (15 Minutes)

Step 1: Sign Up for Railway (2 minutes)

  1. Go to https://railway.app
  2. Click "Login" and sign in with GitHub
  3. Free tier includes:
    • 500 hours of usage per month
    • $5 credit (enough for development)
    • No credit card required to start

Step 2: Create New Project (3 minutes)

  1. Click "New Project" in Railway dashboard
  2. Select "Deploy from GitHub repo"
  3. Authorize Railway to access your GitHub account
  4. Select your HyperDAG repository
  5. Railway will auto-detect it's a Node.js app

Step 3: Add PostgreSQL Database (2 minutes)

  1. In your Railway project, click "New"
  2. Select "Database" → "PostgreSQL"
  3. Railway automatically provisions a database
  4. Important: Railway auto-generates DATABASE_URL environment variable

Step 4: Configure Environment Variables (5 minutes)

Click on your service → "Variables" tab → Add these:

Required Variables:

NODE_ENV=production
PORT=5000

# Database (auto-generated by Railway, verify it exists)
DATABASE_URL=<auto-generated>

# Supabase (copy from Replit secrets)
SUPABASE_URL=https://qnnpjhlxljtqyigedwkb.supabase.co
SUPABASE_SERVICE_KEY=<your-key-from-replit>

# OpenAI (copy from Replit secrets)
OPENAI_API_KEY=<your-key-from-replit>

# Anthropic (copy from Replit secrets)
ANTHROPIC_API_KEY=<your-key-from-replit>

# Alchemy (copy from Replit secrets)
ALCHEMY_API_KEY=<your-key-from-replit>

# Mailgun (copy from Replit secrets)
MAILGUN_API_KEY=<your-key-from-replit>
MAILGUN_DOMAIN=<your-domain-from-replit>

# App URL (will be provided by Railway after first deploy)
APP_URL=<railway-generated-url>

Optional Variables (can add later):

# Only if you want to re-enable DragonflyDB
DRAGONFLY_HOST=ar1o3ash4.dragonflydb.cloud
DRAGONFLY_PORT=6385
DRAGONFLY_PASSWORD=<if-you-have-it>

# Other API keys as needed
GROQ_API_KEY=<optional>
DEEPSEEK_API_KEY=<optional>

Step 5: Deploy (3 minutes)

  1. Railway automatically starts building when you connect repo
  2. Watch the build logs in the "Deployments" tab
  3. Build process:
    • Installs dependencies: npm install
    • Builds frontend: vite build
    • Builds backend: esbuild server/index.ts
    • Starts server: node dist/index.js
  4. Once deployed, Railway provides a public URL like: hyperdag-production.up.railway.app

Step 6: Verify Deployment (2 minutes)

  1. Click "View Logs" to see server startup
  2. Click the generated URL to open your app
  3. Test health endpoint: https://your-url.railway.app/api/health
  4. Verify no flashing (Railway doesn't use Vite HMR in production)

Environment Variables You Need from Replit

Before deploying, gather these from your Replit "Secrets" tab:

  1. Supabase Credentials:

    • SUPABASE_URL
    • SUPABASE_SERVICE_KEY
  2. AI Provider Keys:

    • OPENAI_API_KEY
    • ANTHROPIC_API_KEY
  3. Blockchain/Web3:

    • ALCHEMY_API_KEY
  4. Email Service:

    • MAILGUN_API_KEY
    • MAILGUN_DOMAIN
  5. Optional (if using):

    • GROQ_API_KEY
    • DEEPSEEK_API_KEY
    • Any other API keys you've configured

Troubleshooting

Build Fails

Error: npm install fails Solution: Check package.json is committed to GitHub

Error: vite build fails Solution: Verify all imports are correct, no missing files

App Won't Start

Error: "Port already in use" Solution: Railway auto-assigns PORT env var, your app should use process.env.PORT || 5000

Error: Database connection fails Solution: Verify DATABASE_URL exists in Railway variables

App Runs but Shows Errors

Error: Missing API keys Solution: Double-check all environment variables are set


Cost Estimates

Railway Free Tier:

  • 500 hours/month = ~20 days of continuous running
  • $5 in free credits per month
  • Perfect for development and low-traffic production

Expected Usage for HyperDAG:

  • ~$10-20/month for moderate traffic
  • Scales automatically with demand
  • Can set spending limits to avoid surprises

Next Steps After Deployment

  1. Update Trinity Coordination:

    • Update Supabase trinity_managers table with new Railway URL
    • HDM now at: https://your-railway-url.railway.app
  2. Deploy APM (AI-Prompt-Manager):

    • Create separate Railway project for APM
    • Or use another Replit (lighter, no deployment issues)
  3. Deploy MEL (ImageBearer):

    • Use Lovable.dev as planned
    • Configure Supabase coordination
  4. Test Trinity Symphony:

    • Send prompt to any manager
    • Verify it distributes to all 3 managers
    • Check autonomous task execution

Support

Railway Documentation: https://docs.railway.app Railway Discord: https://discord.gg/railway Railway Status: https://status.railway.app

If deployment fails, share the build logs for debugging.