{
  "manifest_version": "1.0.0",
  "template": {
    "id": "24fee184-dc18-48e0-954b-c91ff667e0bb",
    "slug": "9router-1",
    "name": "9router [Updated Sep '26]",
    "description": "9Router [Sep '26] (Self-Hosted AI Gateway & LLM Router) Self Host",
    "url": "https://railway.com/deploy/9router-1",
    "upstream": {
      "repo_url": "https://github.com/shruti060701/9router-railway"
    }
  },
  "services": [
    {
      "name": "9router-railway",
      "source": {
        "repo": "https://github.com/shruti060701/9router-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "9router-railway",
      "description": "Port Railway routes external traffic to. Must be an explicit Railway variable, not just a Dockerfile `ENV` default — this project has confirmed the hard way (Metabase, Postiz, Vaultwarden) that a Dockerfile-only default alone doesn't reliably get picked up by Railway's edge routing.",
      "secret": false,
      "strategy": "default",
      "default": "20128"
    },
    {
      "key": "BASE_URL",
      "service": "9router-railway",
      "description": "Public URL of the instance, used for internal callback/sync jobs. Optional per the app's own `.env.example`, but setting it avoids any sync-related edge cases.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "DATA_DIR",
      "service": "9router-railway",
      "description": "Directory where the SQLite database and settings are stored. Must match the Railway volume mount path exactly.",
      "secret": false,
      "strategy": "default",
      "default": "/app/data"
    },
    {
      "key": "HOSTNAME",
      "service": "9router-railway",
      "description": "Binds the Next.js standalone server to all network interfaces. Already set as a Dockerfile default too, but set explicitly here for the same reason as `PORT`.",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "NODE_ENV",
      "service": "9router-railway",
      "description": "Production Next.js runtime mode. The reference template sets this explicitly; ours doesn't, meaning the app could be running with dev-mode defaults (slower, heavier, different error handling) — a likely contributor to healthcheck timing issues.",
      "secret": false,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "JWT_SECRET",
      "service": "9router-railway",
      "description": "Signs dashboard session tokens. If unset, the app auto-generates one and writes it to a file in `DATA_DIR` — but setting it explicitly as a Railway variable avoids any risk of session invalidation if that file location ever changes across a redeploy.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "API_KEY_SECRET",
      "service": "9router-railway",
      "description": "Secret used internally to derive and validate issued 9Router API keys.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MACHINE_ID_SALT",
      "service": "9router-railway",
      "description": "Salt used for internal instance identification.",
      "secret": false,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "REQUIRE_API_KEY",
      "service": "9router-railway",
      "description": "Rejects unauthenticated /v1 calls — hardening default present on the reference.",
      "secret": true,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "INITIAL_PASSWORD",
      "service": "9router-railway",
      "description": "Bootstrap login password. **Critical: confirmed via source code that if this is ever unset, 9Router falls back to a hardcoded password (`123456`)** — never mark this optional or leave it blank.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "AUTH_COOKIE_SECURE",
      "service": "9router-railway",
      "description": "Secure cookie flag for the dashboard session, required behind HTTPS.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "ENABLE_REQUEST_LOGS",
      "service": "9router-railway",
      "description": "Keeps request bodies off disk — matches the reference's conservative default.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "NEXT_PUBLIC_BASE_URL",
      "service": "9router-railway",
      "description": "Same value as our existing BASE_URL. The reference's own description calls this \"Legacy public base URL\" — likely still read by some older code path, cheap to set for safety/parity.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "OBSERVABILITY_ENABLED",
      "service": "9router-railway",
      "description": "Enables usage and quota tracking.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "9router-1"
      }
    },
    "cli": "railway deploy --template 9router-1",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "24fee184-dc18-48e0-954b-c91ff667e0bb",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "25b84cff-d8a4-4d09-95db-a3978eb3fea7": {
                  "icon": "https://i.imgur.com/yjb5HvR.png",
                  "name": "9router-railway",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/shruti060701/9router-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway routes external traffic to. Must be an explicit Railway variable, not just a Dockerfile `ENV` default — this project has confirmed the hard way (Metabase, Postiz, Vaultwarden) that a Dockerfile-only default alone doesn't reliably get picked up by Railway's edge routing.",
                      "defaultValue": "20128"
                    },
                    "BASE_URL": {
                      "isOptional": false,
                      "description": "Public URL of the instance, used for internal callback/sync jobs. Optional per the app's own `.env.example`, but setting it avoids any sync-related edge cases.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "DATA_DIR": {
                      "isOptional": false,
                      "description": "Directory where the SQLite database and settings are stored. Must match the Railway volume mount path exactly.",
                      "defaultValue": "/app/data"
                    },
                    "HOSTNAME": {
                      "isOptional": false,
                      "description": "Binds the Next.js standalone server to all network interfaces. Already set as a Dockerfile default too, but set explicitly here for the same reason as `PORT`.",
                      "defaultValue": "0.0.0.0"
                    },
                    "NODE_ENV": {
                      "isOptional": false,
                      "description": "Production Next.js runtime mode. The reference template sets this explicitly; ours doesn't, meaning the app could be running with dev-mode defaults (slower, heavier, different error handling) — a likely contributor to healthcheck timing issues.",
                      "defaultValue": "production"
                    },
                    "JWT_SECRET": {
                      "isOptional": false,
                      "description": "Signs dashboard session tokens. If unset, the app auto-generates one and writes it to a file in `DATA_DIR` — but setting it explicitly as a Railway variable avoids any risk of session invalidation if that file location ever changes across a redeploy.",
                      "defaultValue": "{{JWT_SECRET}}"
                    },
                    "API_KEY_SECRET": {
                      "isOptional": false,
                      "description": "Secret used internally to derive and validate issued 9Router API keys.",
                      "defaultValue": "{{API_KEY_SECRET}}"
                    },
                    "MACHINE_ID_SALT": {
                      "isOptional": false,
                      "description": "Salt used for internal instance identification.",
                      "defaultValue": "{{MACHINE_ID_SALT}}"
                    },
                    "REQUIRE_API_KEY": {
                      "isOptional": false,
                      "description": "Rejects unauthenticated /v1 calls — hardening default present on the reference.",
                      "defaultValue": "true"
                    },
                    "INITIAL_PASSWORD": {
                      "isOptional": false,
                      "description": "Bootstrap login password. **Critical: confirmed via source code that if this is ever unset, 9Router falls back to a hardcoded password (`123456`)** — never mark this optional or leave it blank.",
                      "defaultValue": "{{INITIAL_PASSWORD}}"
                    },
                    "AUTH_COOKIE_SECURE": {
                      "isOptional": false,
                      "description": "Secure cookie flag for the dashboard session, required behind HTTPS.",
                      "defaultValue": "true"
                    },
                    "ENABLE_REQUEST_LOGS": {
                      "isOptional": false,
                      "description": "Keeps request bodies off disk — matches the reference's conservative default.",
                      "defaultValue": "false"
                    },
                    "NEXT_PUBLIC_BASE_URL": {
                      "isOptional": false,
                      "description": "Same value as our existing BASE_URL. The reference's own description calls this \"Legacy public base URL\" — likely still read by some older code path, cheap to set for safety/parity.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "OBSERVABILITY_ENABLED": {
                      "isOptional": false,
                      "description": "Enables usage and quota tracking.",
                      "defaultValue": "true"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "25b84cff-d8a4-4d09-95db-a3978eb3fea7": {
                      "mountPath": "/app/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-22T22:14:50.114Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-22T10:09:08.004Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_e0dcf0add7e240e5a4c7",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 81,
    "typical_build_seconds": 20,
    "typical_start_seconds": 0,
    "slowest_service": "9router-railway"
  }
}
