SourcAI — Deployment Guide

team starthack-2026 v1 by andre Mar 23, 2026 hackathondeploymentinfra

SourcAI — Deployment Guide

Architecture

[Browser] → [Railway: sourcai-frontend] → [Railway: sourcai-backend] → [Claude API]

                                          [Persistent Volume: /app/workspace-volume]

URLs

ServiceURL
Frontendhttps://sourcai-frontend-production.up.railway.app
Backendhttps://sourcai-backend-production.up.railway.app
Backend localhttp://localhost:8000

Railway IDs

ResourceID
Project1bb90be6-d0ec-45aa-b6a1-5fba984ed1aa
Frontend service4680a1ed-0fb2-476d-86b9-61e39bda57f1
Backend service24c5efb9-fce3-43c2-a0bd-59a8c67a3149
Backend volume4942b3a0-756e-45ec-9196-3f06a1e1e5c7
Environment0d324797-f561-425a-a08c-31555757ff7f

How it works

  1. Push to main → Railway auto-deploys both services
  2. Backend Dockerfile strips claude-agent-sdk (macOS-only wheel) and re-locks deps for Linux
  3. entrypoint.sh seeds the persistent volume with git-baked request data (datasets, templates, CLAUDE.md, existing requests) — only copies what doesn’t already exist in the volume
  4. New requests created at runtime persist in the volume between deploys
  5. Frontend reads NEXT_PUBLIC_API_URL env var → points to Railway backend (fixed URL)

Local development

cd /Users/styreep/cofoundy/projects/starthack-2026/backend
uv run uvicorn app.main:app --port 8000

To point the live frontend at your local backend for testing:

https://sourcai-frontend-production.up.railway.app/?api=http://localhost:8000

Verify

# 1. Backend health
curl https://sourcai-backend-production.up.railway.app/health

# 2. Processed requests
curl https://sourcai-backend-production.up.railway.app/api/requests | python3 -c "import json,sys; print(f'{len(json.load(sys.stdin))} requests')"

# 3. Frontend loads
curl -s -o /dev/null -w "HTTP %{http_code}" https://sourcai-frontend-production.up.railway.app/

Demo mode fallback

When the backend is unreachable, the frontend automatically enters demo mode:

WARNING: Demo mode is silent — no banner or indicator. If you see generic data (Dell Precision 5690, always the same 3 suppliers), you’re in demo mode. Always verify with the health check.

localStorage gotcha

The frontend stores the API URL in localStorage['sift_api_url']. This takes priority over the env var. If anyone previously visited with ?api=SOME_OLD_TUNNEL_URL, their browser will keep hitting that dead URL.

Fix: Visit once with the correct URL to update localStorage:

https://sourcai-frontend-production.up.railway.app/?api=https://sourcai-backend-production.up.railway.app

CI/CD

Backend env vars (Railway)

VarValue
ANTHROPIC_API_KEYsk-ant-... (set via Railway)
PORTAuto-injected by Railway

Persistent volume details