{
  "manifest_version": "1.0.0",
  "template": {
    "id": "5eea40f9-5fe4-48df-b3d0-325119263464",
    "slug": "lnbits",
    "name": "LNbits",
    "description": "Bitcoin Lightning wallet & payments API powered by an ACINQ phoenixd node.",
    "url": "https://railway.com/deploy/lnbits",
    "upstream": {
      "image": "lnbits/lnbits:latest"
    }
  },
  "services": [
    {
      "name": "Phoenixd",
      "source": {
        "repo": "https://github.com/nomideusz/lnbits-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/phoenix/.phoenix",
      "http": false
    },
    {
      "name": "LNbits",
      "source": {
        "image": "lnbits/lnbits:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PHOENIXD_API_PASSWORD",
      "service": "Phoenixd",
      "description": "Auto-generated API password for phoenixd's HTTP API. LNbits references this value — do not change after first deploy.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "HOST",
      "service": "LNbits",
      "description": "Bind address for the web server.",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "PORT",
      "service": "LNbits",
      "description": "Web server port. Also used by the Railway healthcheck.",
      "secret": false,
      "strategy": "default",
      "default": "5000"
    },
    {
      "key": "LNBITS_ADMIN_UI",
      "service": "LNbits",
      "description": "Enables the superuser admin panel at /admin (first visit to the site creates the superuser).",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "LNBITS_DATA_FOLDER",
      "service": "LNbits",
      "description": "SQLite data directory on the persistent volume.",
      "secret": false,
      "strategy": "default",
      "default": "/app/data"
    },
    {
      "key": "PHOENIXD_API_ENDPOINT",
      "service": "LNbits",
      "description": "phoenixd HTTP API over Railway's private network. Auto-resolved at deploy time.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PHOENIXD_API_PASSWORD",
      "service": "LNbits",
      "description": "Reference to Phoenixd's API password — shared secret, stored once.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "FUNDING_SOURCE_MAX_RETRIES",
      "service": "LNbits",
      "description": "Startup retries while phoenixd builds (exponential backoff, ~4 min total). Without this LNbits silently falls back to VoidWallet on first deploy.",
      "secret": false,
      "strategy": "default",
      "default": "9"
    },
    {
      "key": "LNBITS_BACKEND_WALLET_CLASS",
      "service": "LNbits",
      "description": "Funding source implementation. Static — this template wires LNbits to phoenixd.",
      "secret": false,
      "strategy": "default",
      "default": "PhoenixdWallet"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "lnbits"
      }
    },
    "cli": "railway deploy --template lnbits",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "5eea40f9-5fe4-48df-b3d0-325119263464",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "1db3b609-1325-450e-bd87-f7415f0598f9": {
                  "icon": "https://avatars.githubusercontent.com/u/22757956",
                  "name": "Phoenixd",
                  "deploy": {
                    "startCommand": "",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/nomideusz/lnbits-railway",
                    "rootDirectory": "/phoenixd"
                  },
                  "variables": {
                    "PHOENIXD_API_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated API password for phoenixd's HTTP API. LNbits references this value — do not change after first deploy.",
                      "defaultValue": "{{PHOENIXD_API_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "1db3b609-1325-450e-bd87-f7415f0598f9": {
                      "mountPath": "/phoenix/.phoenix"
                    }
                  }
                },
                "b96ef1b6-deb3-475b-ba39-bade07318587": {
                  "icon": "https://avatars.githubusercontent.com/u/76852049",
                  "name": "LNbits",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/api/v1/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "lnbits/lnbits:latest"
                  },
                  "variables": {
                    "HOST": {
                      "isOptional": false,
                      "description": "Bind address for the web server.",
                      "defaultValue": "0.0.0.0"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "Web server port. Also used by the Railway healthcheck.",
                      "defaultValue": "5000"
                    },
                    "LNBITS_ADMIN_UI": {
                      "isOptional": false,
                      "description": "Enables the superuser admin panel at /admin (first visit to the site creates the superuser).",
                      "defaultValue": "true"
                    },
                    "LNBITS_DATA_FOLDER": {
                      "isOptional": false,
                      "description": "SQLite data directory on the persistent volume.",
                      "defaultValue": "/app/data"
                    },
                    "PHOENIXD_API_ENDPOINT": {
                      "isOptional": false,
                      "description": "phoenixd HTTP API over Railway's private network. Auto-resolved at deploy time.",
                      "defaultValue": "http://${{Phoenixd.RAILWAY_PRIVATE_DOMAIN}}:9740/"
                    },
                    "PHOENIXD_API_PASSWORD": {
                      "isOptional": false,
                      "description": "Reference to Phoenixd's API password — shared secret, stored once.",
                      "defaultValue": "${{Phoenixd.PHOENIXD_API_PASSWORD}}"
                    },
                    "FUNDING_SOURCE_MAX_RETRIES": {
                      "isOptional": false,
                      "description": "Startup retries while phoenixd builds (exponential backoff, ~4 min total). Without this LNbits silently falls back to VoidWallet on first deploy.",
                      "defaultValue": "9"
                    },
                    "LNBITS_BACKEND_WALLET_CLASS": {
                      "isOptional": false,
                      "description": "Funding source implementation. Static — this template wires LNbits to phoenixd.",
                      "defaultValue": "PhoenixdWallet"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "b96ef1b6-deb3-475b-ba39-bade07318587": {
                      "mountPath": "/app/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "LNbits",
      "method": "GET",
      "path": "/api/v1/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-08T20:42:41.381Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_37faea45af95474a80b9",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "SUCCESS,FAILED"
      }
    ]
  }
}
