{
  "manifest_version": "1.0.0",
  "template": {
    "id": "b3a3d1d7-8274-4e14-bb53-cacaf1a7f47c",
    "slug": "postgresql-18-ha-cluster-ai-and-gis-read",
    "name": "🚀 PostgreSQL 18 HA Cluster (AI & GIS Ready)",
    "description": "🚀 Postgres 18 HA Cluster with AI, GIS, and Cron Extensions. Ready to scale",
    "url": "https://railway.com/deploy/postgresql-18-ha-cluster-ai-and-gis-read"
  },
  "services": [
    {
      "name": "postgres-18-primary",
      "source": {
        "repo": "https://github.com/icueth/railsway-timescaledb-replica"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "postgres-18-proxy",
      "source": {
        "repo": "https://github.com/icueth/railsway-timescaledb-replica"
      },
      "needs_volume": false,
      "tcp_ports": [
        5432
      ],
      "http": false
    },
    {
      "name": "postgres-18-replica",
      "source": {
        "repo": "https://github.com/icueth/railsway-timescaledb-replica"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "TZ",
      "service": "postgres-18-primary",
      "description": "Provide a value for TZ.",
      "secret": false,
      "strategy": "default",
      "default": "Asia/Bangkok"
    },
    {
      "key": "PGDATA",
      "service": "postgres-18-primary",
      "description": "Provide a value for PGDATA.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "NODE_ROLE",
      "service": "postgres-18-primary",
      "description": "Provide a value for NODE_ROLE.",
      "secret": false,
      "strategy": "default",
      "default": "PRIMARY"
    },
    {
      "key": "POSTGRES_DB",
      "service": "postgres-18-primary",
      "description": "Provide a value for POSTGRES_DB.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_USER",
      "service": "postgres-18-primary",
      "description": "Provide a value for POSTGRES_USER.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postgres-18-primary",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "default",
      "default": "yourstrongpassword"
    },
    {
      "key": "TZ",
      "service": "postgres-18-proxy",
      "description": "Provide a value for TZ.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NODE_ROLE",
      "service": "postgres-18-proxy",
      "description": "Provide a value for NODE_ROLE.",
      "secret": false,
      "strategy": "default",
      "default": "PROXY"
    },
    {
      "key": "POSTGRES_DB",
      "service": "postgres-18-proxy",
      "description": "Provide a value for POSTGRES_DB.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PRIMARY_HOST",
      "service": "postgres-18-proxy",
      "description": "Provide a value for PRIMARY_HOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REPLICA_HOST",
      "service": "postgres-18-proxy",
      "description": "Provide a value for REPLICA_HOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "postgres-18-proxy",
      "description": "Provide a value for POSTGRES_USER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postgres-18-proxy",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PUBLIC_CONNECTION_URL",
      "service": "postgres-18-proxy",
      "description": "Provide a value for PUBLIC_CONNECTION_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PRIVATE_CONNECTION_URL",
      "service": "postgres-18-proxy",
      "description": "Provide a value for PRIVATE_CONNECTION_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "TZ",
      "service": "postgres-18-replica",
      "description": "Provide a value for TZ.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATA",
      "service": "postgres-18-replica",
      "description": "Provide a value for PGDATA.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "NODE_ROLE",
      "service": "postgres-18-replica",
      "description": "Provide a value for NODE_ROLE.",
      "secret": false,
      "strategy": "default",
      "default": "REPLICA"
    },
    {
      "key": "POSTGRES_DB",
      "service": "postgres-18-replica",
      "description": "Provide a value for POSTGRES_DB.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PRIMARY_HOST",
      "service": "postgres-18-replica",
      "description": "Provide a value for PRIMARY_HOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "postgres-18-replica",
      "description": "Provide a value for POSTGRES_USER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postgres-18-replica",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "postgresql-18-ha-cluster-ai-and-gis-read"
      }
    },
    "cli": "railway deploy --template postgresql-18-ha-cluster-ai-and-gis-read",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "b3a3d1d7-8274-4e14-bb53-cacaf1a7f47c",
            "serializedConfig": {
              "services": {
                "3314a345-5d3a-4b50-9b95-e9dd58fef8b3": {
                  "icon": "https://devicons.railway.app/pos",
                  "name": "postgres-18-primary",
                  "source": {
                    "repo": "icueth/railsway-timescaledb-replica",
                    "branch": null,
                    "rootDirectory": "/postgresql-18-ha"
                  },
                  "variables": {
                    "TZ": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "Asia/Bangkok"
                    },
                    "PGDATA": {
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "NODE_ROLE": {
                      "defaultValue": "PRIMARY"
                    },
                    "POSTGRES_DB": {
                      "defaultValue": "postgres"
                    },
                    "POSTGRES_USER": {
                      "defaultValue": "postgres"
                    },
                    "POSTGRES_PASSWORD": {
                      "defaultValue": "yourstrongpassword"
                    }
                  },
                  "volumeMounts": {
                    "3314a345-5d3a-4b50-9b95-e9dd58fef8b3": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "8d3625c6-094a-44b6-81c2-9c0bae471110": {
                  "icon": "https://devicons.railway.app/pos",
                  "name": "postgres-18-proxy",
                  "source": {
                    "repo": "icueth/railsway-timescaledb-replica",
                    "branch": null,
                    "rootDirectory": "/postgresql-18-ha"
                  },
                  "variables": {
                    "TZ": {
                      "isOptional": false,
                      "defaultValue": "${{postgres-18-primary.TZ}}"
                    },
                    "NODE_ROLE": {
                      "defaultValue": "PROXY"
                    },
                    "POSTGRES_DB": {
                      "defaultValue": "${{postgres-18-primary.POSTGRES_DB}}"
                    },
                    "PRIMARY_HOST": {
                      "defaultValue": "${{postgres-18-primary.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REPLICA_HOST": {
                      "defaultValue": "${{postgres-18-replica.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "POSTGRES_USER": {
                      "defaultValue": "${{postgres-18-primary.POSTGRES_USER}}"
                    },
                    "POSTGRES_PASSWORD": {
                      "defaultValue": "${{postgres-18-primary.POSTGRES_PASSWORD}}"
                    },
                    "PUBLIC_CONNECTION_URL": {
                      "defaultValue": "postgresql://${{postgres-18-primary.POSTGRES_USER}}:${{postgres-18-primary.POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{postgres-18-primary.POSTGRES_DB}}"
                    },
                    "PRIVATE_CONNECTION_URL": {
                      "defaultValue": "postgresql://${{postgres-18-primary.POSTGRES_USER}}:${{postgres-18-primary.POSTGRES_PASSWORD}}@${{postgres-18-primary.RAILWAY_PRIVATE_DOMAIN}}:5432/${{postgres-18-primary.POSTGRES_DB}}"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "5432": {}
                    }
                  }
                },
                "d026c2b9-404b-471a-b0e7-dfb9ac44ac1c": {
                  "icon": "https://devicons.railway.app/pos",
                  "name": "postgres-18-replica",
                  "source": {
                    "repo": "icueth/railsway-timescaledb-replica",
                    "branch": null,
                    "rootDirectory": "/postgresql-18-ha"
                  },
                  "variables": {
                    "TZ": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "${{postgres-18-primary.TZ}}"
                    },
                    "PGDATA": {
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "NODE_ROLE": {
                      "defaultValue": "REPLICA"
                    },
                    "POSTGRES_DB": {
                      "description": "",
                      "defaultValue": "${{postgres-18-primary.POSTGRES_DB}}"
                    },
                    "PRIMARY_HOST": {
                      "defaultValue": "${{postgres-18-primary.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "POSTGRES_USER": {
                      "description": "",
                      "defaultValue": "${{postgres-18-primary.POSTGRES_USER}}"
                    },
                    "POSTGRES_PASSWORD": {
                      "defaultValue": "${{postgres-18-primary.POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "d026c2b9-404b-471a-b0e7-dfb9ac44ac1c": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-16T16:14:44.185Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-16T05:38:46.466Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_04707f84811143fca740",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 191,
    "typical_build_seconds": 71,
    "typical_start_seconds": 10,
    "slowest_service": "postgres-18-proxy"
  }
}
