{
  "manifest_version": "1.0.0",
  "template": {
    "id": "3cc81ce4-4651-40ee-99b3-86b0173f50a4",
    "slug": "nats",
    "name": "Nats",
    "description": "Messaging system for streams, queues and pub/sub between services",
    "url": "https://railway.com/deploy/nats",
    "upstream": {
      "repo_url": "https://github.com/gridalpha/nats-railway"
    }
  },
  "services": [
    {
      "name": "nats-3",
      "source": {
        "repo": "https://github.com/gridalpha/nats-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "tcp_ports": [
        4222
      ],
      "http": true
    },
    {
      "name": "nui",
      "source": {
        "repo": "https://github.com/gridalpha/nats-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/db",
      "http": false
    },
    {
      "name": "gateway",
      "source": {
        "repo": "https://github.com/gridalpha/nats-railway"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "nats-1",
      "source": {
        "repo": "https://github.com/gridalpha/nats-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "tcp_ports": [
        4222
      ],
      "http": true
    },
    {
      "name": "nats-2",
      "source": {
        "repo": "https://github.com/gridalpha/nats-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "tcp_ports": [
        4222
      ],
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "nats-3",
      "description": "Monitoring port Railway health-checks",
      "secret": false,
      "strategy": "default",
      "default": "8222"
    },
    {
      "key": "NATS_PASSWORD",
      "service": "nats-3",
      "description": "Password for the APP account",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NATS_ROUTE_HOSTS",
      "service": "nats-3",
      "description": "Cluster peer list",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "NATS_SYS_PASSWORD",
      "service": "nats-3",
      "description": "Password for the SYS account",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NATS_CLUSTER_PASSWORD",
      "service": "nats-3",
      "description": "Shared cluster route password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "nats-3",
      "description": "Selects the NATS image build",
      "secret": false,
      "strategy": "default",
      "default": "nats/Dockerfile"
    },
    {
      "key": "PORT",
      "service": "nui",
      "description": "HTTP port Railway health-checks",
      "secret": false,
      "strategy": "default",
      "default": "31311"
    },
    {
      "key": "NATS_PASSWORD",
      "service": "nui",
      "description": "Seeds the saved cluster connection",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "nui",
      "description": "Selects the NUI image build",
      "secret": false,
      "strategy": "default",
      "default": "nui/Dockerfile"
    },
    {
      "key": "PORT",
      "service": "gateway",
      "description": "HTTP port serving the management UI",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "GATEWAY_USER",
      "service": "gateway",
      "description": "Username for the management UI",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "NUI_UPSTREAM",
      "service": "gateway",
      "description": "Private address of the UI",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "GATEWAY_PASSWORD",
      "service": "gateway",
      "description": "Password for the management UI",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "gateway",
      "description": "Selects the Caddy image build",
      "secret": false,
      "strategy": "default",
      "default": "gateway/Dockerfile"
    },
    {
      "key": "PORT",
      "service": "nats-1",
      "description": "Monitoring port Railway health-checks",
      "secret": false,
      "strategy": "default",
      "default": "8222"
    },
    {
      "key": "NATS_PASSWORD",
      "service": "nats-1",
      "description": "Password for the APP account",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "NATS_ROUTE_HOSTS",
      "service": "nats-1",
      "description": "Cluster peer list",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "NATS_SYS_PASSWORD",
      "service": "nats-1",
      "description": "Password for the SYS account",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "NATS_CLUSTER_PASSWORD",
      "service": "nats-1",
      "description": "Shared cluster route password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "nats-1",
      "description": "Selects the NATS image build",
      "secret": false,
      "strategy": "default",
      "default": "nats/Dockerfile"
    },
    {
      "key": "PORT",
      "service": "nats-2",
      "description": "Monitoring port Railway health-checks",
      "secret": false,
      "strategy": "default",
      "default": "8222"
    },
    {
      "key": "NATS_PASSWORD",
      "service": "nats-2",
      "description": "Password for the APP account",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NATS_ROUTE_HOSTS",
      "service": "nats-2",
      "description": "Cluster peer list",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "NATS_SYS_PASSWORD",
      "service": "nats-2",
      "description": "Password for the SYS account",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NATS_CLUSTER_PASSWORD",
      "service": "nats-2",
      "description": "Shared cluster route password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "nats-2",
      "description": "Selects the NATS image build",
      "secret": false,
      "strategy": "default",
      "default": "nats/Dockerfile"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "nats"
      }
    },
    "cli": "railway deploy --template nats",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "3cc81ce4-4651-40ee-99b3-86b0173f50a4",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "15b5026e-5b14-4941-aac8-2a1204b8225b": {
                  "icon": "https://raw.githubusercontent.com/cncf/artwork/main/projects/nats/icon/color/nats-icon-color.svg",
                  "name": "nats-3",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/varz",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/nats-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Monitoring port Railway health-checks",
                      "defaultValue": "8222"
                    },
                    "NATS_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the APP account",
                      "defaultValue": "${{nats-1.NATS_PASSWORD}}"
                    },
                    "NATS_ROUTE_HOSTS": {
                      "isOptional": false,
                      "description": "Cluster peer list",
                      "defaultValue": "${{nats-1.RAILWAY_PRIVATE_DOMAIN}},${{nats-2.RAILWAY_PRIVATE_DOMAIN}},${{nats-3.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "NATS_SYS_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the SYS account",
                      "defaultValue": "${{nats-1.NATS_SYS_PASSWORD}}"
                    },
                    "NATS_CLUSTER_PASSWORD": {
                      "isOptional": false,
                      "description": "Shared cluster route password",
                      "defaultValue": "${{nats-1.NATS_CLUSTER_PASSWORD}}"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": false,
                      "description": "Selects the NATS image build",
                      "defaultValue": "nats/Dockerfile"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "4222": {}
                    },
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  },
                  "volumeMounts": {
                    "15b5026e-5b14-4941-aac8-2a1204b8225b": {
                      "mountPath": "/data"
                    }
                  }
                },
                "32a7a691-d463-4a78-957a-2ed5828e30ec": {
                  "icon": "https://raw.githubusercontent.com/nats-nui/nui/main/build/appicon.png",
                  "name": "nui",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/nats-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP port Railway health-checks",
                      "defaultValue": "31311"
                    },
                    "NATS_PASSWORD": {
                      "isOptional": false,
                      "description": "Seeds the saved cluster connection",
                      "defaultValue": "${{nats-1.NATS_PASSWORD}}"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": false,
                      "description": "Selects the NUI image build",
                      "defaultValue": "nui/Dockerfile"
                    }
                  },
                  "volumeMounts": {
                    "32a7a691-d463-4a78-957a-2ed5828e30ec": {
                      "mountPath": "/db"
                    }
                  }
                },
                "69785a15-1eb6-4e60-a5ef-a488ab69c811": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/caddy.svg",
                  "name": "gateway",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/healthz",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/nats-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP port serving the management UI",
                      "defaultValue": "8080"
                    },
                    "GATEWAY_USER": {
                      "isOptional": false,
                      "description": "Username for the management UI",
                      "defaultValue": "admin"
                    },
                    "NUI_UPSTREAM": {
                      "isOptional": false,
                      "description": "Private address of the UI",
                      "defaultValue": "${{nui.RAILWAY_PRIVATE_DOMAIN}}:31311"
                    },
                    "GATEWAY_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the management UI",
                      "defaultValue": "{{GATEWAY_PASSWORD}}"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": false,
                      "description": "Selects the Caddy image build",
                      "defaultValue": "gateway/Dockerfile"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                },
                "9736d8a6-cdb1-48e8-b1ba-0fb8beec390e": {
                  "icon": "https://raw.githubusercontent.com/cncf/artwork/main/projects/nats/icon/color/nats-icon-color.svg",
                  "name": "nats-1",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/varz",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/nats-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Monitoring port Railway health-checks",
                      "defaultValue": "8222"
                    },
                    "NATS_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the APP account",
                      "defaultValue": "{{NATS_PASSWORD}}"
                    },
                    "NATS_ROUTE_HOSTS": {
                      "isOptional": false,
                      "description": "Cluster peer list",
                      "defaultValue": "${{nats-1.RAILWAY_PRIVATE_DOMAIN}},${{nats-2.RAILWAY_PRIVATE_DOMAIN}},${{nats-3.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "NATS_SYS_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the SYS account",
                      "defaultValue": "{{NATS_SYS_PASSWORD}}"
                    },
                    "NATS_CLUSTER_PASSWORD": {
                      "isOptional": false,
                      "description": "Shared cluster route password",
                      "defaultValue": "{{NATS_CLUSTER_PASSWORD}}"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": false,
                      "description": "Selects the NATS image build",
                      "defaultValue": "nats/Dockerfile"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "4222": {}
                    },
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  },
                  "volumeMounts": {
                    "9736d8a6-cdb1-48e8-b1ba-0fb8beec390e": {
                      "mountPath": "/data"
                    }
                  }
                },
                "d69295c6-9dd7-4f24-8e98-a22cf1ff2206": {
                  "icon": "https://raw.githubusercontent.com/cncf/artwork/main/projects/nats/icon/color/nats-icon-color.svg",
                  "name": "nats-2",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/varz",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/nats-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Monitoring port Railway health-checks",
                      "defaultValue": "8222"
                    },
                    "NATS_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the APP account",
                      "defaultValue": "${{nats-1.NATS_PASSWORD}}"
                    },
                    "NATS_ROUTE_HOSTS": {
                      "isOptional": false,
                      "description": "Cluster peer list",
                      "defaultValue": "${{nats-1.RAILWAY_PRIVATE_DOMAIN}},${{nats-2.RAILWAY_PRIVATE_DOMAIN}},${{nats-3.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "NATS_SYS_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the SYS account",
                      "defaultValue": "${{nats-1.NATS_SYS_PASSWORD}}"
                    },
                    "NATS_CLUSTER_PASSWORD": {
                      "isOptional": false,
                      "description": "Shared cluster route password",
                      "defaultValue": "${{nats-1.NATS_CLUSTER_PASSWORD}}"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": false,
                      "description": "Selects the NATS image build",
                      "defaultValue": "nats/Dockerfile"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "4222": {}
                    },
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  },
                  "volumeMounts": {
                    "d69295c6-9dd7-4f24-8e98-a22cf1ff2206": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "nats-3",
      "method": "GET",
      "path": "/varz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 5,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T10:14:37.339Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-19T13:22:51.943Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_d5bfaf8a154746e29db1",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": false,
        "detail": "got 400, expected 200"
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ]
  }
}
