{
  "manifest_version": "1.0.0",
  "template": {
    "id": "4c1fc5be-59cb-4a3b-a3a3-2943f388b07c",
    "slug": "endurain",
    "name": "Endurain",
    "description": "Self-hosted fitness tracking with PostgreSQL and persistent activity data.",
    "url": "https://railway.com/deploy/endurain",
    "upstream": {
      "image": "ghcr.io/endurain-project/endurain:v0.17.7@sha256:af3d2b50667c081211e9af6b3590f6cbfbaacb73f63910902574f9d65c24b346"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "postgres:17.4@sha256:4aed4b0525233308fc5de1b8d47f92326460d598dc5f004d14b41f183360b4e9"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "Endurain",
      "source": {
        "image": "ghcr.io/endurain-project/endurain:v0.17.7@sha256:af3d2b50667c081211e9af6b3590f6cbfbaacb73f63910902574f9d65c24b346"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/backend/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Keeps the PostgreSQL cluster under the persistent mount.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Creates the dedicated application database.",
      "secret": false,
      "strategy": "default",
      "default": "endurain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Creates the dedicated application role.",
      "secret": false,
      "strategy": "default",
      "default": "endurain"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Authoritative generated DB password referenced by Endurain.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "TZ",
      "service": "Endurain",
      "description": "Deterministic timezone for activities without coordinates.",
      "secret": false,
      "strategy": "default",
      "default": "Etc/UTC"
    },
    {
      "key": "PORT",
      "service": "Endurain",
      "description": "Railway routing port; the image starts Uvicorn on 8080.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "DB_HOST",
      "service": "Endurain",
      "description": "PostgreSQL hostname on Railway private networking.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "DB_PORT",
      "service": "Endurain",
      "description": "PostgreSQL listener port.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "DB_USER",
      "service": "Endurain",
      "description": "References the authoritative PostgreSQL username.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "LOG_LEVEL",
      "service": "Endurain",
      "description": "Conservative supported runtime logging level.",
      "secret": false,
      "strategy": "default",
      "default": "info"
    },
    {
      "key": "FERNET_KEY",
      "service": "Endurain",
      "description": "Fresh URL-safe base64 Fernet key encoding 32 bytes.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "SECRET_KEY",
      "service": "Endurain",
      "description": "Fresh 64-character hexadecimal JWT signing key.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "DB_DATABASE",
      "service": "Endurain",
      "description": "References the authoritative PostgreSQL database name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DB_PASSWORD",
      "service": "Endurain",
      "description": "References the one generated database password without copying it.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ENVIRONMENT",
      "service": "Endurain",
      "description": "Uses production CORS and session behavior.",
      "secret": false,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "BEHIND_PROXY",
      "service": "Endurain",
      "description": "Enables Uvicorn proxy-header processing behind Railway HTTPS.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "ENDURAIN_HOST",
      "service": "Endurain",
      "description": "Canonical public origin for frontend runtime configuration and redirects.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "FRONTEND_PROTOCOL",
      "service": "Endurain",
      "description": "Enables the Secure flag on authentication cookies.",
      "secret": false,
      "strategy": "default",
      "default": "https"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "endurain"
      }
    },
    "cli": "railway deploy --template endurain",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "4c1fc5be-59cb-4a3b-a3a3-2943f388b07c",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "489717c4-cb15-4502-9385-b5d8bca71206": {
                  "icon": null,
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "postgres:17.4@sha256:4aed4b0525233308fc5de1b8d47f92326460d598dc5f004d14b41f183360b4e9"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Keeps the PostgreSQL cluster under the persistent mount.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Creates the dedicated application database.",
                      "defaultValue": "endurain"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Creates the dedicated application role.",
                      "defaultValue": "endurain"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Authoritative generated DB password referenced by Endurain.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "489717c4-cb15-4502-9385-b5d8bca71206": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "e4bc2c0e-9a22-4a75-8dce-545e0ffa364f": {
                  "icon": null,
                  "name": "Endurain",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/api/v1/about",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/endurain-project/endurain:v0.17.7@sha256:af3d2b50667c081211e9af6b3590f6cbfbaacb73f63910902574f9d65c24b346"
                  },
                  "variables": {
                    "TZ": {
                      "isOptional": false,
                      "description": "Deterministic timezone for activities without coordinates.",
                      "defaultValue": "Etc/UTC"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "Railway routing port; the image starts Uvicorn on 8080.",
                      "defaultValue": "8080"
                    },
                    "DB_HOST": {
                      "isOptional": false,
                      "description": "PostgreSQL hostname on Railway private networking.",
                      "defaultValue": "${{Postgres.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "DB_PORT": {
                      "isOptional": false,
                      "description": "PostgreSQL listener port.",
                      "defaultValue": "5432"
                    },
                    "DB_USER": {
                      "isOptional": false,
                      "description": "References the authoritative PostgreSQL username.",
                      "defaultValue": "${{Postgres.POSTGRES_USER}}"
                    },
                    "LOG_LEVEL": {
                      "isOptional": false,
                      "description": "Conservative supported runtime logging level.",
                      "defaultValue": "info"
                    },
                    "FERNET_KEY": {
                      "isOptional": false,
                      "description": "Fresh URL-safe base64 Fernet key encoding 32 bytes.",
                      "defaultValue": "{{FERNET_KEY}}"
                    },
                    "SECRET_KEY": {
                      "isOptional": false,
                      "description": "Fresh 64-character hexadecimal JWT signing key.",
                      "defaultValue": "{{SECRET_KEY}}"
                    },
                    "DB_DATABASE": {
                      "isOptional": false,
                      "description": "References the authoritative PostgreSQL database name.",
                      "defaultValue": "${{Postgres.POSTGRES_DB}}"
                    },
                    "DB_PASSWORD": {
                      "isOptional": false,
                      "description": "References the one generated database password without copying it.",
                      "defaultValue": "${{Postgres.POSTGRES_PASSWORD}}"
                    },
                    "ENVIRONMENT": {
                      "isOptional": false,
                      "description": "Uses production CORS and session behavior.",
                      "defaultValue": "production"
                    },
                    "BEHIND_PROXY": {
                      "isOptional": false,
                      "description": "Enables Uvicorn proxy-header processing behind Railway HTTPS.",
                      "defaultValue": "true"
                    },
                    "ENDURAIN_HOST": {
                      "isOptional": false,
                      "description": "Canonical public origin for frontend runtime configuration and redirects.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "FRONTEND_PROTOCOL": {
                      "isOptional": false,
                      "description": "Enables the Secure flag on authentication cookies.",
                      "defaultValue": "https"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "e4bc2c0e-9a22-4a75-8dce-545e0ffa364f": {
                      "mountPath": "/app/backend/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Endurain",
      "method": "GET",
      "path": "/api/v1/about",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-08T22:38:13.572Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_554c35897d26469393c5",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 65,
    "typical_build_seconds": 0,
    "typical_start_seconds": 20,
    "slowest_service": "Endurain"
  }
}
