{
  "manifest_version": "1.0.0",
  "template": {
    "id": "3a61f077-63b9-45ff-a002-f2f1866ecaf0",
    "slug": "postgrest-api",
    "name": "PostgREST",
    "description": "REST API served straight out of a PostgreSQL schema, with Swagger UI",
    "url": "https://railway.com/deploy/postgrest-api",
    "upstream": {
      "repo_url": "https://github.com/gridalpha/postgrest-railway"
    }
  },
  "services": [
    {
      "name": "postgrest",
      "source": {
        "repo": "https://github.com/gridalpha/postgrest-railway"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "swagger-ui",
      "source": {
        "image": "swaggerapi/swagger-ui:latest"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "postgrest",
      "description": "Port Railway health-checks, the admin server",
      "secret": false,
      "strategy": "default",
      "default": "3001"
    },
    {
      "key": "DATABASE_URL",
      "service": "postgrest",
      "description": "Admin connection, bootstrap only",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "API_USER_EMAIL",
      "service": "postgrest",
      "description": "First API account, change before deploying",
      "secret": false,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "PGRST_BOOTSTRAP",
      "service": "postgrest",
      "description": "Create roles and schema on boot",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "PGRST_LOG_LEVEL",
      "service": "postgrest",
      "description": "Log level, info logs every request",
      "secret": false,
      "strategy": "default",
      "default": "warn"
    },
    {
      "key": "PGRST_SEED_DEMO",
      "service": "postgrest",
      "description": "Create the demo todos table",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "PGRST_DB_SCHEMAS",
      "service": "postgrest",
      "description": "Schemas exposed as endpoints",
      "secret": false,
      "strategy": "default",
      "default": "api"
    },
    {
      "key": "PGRST_JWT_SECRET",
      "service": "postgrest",
      "description": "HS256 key signing and verifying tokens",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "API_USER_PASSWORD",
      "service": "postgrest",
      "description": "First API account password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PGRST_DB_MAX_ROWS",
      "service": "postgrest",
      "description": "Maximum rows returned per request",
      "secret": false,
      "strategy": "default",
      "default": "1000"
    },
    {
      "key": "PGRST_SERVER_HOST",
      "service": "postgrest",
      "description": "Dual-stack bind, reachable privately",
      "secret": false,
      "strategy": "default",
      "default": "*6"
    },
    {
      "key": "PGRST_SERVER_PORT",
      "service": "postgrest",
      "description": "Public API listening port",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "PGRST_DB_ANON_ROLE",
      "service": "postgrest",
      "description": "Role used for unauthenticated requests",
      "secret": false,
      "strategy": "default",
      "default": "anon"
    },
    {
      "key": "JWT_LIFETIME_SECONDS",
      "service": "postgrest",
      "description": "Lifetime of issued tokens",
      "secret": false,
      "strategy": "default",
      "default": "3600"
    },
    {
      "key": "AUTHENTICATOR_PASSWORD",
      "service": "postgrest",
      "description": "Password for the low-privilege API role",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PGRST_ADMIN_SERVER_PORT",
      "service": "postgrest",
      "description": "Admin server with live, ready, metrics",
      "secret": false,
      "strategy": "default",
      "default": "3001"
    },
    {
      "key": "PGRST_OPENAPI_SECURITY_ACTIVE",
      "service": "postgrest",
      "description": "Adds JWT security to OpenAPI output",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "URL",
      "service": "swagger-ui",
      "description": "OpenAPI document the console loads",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PORT",
      "service": "swagger-ui",
      "description": "HTTP server listening port",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "FILTER",
      "service": "swagger-ui",
      "description": "Show the tag filter box",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "DEEP_LINKING",
      "service": "swagger-ui",
      "description": "Link directly to individual operations",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "DOC_EXPANSION",
      "service": "swagger-ui",
      "description": "Expand tags but not operations",
      "secret": false,
      "strategy": "default",
      "default": "list"
    },
    {
      "key": "VALIDATOR_URL",
      "service": "swagger-ui",
      "description": "Disable the external spec validator",
      "secret": false,
      "strategy": "default",
      "default": "none"
    },
    {
      "key": "TRY_IT_OUT_ENABLED",
      "service": "swagger-ui",
      "description": "Enable Try it out by default",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "PERSIST_AUTHORIZATION",
      "service": "swagger-ui",
      "description": "Keep the token across page reloads",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "DISPLAY_REQUEST_DURATION",
      "service": "swagger-ui",
      "description": "Show request timings in responses",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE",
      "service": "swagger-ui",
      "description": "Size nginx workers to the container",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "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_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": "postgrest-api"
      }
    },
    "cli": "railway deploy --template postgrest-api",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "3a61f077-63b9-45ff-a002-f2f1866ecaf0",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "0ea06653-f651-48e9-9783-b0c895d994ad": {
                  "icon": "https://avatars.githubusercontent.com/u/15115011",
                  "name": "postgrest",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/ready",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/postgrest-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway health-checks, the admin server",
                      "defaultValue": "3001"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Admin connection, bootstrap only",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "API_USER_EMAIL": {
                      "isOptional": false,
                      "description": "First API account, change before deploying",
                      "defaultValue": "admin@example.com"
                    },
                    "PGRST_BOOTSTRAP": {
                      "isOptional": false,
                      "description": "Create roles and schema on boot",
                      "defaultValue": "true"
                    },
                    "PGRST_LOG_LEVEL": {
                      "isOptional": false,
                      "description": "Log level, info logs every request",
                      "defaultValue": "warn"
                    },
                    "PGRST_SEED_DEMO": {
                      "isOptional": false,
                      "description": "Create the demo todos table",
                      "defaultValue": "true"
                    },
                    "PGRST_DB_SCHEMAS": {
                      "isOptional": false,
                      "description": "Schemas exposed as endpoints",
                      "defaultValue": "api"
                    },
                    "PGRST_JWT_SECRET": {
                      "isOptional": false,
                      "description": "HS256 key signing and verifying tokens",
                      "defaultValue": "{{PGRST_JWT_SECRET}}"
                    },
                    "API_USER_PASSWORD": {
                      "isOptional": false,
                      "description": "First API account password",
                      "defaultValue": "{{API_USER_PASSWORD}}"
                    },
                    "PGRST_DB_MAX_ROWS": {
                      "isOptional": false,
                      "description": "Maximum rows returned per request",
                      "defaultValue": "1000"
                    },
                    "PGRST_SERVER_HOST": {
                      "isOptional": false,
                      "description": "Dual-stack bind, reachable privately",
                      "defaultValue": "*6"
                    },
                    "PGRST_SERVER_PORT": {
                      "isOptional": false,
                      "description": "Public API listening port",
                      "defaultValue": "3000"
                    },
                    "PGRST_DB_ANON_ROLE": {
                      "isOptional": false,
                      "description": "Role used for unauthenticated requests",
                      "defaultValue": "anon"
                    },
                    "JWT_LIFETIME_SECONDS": {
                      "isOptional": false,
                      "description": "Lifetime of issued tokens",
                      "defaultValue": "3600"
                    },
                    "AUTHENTICATOR_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the low-privilege API role",
                      "defaultValue": "{{AUTHENTICATOR_PASSWORD}}"
                    },
                    "PGRST_ADMIN_SERVER_PORT": {
                      "isOptional": false,
                      "description": "Admin server with live, ready, metrics",
                      "defaultValue": "3001"
                    },
                    "PGRST_OPENAPI_SECURITY_ACTIVE": {
                      "isOptional": false,
                      "description": "Adds JWT security to OpenAPI output",
                      "defaultValue": "true"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:3000": {
                        "port": 3000
                      }
                    }
                  }
                },
                "7d4d73d6-f95b-4360-9820-2b070291acd3": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/swagger.svg",
                  "name": "swagger-ui",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "swaggerapi/swagger-ui:latest"
                  },
                  "variables": {
                    "URL": {
                      "isOptional": false,
                      "description": "OpenAPI document the console loads",
                      "defaultValue": "https://${{postgrest.RAILWAY_PUBLIC_DOMAIN}}/"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP server listening port",
                      "defaultValue": "8080"
                    },
                    "FILTER": {
                      "isOptional": false,
                      "description": "Show the tag filter box",
                      "defaultValue": "true"
                    },
                    "DEEP_LINKING": {
                      "isOptional": false,
                      "description": "Link directly to individual operations",
                      "defaultValue": "true"
                    },
                    "DOC_EXPANSION": {
                      "isOptional": false,
                      "description": "Expand tags but not operations",
                      "defaultValue": "list"
                    },
                    "VALIDATOR_URL": {
                      "isOptional": false,
                      "description": "Disable the external spec validator",
                      "defaultValue": "none"
                    },
                    "TRY_IT_OUT_ENABLED": {
                      "isOptional": false,
                      "description": "Enable Try it out by default",
                      "defaultValue": "true"
                    },
                    "PERSIST_AUTHORIZATION": {
                      "isOptional": false,
                      "description": "Keep the token across page reloads",
                      "defaultValue": "true"
                    },
                    "DISPLAY_REQUEST_DURATION": {
                      "isOptional": false,
                      "description": "Show request timings in responses",
                      "defaultValue": "true"
                    },
                    "NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE": {
                      "isOptional": false,
                      "description": "Size nginx workers to the container",
                      "defaultValue": "1"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                },
                "c0ee0d60-e32f-4fa5-a085-2d65237f48d6": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/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": "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_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Clean shutdown window",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "c0ee0d60-e32f-4fa5-a085-2d65237f48d6": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "postgrest",
      "method": "GET",
      "path": "/ready",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-21T22:14:44.200Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-21T20:13:36.023Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_4a8909f927524c338353",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": false,
        "detail": "got 404, expected 200"
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ]
  }
}
