{
  "manifest_version": "1.0.0",
  "template": {
    "id": "fd347350-0895-44b6-8c79-c809be1f71a4",
    "slug": "her-547-habitica-source",
    "name": "Habitica",
    "description": "Deploy and Host Habitica with a persistent MongoDB backend.",
    "url": "https://railway.com/deploy/her-547-habitica-source",
    "upstream": {
      "image": "awinterstein/habitica-server:5.48.8@sha256:1352a3e100b9f6c297086d58d23d5b520198aa186f5293e1d356ea531ec70bfd"
    }
  },
  "services": [
    {
      "name": "Mongo",
      "source": {
        "image": "mongo:8.0.11@sha256:5941949d3887e40be5175787aade07dc052f2cddb8ce21b740c3948eba6a3ed0"
      },
      "needs_volume": true,
      "volume_mount_path": "/data/db",
      "http": false
    },
    {
      "name": "Habitica",
      "source": {
        "image": "awinterstein/habitica-server:5.48.8@sha256:1352a3e100b9f6c297086d58d23d5b520198aa186f5293e1d356ea531ec70bfd"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "BASE_URL",
      "service": "Habitica",
      "description": "Provide a value for BASE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "NODE_DB_URI",
      "service": "Habitica",
      "description": "Provide a value for NODE_DB_URI.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "her-547-habitica-source"
      }
    },
    "cli": "railway deploy --template her-547-habitica-source",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "fd347350-0895-44b6-8c79-c809be1f71a4",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "0d0e9f13-a5e7-4e2f-8c74-d1ea670544f9": {
                  "icon": null,
                  "name": "Mongo",
                  "deploy": {
                    "startCommand": "sh -ec 'mongod --replSet rs --bind_ip_all --port 27017 & pid=$!; trap \"kill $pid\" TERM INT; until mongosh --port 27017 --quiet --eval '\\''db.adminCommand({ ping: 1 }).ok'\\'' >/dev/null 2>&1; do sleep 1; done; mongosh --port 27017 --quiet --eval \"try { rs.status() } catch (err) { rs.initiate({ _id: '\\''rs'\\'', members: [{ _id: 0, host: '\\''${RAILWAY_PRIVATE_DOMAIN}:27017'\\'' }] }) }\"; wait \"$pid\"'",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "mongo:8.0.11@sha256:5941949d3887e40be5175787aade07dc052f2cddb8ce21b740c3948eba6a3ed0"
                  },
                  "variables": {},
                  "volumeMounts": {
                    "0d0e9f13-a5e7-4e2f-8c74-d1ea670544f9": {
                      "mountPath": "/data/db"
                    }
                  }
                },
                "3f42d5a1-239f-43fb-b689-4253dd8b8f63": {
                  "icon": null,
                  "name": "Habitica",
                  "deploy": {
                    "startCommand": "sh -c \"perl -0pi -e 's/upgradeInsecureRequests: IS_PROD \\\\? \\\\[\\\\] : null,?/upgradeInsecureRequests: null/g' /var/lib/habitica/website/server/middlewares/index.js /var/lib/habitica/website/transpiled-babel/middlewares/index.js && printenv | grep -v 'no_proxy' >> /etc/environment && /etc/init.d/cron start && node /var/lib/habitica/website/transpiled-babel/index.js\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "awinterstein/habitica-server:5.48.8@sha256:1352a3e100b9f6c297086d58d23d5b520198aa186f5293e1d356ea531ec70bfd"
                  },
                  "variables": {
                    "BASE_URL": {
                      "isOptional": false,
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "NODE_DB_URI": {
                      "isOptional": false,
                      "defaultValue": "mongodb://${{Mongo.RAILWAY_PRIVATE_DOMAIN}}:27017/habitica?replicaSet=rs"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-19T04:14:37.968Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-17T10:17:20.950Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_4cecb0eb95e1488b8067",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 83,
    "typical_build_seconds": 0,
    "typical_start_seconds": 20,
    "slowest_service": "Habitica"
  }
}
