{
  "manifest_version": "1.0.0",
  "template": {
    "id": "475085a0-3de9-46e3-a99f-eb32cb367163",
    "slug": "postbase",
    "name": "Postbase",
    "description": "The open-source alternative to Firebase and Supabase",
    "url": "https://railway.com/deploy/postbase",
    "upstream": {
      "repo_url": "https://github.com/harshalone/postbase"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "postbase",
      "source": {
        "repo": "https://github.com/harshalone/postbase"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Directory where PostgreSQL stores its data. Uses the default internal Postgres data path.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Internal hostname of the Postgres service within Railway’s private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Default PostgreSQL port used for internal connections.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Database user derived from the POSTGRES_USER variable.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Database name derived from the POSTGRES_DB variable.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Password mapped from POSTGRES_PASSWORD for client authentication.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Default database created during initialisation. Can be overridden if needed.",
      "secret": false,
      "strategy": "default",
      "default": "postbase"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Primary internal database connection string used by services within Railway.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Default PostgreSQL superuser created during setup.",
      "secret": false,
      "strategy": "default",
      "default": "postbase"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Validity period (in days) for generated SSL certificates.",
      "secret": false,
      "strategy": "default",
      "default": "365"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Secure auto-generated password for the PostgreSQL user.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "Public-facing connection string for external access (e.g. local development or admin tools).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Time Railway waits before shutting down old instances during deployment to allow in-flight requests to complete.",
      "secret": false,
      "strategy": "default",
      "default": "30"
    },
    {
      "key": "DATABASE_URL",
      "service": "postbase",
      "description": "Provide a value for DATABASE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXTAUTH_URL",
      "service": "postbase",
      "description": "Provide a value for NEXTAUTH_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "NEXTAUTH_SECRET",
      "service": "postbase",
      "description": "Provide a value for NEXTAUTH_SECRET.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "STORAGE_ACCESS_KEY",
      "service": "postbase",
      "description": "Provide a value for STORAGE_ACCESS_KEY.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "STORAGE_SECRET_KEY",
      "service": "postbase",
      "description": "Provide a value for STORAGE_SECRET_KEY.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "POSTBASE_JWT_SECRET",
      "service": "postbase",
      "description": "Provide a value for POSTBASE_JWT_SECRET.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "postbase"
      }
    },
    "cli": "railway deploy --template postbase",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "475085a0-3de9-46e3-a99f-eb32cb367163",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "486b6dcb-3327-4870-912f-e3e90aa11bce": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Directory where PostgreSQL stores its data. Uses the default internal Postgres data path.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Internal hostname of the Postgres service within Railway’s private network.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Default PostgreSQL port used for internal connections.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Database user derived from the POSTGRES_USER variable.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Database name derived from the POSTGRES_DB variable.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Password mapped from POSTGRES_PASSWORD for client authentication.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Default database created during initialisation. Can be overridden if needed.",
                      "defaultValue": "postbase"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Primary internal database connection string used by services within Railway.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:${{PGPORT}}/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Default PostgreSQL superuser created during setup.",
                      "defaultValue": "postbase"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Validity period (in days) for generated SSL certificates.",
                      "defaultValue": "365"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Secure auto-generated password for the PostgreSQL user.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Public-facing connection string for external access (e.g. local development or admin tools).",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Time Railway waits before shutting down old instances during deployment to allow in-flight requests to complete.",
                      "defaultValue": "30"
                    }
                  },
                  "volumeMounts": {
                    "486b6dcb-3327-4870-912f-e3e90aa11bce": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  },
                  "haTemplateCode": "postgres-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxy",
                      "options": [
                        2,
                        3,
                        4,
                        5
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "Routes traffic to the primary",
                      "defaultValue": 3
                    },
                    "replica": {
                      "label": "Replicas",
                      "options": [
                        2,
                        3,
                        4,
                        5,
                        6,
                        7
                      ],
                      "nodeLabel": "Postgres",
                      "description": "Streaming replicas for automatic failover",
                      "defaultValue": 2
                    },
                    "internal": {
                      "label": "Coordinator Nodes",
                      "options": [
                        3,
                        5,
                        7,
                        9
                      ],
                      "nodeLabel": "etcd",
                      "defaultValue": 3
                    },
                    "description": "This will convert your Postgres database to an HA cluster with Patroni failover and etcd consensus."
                  }
                },
                "99e7de09-ccbe-4f58-9883-ba2c9a5a233b": {
                  "icon": "https://www.getpostbase.com/assets/images/logo.png",
                  "name": "postbase",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/api/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/harshalone/postbase",
                    "rootDirectory": null
                  },
                  "variables": {
                    "DATABASE_URL": {
                      "isOptional": false,
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "NEXTAUTH_URL": {
                      "isOptional": false,
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "NEXTAUTH_SECRET": {
                      "isOptional": false,
                      "defaultValue": "{{NEXTAUTH_SECRET}}"
                    },
                    "STORAGE_ACCESS_KEY": {
                      "isOptional": false,
                      "defaultValue": "{{STORAGE_ACCESS_KEY}}"
                    },
                    "STORAGE_SECRET_KEY": {
                      "isOptional": false,
                      "defaultValue": "{{STORAGE_SECRET_KEY}}"
                    },
                    "POSTBASE_JWT_SECRET": {
                      "isOptional": false,
                      "defaultValue": "{{POSTBASE_JWT_SECRET}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "postbase",
      "method": "GET",
      "path": "/api/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-13T04:14:39.446Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-11T13:58:53.268Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_1fa15516c0ac4bad8fb3",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 153,
    "typical_build_seconds": 77,
    "typical_start_seconds": 10,
    "slowest_service": "postbase"
  }
}
