{
  "manifest_version": "1.0.0",
  "template": {
    "id": "390dff5a-c602-46bc-b1fb-52e64bbf44ec",
    "slug": "openhedge-1",
    "name": "openhedge",
    "description": "Discover hedges in event contracts and prediction markets",
    "url": "https://railway.com/deploy/openhedge-1",
    "upstream": {
      "repo_url": "https://github.com/mark-antal-csizmadia/openhedge"
    }
  },
  "services": [
    {
      "name": "caddy",
      "source": {
        "repo": "https://github.com/mark-antal-csizmadia/openhedge"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "sync",
      "source": {
        "repo": "https://github.com/mark-antal-csizmadia/openhedge"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "api",
      "source": {
        "repo": "https://github.com/mark-antal-csizmadia/openhedge"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "mcp",
      "source": {
        "repo": "https://github.com/mark-antal-csizmadia/openhedge"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "Qdrant",
      "source": {
        "image": "qdrant/qdrant:v1.19.0"
      },
      "needs_volume": true,
      "volume_mount_path": "/qdrant/storage",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "caddy",
      "description": "Public Caddy listen port. Keep 8080. Railway's healthcheck and the public domain bind here.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "UPSTREAM_URL",
      "service": "caddy",
      "description": "Private MCP host:port for Caddy reverse_proxy. No http:// prefix. Keep the generated default (${{mcp.RAILWAY_PRIVATE_DOMAIN}}:8001). No public domain on mcp.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "caddy",
      "description": "Path to the Caddy Dockerfile. Keep deploy/caddy/Dockerfile so Railway builds with Docker instead of Railpack.",
      "secret": false,
      "strategy": "default",
      "default": "deploy/caddy/Dockerfile"
    },
    {
      "key": "QDRANT_URL",
      "service": "sync",
      "description": "Private Qdrant HTTP URL. Keep the generated default (${{Qdrant.RAILWAY_PRIVATE_DOMAIN}}:6333). No API key. Image defaults already use HTTP 6333 and /qdrant/storage.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "OPENROUTER_API_KEY",
      "service": "sync",
      "description": "OpenRouter API key for embeddings and search. Create one at https://openrouter.ai/keys. The same key is applied to api and sync.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "sync",
      "description": "Path to the service Dockerfile. Keep openhedge-core/Dockerfile so Railway builds with Docker instead of Railpack. The repo root is not a language app.",
      "secret": false,
      "strategy": "default",
      "default": "openhedge-core/Dockerfile"
    },
    {
      "key": "PORT",
      "service": "api",
      "description": "HTTP listen port for the REST API. Keep 8000. MCP talks to this service on :8000; the port is not referenceable as ${{api.PORT}}.",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "QDRANT_URL",
      "service": "api",
      "description": "Private Qdrant HTTP URL. Keep the generated default (${{Qdrant.RAILWAY_PRIVATE_DOMAIN}}:6333). No API key. Image defaults already use HTTP 6333 and /qdrant/storage.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "OPENROUTER_API_KEY",
      "service": "api",
      "description": "OpenRouter API key for embeddings and search. Create one at https://openrouter.ai/keys. The same key is applied to api and sync.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "api",
      "description": "Path to the service Dockerfile. Keep openhedge-core/Dockerfile so Railway builds with Docker instead of Railpack. The repo root is not a language app.",
      "secret": false,
      "strategy": "default",
      "default": "openhedge-core/Dockerfile"
    },
    {
      "key": "PORT",
      "service": "mcp",
      "description": "HTTP listen port for streamable MCP. Keep 8001. Caddy reverse-proxies this service on :8001; the port is not referenceable as ${{mcp.PORT}}.",
      "secret": false,
      "strategy": "default",
      "default": "8001"
    },
    {
      "key": "OPENHEDGE_API_URL",
      "service": "mcp",
      "description": "Private REST API base URL for MCP. Keep the generated default (${{api.RAILWAY_PRIVATE_DOMAIN}}:8000). No public domain on api.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "mcp",
      "description": "Path to the service Dockerfile. Keep openhedge-core/Dockerfile so Railway builds with Docker instead of Railpack. The repo root is not a language app.",
      "secret": false,
      "strategy": "default",
      "default": "openhedge-core/Dockerfile"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "openhedge-1"
      }
    },
    "cli": "railway deploy --template openhedge-1",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "390dff5a-c602-46bc-b1fb-52e64bbf44ec",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "26325d9c-6043-4d12-a579-333d783171e4": {
                  "icon": "https://devicons.railway.app/railway",
                  "name": "caddy",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/mark-antal-csizmadia/openhedge",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": true,
                      "description": "Public Caddy listen port. Keep 8080. Railway's healthcheck and the public domain bind here.",
                      "defaultValue": "8080"
                    },
                    "UPSTREAM_URL": {
                      "isOptional": true,
                      "description": "Private MCP host:port for Caddy reverse_proxy. No http:// prefix. Keep the generated default (${{mcp.RAILWAY_PRIVATE_DOMAIN}}:8001). No public domain on mcp.",
                      "defaultValue": "${{mcp.RAILWAY_PRIVATE_DOMAIN}}:8001"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": true,
                      "description": "Path to the Caddy Dockerfile. Keep deploy/caddy/Dockerfile so Railway builds with Docker instead of Railpack.",
                      "defaultValue": "deploy/caddy/Dockerfile"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                },
                "641a18e3-aac3-4a56-a444-621f103e8838": {
                  "icon": "https://devicons.railway.app/railway",
                  "name": "sync",
                  "deploy": {
                    "cronSchedule": "0 * * * *",
                    "startCommand": "python -m openhedge_core.sync_markets",
                    "healthcheckPath": null,
                    "restartPolicyType": "NEVER",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/mark-antal-csizmadia/openhedge",
                    "rootDirectory": null
                  },
                  "variables": {
                    "QDRANT_URL": {
                      "isOptional": true,
                      "description": "Private Qdrant HTTP URL. Keep the generated default (${{Qdrant.RAILWAY_PRIVATE_DOMAIN}}:6333). No API key. Image defaults already use HTTP 6333 and /qdrant/storage.",
                      "defaultValue": "http://${{Qdrant.RAILWAY_PRIVATE_DOMAIN}}:6333"
                    },
                    "OPENROUTER_API_KEY": {
                      "isOptional": false,
                      "description": "OpenRouter API key for embeddings and search. Create one at https://openrouter.ai/keys. The same key is applied to api and sync.",
                      "defaultValue": "{{OPENROUTER_API_KEY}}"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": true,
                      "description": "Path to the service Dockerfile. Keep openhedge-core/Dockerfile so Railway builds with Docker instead of Railpack. The repo root is not a language app.",
                      "defaultValue": "openhedge-core/Dockerfile"
                    }
                  }
                },
                "69cf64c7-6efa-4d03-a03a-a519cf0e7fca": {
                  "icon": "https://devicons.railway.app/railway",
                  "name": "api",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'export API_HOST=0.0.0.0 API_PORT=\"$PORT\"; exec python -m openhedge_core.server'",
                    "healthcheckPath": "/health",
                    "preDeployCommand": [
                      "python -m openhedge_core.setup_qdrant"
                    ],
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/mark-antal-csizmadia/openhedge",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": true,
                      "description": "HTTP listen port for the REST API. Keep 8000. MCP talks to this service on :8000; the port is not referenceable as ${{api.PORT}}.",
                      "defaultValue": "8000"
                    },
                    "QDRANT_URL": {
                      "isOptional": true,
                      "description": "Private Qdrant HTTP URL. Keep the generated default (${{Qdrant.RAILWAY_PRIVATE_DOMAIN}}:6333). No API key. Image defaults already use HTTP 6333 and /qdrant/storage.",
                      "defaultValue": "http://${{Qdrant.RAILWAY_PRIVATE_DOMAIN}}:6333"
                    },
                    "OPENROUTER_API_KEY": {
                      "isOptional": false,
                      "description": "OpenRouter API key for embeddings and search. Create one at https://openrouter.ai/keys. The same key is applied to api and sync.",
                      "defaultValue": "{{OPENROUTER_API_KEY}}"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": true,
                      "description": "Path to the service Dockerfile. Keep openhedge-core/Dockerfile so Railway builds with Docker instead of Railpack. The repo root is not a language app.",
                      "defaultValue": "openhedge-core/Dockerfile"
                    }
                  }
                },
                "a23736a7-d16c-49a6-9bfb-d2381edb4f2b": {
                  "icon": "https://devicons.railway.app/railway",
                  "name": "mcp",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'export MCP_HOST=0.0.0.0 MCP_PORT=\"$PORT\"; exec python -m openhedge_core.mcp_server'",
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/mark-antal-csizmadia/openhedge",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": true,
                      "description": "HTTP listen port for streamable MCP. Keep 8001. Caddy reverse-proxies this service on :8001; the port is not referenceable as ${{mcp.PORT}}.",
                      "defaultValue": "8001"
                    },
                    "OPENHEDGE_API_URL": {
                      "isOptional": true,
                      "description": "Private REST API base URL for MCP. Keep the generated default (${{api.RAILWAY_PRIVATE_DOMAIN}}:8000). No public domain on api.",
                      "defaultValue": "http://${{api.RAILWAY_PRIVATE_DOMAIN}}:8000"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": true,
                      "description": "Path to the service Dockerfile. Keep openhedge-core/Dockerfile so Railway builds with Docker instead of Railpack. The repo root is not a language app.",
                      "defaultValue": "openhedge-core/Dockerfile"
                    }
                  }
                },
                "f79e11d9-b9fc-43c9-80ac-6192f383996a": {
                  "icon": "https://devicons.railway.app/railway",
                  "name": "Qdrant",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "qdrant/qdrant:v1.19.0"
                  },
                  "variables": {},
                  "volumeMounts": {
                    "f79e11d9-b9fc-43c9-80ac-6192f383996a": {
                      "mountPath": "/qdrant/storage"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "caddy",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 5,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-19T16:28:40.971Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_795cc39413d1494287ae",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 160,
    "typical_build_seconds": 10,
    "typical_start_seconds": 10,
    "slowest_service": "caddy"
  }
}
