{
  "manifest_version": "1.0.0",
  "template": {
    "id": "045805cb-1859-4fdf-9549-1a9ca9b82cd5",
    "slug": "powersync-or-just-updated-postgres-sync-",
    "name": "PowerSync | (Just Updated) Postgres Sync Engine, Keys And Demo Table Ready",
    "description": "PowerSync sync engine + Postgres, keys and demo table ready",
    "url": "https://railway.com/deploy/powersync-or-just-updated-postgres-sync-",
    "upstream": {
      "image": "journeyapps/powersync-service:1.26.1"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "postgres",
      "source": {
        "image": "postgres:18.4-alpine"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql",
      "http": false
    },
    {
      "name": "powersync",
      "source": {
        "image": "journeyapps/powersync-service:1.26.1"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postgres",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PS_PG_HOST",
      "service": "powersync",
      "description": "Provide a value for PS_PG_HOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PS_JWKS_KEY",
      "service": "powersync",
      "description": "Provide a value for PS_JWKS_KEY.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NODE_OPTIONS",
      "service": "powersync",
      "description": "Provide a value for NODE_OPTIONS.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "PS_API_TOKEN",
      "service": "powersync",
      "description": "Provide a value for PS_API_TOKEN.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PS_PG_PASSWORD",
      "service": "powersync",
      "description": "Provide a value for PS_PG_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "powersync-or-just-updated-postgres-sync-"
      }
    },
    "cli": "railway deploy --template powersync-or-just-updated-postgres-sync-",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "045805cb-1859-4fdf-9549-1a9ca9b82cd5",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "f997b60c-d72c-4712-9912-3c6866256c22": {
                  "icon": null,
                  "name": "postgres",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'mkdir -p /docker-entrypoint-initdb.d; cat > /docker-entrypoint-initdb.d/10-powersync.sql <<'\\''SQL'\\''\nCREATE DATABASE powersync_storage;\nCREATE TABLE lists (id uuid PRIMARY KEY DEFAULT gen_random_uuid(), name text NOT NULL, created_at timestamptz NOT NULL DEFAULT now());\nINSERT INTO lists (name) VALUES ('\\''Welcome to PowerSync'\\'');\nCREATE PUBLICATION powersync FOR ALL TABLES;\nSQL\nexport POSTGRES_USER=postgres POSTGRES_DB=powersync; exec docker-entrypoint.sh postgres -c wal_level=logical -c max_wal_senders=4 -c max_replication_slots=4'",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "postgres:18.4-alpine"
                  },
                  "variables": {
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "f997b60c-d72c-4712-9912-3c6866256c22": {
                      "mountPath": "/var/lib/postgresql"
                    }
                  }
                },
                "fb116848-b023-44ac-95cf-63345e916be5": {
                  "icon": null,
                  "name": "powersync",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'H=\"$PS_PG_HOST\"; P=\"$PS_PG_PASSWORD\"\nCFG=$(cat <<YAML\ntelemetry:\n  disable_telemetry_sharing: true\nreplication:\n  connections:\n    - type: postgresql\n      uri: postgresql://postgres:$P@$H:5432/powersync\n      sslmode: disable\nstorage:\n  type: postgresql\n  uri: postgresql://postgres:$P@$H:5432/powersync_storage\n  sslmode: disable\nport: ${PORT:-8080}\nsync_rules:\n  content: |\n    bucket_definitions:\n      global:\n        data:\n          - SELECT * FROM lists\nclient_auth:\n  jwks:\n    keys:\n      - kty: oct\n        alg: HS256\n        kid: powersync-dev\n        k: $PS_JWKS_KEY\n  audience: [\"powersync\"]\napi:\n  tokens:\n    - $PS_API_TOKEN\nYAML\n)\nexport POWERSYNC_CONFIG_B64=$(printf '\\''%s\\n'\\'' \"$CFG\" | base64 -w0)\nuntil node -e \"require('\\''net'\\'').connect(5432,process.env.PS_PG_HOST).on('\\''connect'\\'',()=>process.exit(0)).on('\\''error'\\'',()=>process.exit(1))\"; do echo \"[railway] waiting for postgres\"; sleep 3; done\nsleep 8\nexec node service/lib/entry.js start -r unified'",
                    "healthcheckPath": "/probes/liveness",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "journeyapps/powersync-service:1.26.1"
                  },
                  "variables": {
                    "PS_PG_HOST": {
                      "isOptional": false,
                      "defaultValue": "${{postgres.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PS_JWKS_KEY": {
                      "isOptional": false,
                      "defaultValue": "{{PS_JWKS_KEY}}"
                    },
                    "NODE_OPTIONS": {
                      "isOptional": false,
                      "defaultValue": "{{NODE_OPTIONS}}"
                    },
                    "PS_API_TOKEN": {
                      "isOptional": false,
                      "defaultValue": "{{PS_API_TOKEN}}"
                    },
                    "PS_PG_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "${{postgres.POSTGRES_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "powersync",
      "method": "GET",
      "path": "/probes/liveness",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-10-10T16:14:38.031Z",
  "generator_version": "0.1.0"
}
