{
  "manifest_version": "1.0.0",
  "template": {
    "id": "187d04db-aecb-4918-8296-0037de2d4770",
    "slug": "tokenleader",
    "name": "tokenleader",
    "description": "Self-hosted token-usage leaderboard for Claude Code, Codex CLI, and Cursor",
    "url": "https://railway.com/deploy/tokenleader",
    "upstream": {
      "repo_url": "https://github.com/anaralabs/tokenleader"
    }
  },
  "services": [
    {
      "name": "tokenleader",
      "source": {
        "repo": "https://github.com/anaralabs/tokenleader"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "TOKENLEADER_GH_REPO",
      "service": "tokenleader",
      "description": "GitHub repo the server mirrors daemon releases from. Leave as-is to track upstream.",
      "secret": true,
      "strategy": "default",
      "default": "anaralabs/tokenleader"
    },
    {
      "key": "TOKENLEADER_SERVER_URL",
      "service": "tokenleader",
      "description": "Public URL of this deployment, rendered into the install command teammates run.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "TOKENLEADER_ADMIN_TOKEN",
      "service": "tokenleader",
      "description": "Bearer token for destructive admin actions (clearing data). Never shared with teammates.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "tokenleader"
      }
    },
    "cli": "railway deploy --template tokenleader",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "187d04db-aecb-4918-8296-0037de2d4770",
            "serializedConfig": {
              "services": {
                "72775649-8cd2-49e2-95e7-2eea2b2b746c": {
                  "name": "tokenleader",
                  "deploy": {
                    "healthcheckPath": "/health"
                  },
                  "source": {
                    "repo": "anaralabs/tokenleader",
                    "branch": null,
                    "rootDirectory": null
                  },
                  "variables": {
                    "TOKENLEADER_GH_REPO": {
                      "isOptional": false,
                      "description": "GitHub repo the server mirrors daemon releases from. Leave as-is to track upstream.",
                      "defaultValue": "anaralabs/tokenleader"
                    },
                    "TOKENLEADER_GH_TOKEN": {
                      "isOptional": true,
                      "description": "Optional read-only GitHub token - only needed if the release mirror hits GitHub's anonymous rate limits.",
                      "defaultValue": ""
                    },
                    "TOKENLEADER_TEAM_NAME": {
                      "isOptional": true,
                      "description": "Team name shown in the dashboard header.",
                      "defaultValue": ""
                    },
                    "TOKENLEADER_SERVER_URL": {
                      "isOptional": false,
                      "description": "Public URL of this deployment, rendered into the install command teammates run.",
                      "defaultValue": "{{TOKENLEADER_SERVER_URL}}"
                    },
                    "TOKENLEADER_ADMIN_TOKEN": {
                      "isOptional": false,
                      "description": "Bearer token for destructive admin actions (clearing data). Never shared with teammates.",
                      "defaultValue": "{{TOKENLEADER_ADMIN_TOKEN}}"
                    },
                    "TOKENLEADER_DASHBOARD_TOKEN": {
                      "isOptional": true,
                      "description": "Viewer token for the dashboard - you'll be it on first visit. Remove this variable to make the dashboard public.",
                      "defaultValue": ""
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8787": {
                        "port": 8787
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "tokenleader",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 1,
    "needs_volume": false
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-20T09:57:21.130Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_c34238f8f61749ebaa49",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": false,
        "detail": "got 502, expected 200"
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ]
  }
}
