{
  "manifest_version": "1.0.0",
  "template": {
    "id": "918a4bf6-3543-4aa0-ae04-974177a6268d",
    "slug": "timescale-db",
    "name": "Timescale-DB",
    "description": "greSQL for time-series data, with a browser SQL console",
    "url": "https://railway.com/deploy/timescale-db",
    "upstream": {
      "image": "sosedoff/pgweb:latest"
    }
  },
  "services": [
    {
      "name": "TimescaleDB",
      "source": {
        "repo": "https://github.com/gridalpha/timescaledb-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/home/postgres/pgdata",
      "tcp_ports": [
        5432
      ],
      "http": false
    },
    {
      "name": "pgweb",
      "source": {
        "image": "sosedoff/pgweb:latest"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "APP_DB",
      "service": "TimescaleDB",
      "description": "Application database, created at boot",
      "secret": false,
      "strategy": "default",
      "default": "tsdb"
    },
    {
      "key": "PGHOST",
      "service": "TimescaleDB",
      "description": "Client alias, scrubbed inside the container",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "TimescaleDB",
      "description": "Client alias, scrubbed inside the container",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "TimescaleDB",
      "description": "Client alias, scrubbed inside the container",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "APP_USER",
      "service": "TimescaleDB",
      "description": "Application role that owns APP_DB",
      "secret": false,
      "strategy": "default",
      "default": "tsdbadmin"
    },
    {
      "key": "PGDATABASE",
      "service": "TimescaleDB",
      "description": "Client alias, scrubbed inside the container",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "TimescaleDB",
      "description": "Client alias, scrubbed inside the container",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "APP_PASSWORD",
      "service": "TimescaleDB",
      "description": "Application role password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_URL",
      "service": "TimescaleDB",
      "description": "Private connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_SSL",
      "service": "TimescaleDB",
      "description": "Serve TLS with a generated certificate",
      "secret": false,
      "strategy": "default",
      "default": "on"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "TimescaleDB",
      "description": "Superuser password, set on first boot",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "TimescaleDB",
      "description": "External connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "TIMESCALEDB_TELEMETRY",
      "service": "TimescaleDB",
      "description": "Upstream telemetry, off by default",
      "secret": false,
      "strategy": "default",
      "default": "off"
    },
    {
      "key": "PORT",
      "service": "pgweb",
      "description": "Anonymous metrics listener, used for health checks",
      "secret": false,
      "strategy": "default",
      "default": "9090"
    },
    {
      "key": "PGWEB_AUTH_PASS",
      "service": "pgweb",
      "description": "HTTP basic auth password",
      "secret": false,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PGWEB_AUTH_USER",
      "service": "pgweb",
      "description": "HTTP basic auth username",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "PGWEB_DATABASE_URL",
      "service": "pgweb",
      "description": "Database the console is locked to",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "timescale-db"
      }
    },
    "cli": "railway deploy --template timescale-db",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "918a4bf6-3543-4aa0-ae04-974177a6268d",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "a934fe3c-65bb-4208-8e15-31f66e32eb58": {
                  "icon": "https://cdn.simpleicons.org/timescale/FDB515.svg",
                  "name": "TimescaleDB",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/timescaledb-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "APP_DB": {
                      "isOptional": false,
                      "description": "Application database, created at boot",
                      "defaultValue": "tsdb"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Client alias, scrubbed inside the container",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Client alias, scrubbed inside the container",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Client alias, scrubbed inside the container",
                      "defaultValue": "${{APP_USER}}"
                    },
                    "APP_USER": {
                      "isOptional": false,
                      "description": "Application role that owns APP_DB",
                      "defaultValue": "tsdbadmin"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Client alias, scrubbed inside the container",
                      "defaultValue": "${{APP_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Client alias, scrubbed inside the container",
                      "defaultValue": "${{APP_PASSWORD}}"
                    },
                    "APP_PASSWORD": {
                      "isOptional": false,
                      "description": "Application role password",
                      "defaultValue": "{{APP_PASSWORD}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "postgresql://${{APP_USER}}:${{APP_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{APP_DB}}"
                    },
                    "POSTGRES_SSL": {
                      "isOptional": false,
                      "description": "Serve TLS with a generated certificate",
                      "defaultValue": "on"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password, set on first boot",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "External connection string",
                      "defaultValue": "postgresql://${{APP_USER}}:${{APP_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{APP_DB}}?sslmode=require"
                    },
                    "TIMESCALEDB_TELEMETRY": {
                      "isOptional": false,
                      "description": "Upstream telemetry, off by default",
                      "defaultValue": "off"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "5432": {}
                    }
                  },
                  "volumeMounts": {
                    "a934fe3c-65bb-4208-8e15-31f66e32eb58": {
                      "mountPath": "/home/postgres/pgdata"
                    }
                  }
                },
                "c823e7d3-b962-4390-a037-c4c596e0634d": {
                  "icon": "https://raw.githubusercontent.com/sosedoff/pgweb/master/static/img/icon.png",
                  "name": "pgweb",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'exec /usr/bin/pgweb --bind=0.0.0.0 --listen=8081 --skip-open --lock-session --open-retry=60 --open-retry-delay=5 --metrics --metrics-addr=:9090 --metrics-path=/metrics --auth-user=\"$PGWEB_AUTH_USER\" --auth-pass=\"$PGWEB_AUTH_PASS\"'",
                    "healthcheckPath": "/metrics",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "sosedoff/pgweb:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Anonymous metrics listener, used for health checks",
                      "defaultValue": "9090"
                    },
                    "PGWEB_AUTH_PASS": {
                      "isOptional": false,
                      "description": "HTTP basic auth password",
                      "defaultValue": "{{PGWEB_AUTH_PASS}}"
                    },
                    "PGWEB_AUTH_USER": {
                      "isOptional": false,
                      "description": "HTTP basic auth username",
                      "defaultValue": "admin"
                    },
                    "PGWEB_DATABASE_URL": {
                      "isOptional": false,
                      "description": "Database the console is locked to",
                      "defaultValue": "${{TimescaleDB.DATABASE_URL}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8081": {
                        "port": 8081
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "pgweb",
      "method": "GET",
      "path": "/metrics",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-19T14:50:51.369Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_95a0c94df116480b8ff3",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": false,
        "detail": "got 401, expected 200"
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ]
  }
}
