{
  "manifest_version": "1.0.0",
  "template": {
    "id": "0398b041-2f1c-4e59-9a64-486b741c52d0",
    "slug": "electricsql",
    "name": "ElectricSQL",
    "description": "Streams live rows from Postgres to apps over a simple HTTP API",
    "url": "https://railway.com/deploy/electricsql",
    "upstream": {
      "repo_url": "https://github.com/gridalpha/electricsql-railway"
    }
  },
  "services": [
    {
      "name": "cache",
      "source": {
        "repo": "https://github.com/gridalpha/electricsql-railway"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "electric",
      "source": {
        "image": "electricsql/electric:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "Postgres",
      "source": {
        "repo": "https://github.com/gridalpha/electricsql-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "cache",
      "description": "Public listening port",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "ELECTRIC_UPSTREAM",
      "service": "cache",
      "description": "Sync service host and port",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "cache",
      "description": "Dockerfile built for this service",
      "secret": false,
      "strategy": "default",
      "default": "cache/Dockerfile"
    },
    {
      "key": "NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE",
      "service": "cache",
      "description": "Size workers from the cgroup quota",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "PORT",
      "service": "electric",
      "description": "Port Railway health-checks",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "ERL_AFLAGS",
      "service": "electric",
      "description": "Cap BEAM schedulers to the quota",
      "secret": false,
      "strategy": "default",
      "default": "+S 8:8 +SDio 8"
    },
    {
      "key": "DATABASE_URL",
      "service": "electric",
      "description": "Postgres connection, REPLICATION role",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ELECTRIC_PORT",
      "service": "electric",
      "description": "HTTP API listening port",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "ELECTRIC_SECRET",
      "service": "electric",
      "description": "Required on every shape request",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "ELECTRIC_LOG_LEVEL",
      "service": "electric",
      "description": "Log verbosity",
      "secret": false,
      "strategy": "default",
      "default": "info"
    },
    {
      "key": "ELECTRIC_STORAGE_DIR",
      "service": "electric",
      "description": "Shape logs on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/data/electric"
    },
    {
      "key": "ELECTRIC_DB_POOL_SIZE",
      "service": "electric",
      "description": "Connections used for shape queries",
      "secret": false,
      "strategy": "default",
      "default": "20"
    },
    {
      "key": "ELECTRIC_LISTEN_ON_IPV6",
      "service": "electric",
      "description": "Reachable over private networking",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "ELECTRIC_DATABASE_USE_IPV6",
      "service": "electric",
      "description": "Prefer the database AAAA record",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "ELECTRIC_CONSUMER_PARTITIONS",
      "service": "electric",
      "description": "Match the container CPU quota",
      "secret": false,
      "strategy": "default",
      "default": "8"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Cluster location on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Private connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "SSL certificate expiry in days",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Superuser password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "Postgres",
      "description": "Dockerfile built for this service",
      "secret": false,
      "strategy": "default",
      "default": "postgres/Dockerfile"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Clean shutdown window",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "electricsql"
      }
    },
    "cli": "railway deploy --template electricsql",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "0398b041-2f1c-4e59-9a64-486b741c52d0",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "2999ee03-305e-4807-aa94-1e0473256b45": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/nginx.svg",
                  "name": "cache",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/healthz",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/electricsql-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Public listening port",
                      "defaultValue": "8080"
                    },
                    "ELECTRIC_UPSTREAM": {
                      "isOptional": false,
                      "description": "Sync service host and port",
                      "defaultValue": "${{electric.RAILWAY_PRIVATE_DOMAIN}}:3000"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": false,
                      "description": "Dockerfile built for this service",
                      "defaultValue": "cache/Dockerfile"
                    },
                    "NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE": {
                      "isOptional": false,
                      "description": "Size workers from the cgroup quota",
                      "defaultValue": "1"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                },
                "a2a1f1d6-2437-452a-a6d1-788c08268d26": {
                  "icon": "https://raw.githubusercontent.com/electric-sql/electric/main/website/public/img/brand/favicon.svg",
                  "name": "electric",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/v1/health",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "electricsql/electric:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway health-checks",
                      "defaultValue": "3000"
                    },
                    "ERL_AFLAGS": {
                      "isOptional": false,
                      "description": "Cap BEAM schedulers to the quota",
                      "defaultValue": "+S 8:8 +SDio 8"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Postgres connection, REPLICATION role",
                      "defaultValue": "${{Postgres.DATABASE_URL}}?sslmode=require"
                    },
                    "ELECTRIC_PORT": {
                      "isOptional": false,
                      "description": "HTTP API listening port",
                      "defaultValue": "3000"
                    },
                    "ELECTRIC_SECRET": {
                      "isOptional": false,
                      "description": "Required on every shape request",
                      "defaultValue": "{{ELECTRIC_SECRET}}"
                    },
                    "ELECTRIC_LOG_LEVEL": {
                      "isOptional": false,
                      "description": "Log verbosity",
                      "defaultValue": "info"
                    },
                    "ELECTRIC_STORAGE_DIR": {
                      "isOptional": false,
                      "description": "Shape logs on the volume",
                      "defaultValue": "/data/electric"
                    },
                    "ELECTRIC_DB_POOL_SIZE": {
                      "isOptional": false,
                      "description": "Connections used for shape queries",
                      "defaultValue": "20"
                    },
                    "ELECTRIC_LISTEN_ON_IPV6": {
                      "isOptional": false,
                      "description": "Reachable over private networking",
                      "defaultValue": "true"
                    },
                    "ELECTRIC_DATABASE_USE_IPV6": {
                      "isOptional": false,
                      "description": "Prefer the database AAAA record",
                      "defaultValue": "true"
                    },
                    "ELECTRIC_CONSUMER_PARTITIONS": {
                      "isOptional": false,
                      "description": "Match the container CPU quota",
                      "defaultValue": "8"
                    }
                  },
                  "volumeMounts": {
                    "a2a1f1d6-2437-452a-a6d1-788c08268d26": {
                      "mountPath": "/data"
                    }
                  }
                },
                "e4290252-2885-49c2-bdf7-f50979c8e3ef": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": "wrapper.sh postgres -p 5432 -c listen_addresses=* -c wal_level=logical -c max_wal_senders=10 -c max_replication_slots=10",
                    "healthcheckPath": null,
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/electricsql-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Cluster location on the volume",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database created on first boot",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser created on first boot",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "SSL certificate expiry in days",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": false,
                      "description": "Dockerfile built for this service",
                      "defaultValue": "postgres/Dockerfile"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Clean shutdown window",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "e4290252-2885-49c2-bdf7-f50979c8e3ef": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "cache",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-21T22:14:44.200Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-21T20:08:00.469Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_7952a9c4b2174317848d",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 165,
    "typical_build_seconds": 17,
    "typical_start_seconds": 10,
    "slowest_service": "cache"
  }
}
