{
  "manifest_version": "1.0.0",
  "template": {
    "id": "af7ee0b8-1460-4d03-b5c8-566f4f5e3aba",
    "slug": "sqlpage",
    "name": "SQLPage",
    "description": "Build web apps in SQL: bundled Postgres, pages in the DB, browser editor",
    "url": "https://railway.com/deploy/sqlpage",
    "upstream": {
      "image": "ghcr.io/youssefsiam38/sqlpage-railway:1.0.0@sha256:a8c7bf3744495188430ce7953f7f4e32566cc28ea85c9a1ad944ba6e60c8c7a5"
    }
  },
  "services": [
    {
      "name": "sqlpage",
      "source": {
        "image": "ghcr.io/youssefsiam38/sqlpage-railway:1.0.0@sha256:a8c7bf3744495188430ce7953f7f4e32566cc28ea85c9a1ad944ba6e60c8c7a5"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "db",
      "source": {
        "image": "postgres:16.15@sha256:65b16a8b326e0cfbdf33fa7e783f2a0cb352a61448616ccccfd616ef42aa0f65"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "sqlpage",
      "description": "Port of the public front door (Caddy); the domain targets it. Keep 8080.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "SITE_ACCESS",
      "service": "sqlpage",
      "description": "private: every page needs the login. public: pages are open, only /admin/ needs the login.",
      "secret": false,
      "strategy": "default",
      "default": "private"
    },
    {
      "key": "DATABASE_URL",
      "service": "sqlpage",
      "description": "The bundled PostgreSQL on Railway's private network. Pages live in its sqlpage_files table.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "ADMIN_PASSWORD",
      "service": "sqlpage",
      "description": "Login password, generated. Copy it to sign in. At least 12 characters.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "ADMIN_USERNAME",
      "service": "sqlpage",
      "description": "Login user for the site and the /admin/ page editor.",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "SQLPAGE_ENVIRONMENT",
      "service": "sqlpage",
      "description": "production hides SQL errors from visitors; development shows them (handy while building).",
      "secret": false,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "RAILWAY_HEALTHCHECK_TIMEOUT_SEC",
      "service": "sqlpage",
      "description": "The first start waits for PostgreSQL and runs migrations.",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "PGDATA",
      "service": "db",
      "description": "Data directory inside the volume (the volume root holds lost+found).",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "db",
      "description": "PostgreSQL database.",
      "secret": false,
      "strategy": "default",
      "default": "sqlpage"
    },
    {
      "key": "POSTGRES_USER",
      "service": "db",
      "description": "PostgreSQL user.",
      "secret": false,
      "strategy": "default",
      "default": "sqlpage"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "db",
      "description": "PostgreSQL password, generated.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "sqlpage"
      }
    },
    "cli": "railway deploy --template sqlpage",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "af7ee0b8-1460-4d03-b5c8-566f4f5e3aba",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "071c8ef6-9352-4055-8819-436e9ffd68e9": {
                  "icon": null,
                  "name": "sqlpage",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/healthz",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/youssefsiam38/sqlpage-railway:1.0.0@sha256:a8c7bf3744495188430ce7953f7f4e32566cc28ea85c9a1ad944ba6e60c8c7a5"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port of the public front door (Caddy); the domain targets it. Keep 8080.",
                      "defaultValue": "8080"
                    },
                    "SMTP_HOST": {
                      "isOptional": true,
                      "description": "Optional. SMTP host for sqlpage.send_mail."
                    },
                    "SITE_ACCESS": {
                      "isOptional": false,
                      "description": "private: every page needs the login. public: pages are open, only /admin/ needs the login.",
                      "defaultValue": "private"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "The bundled PostgreSQL on Railway's private network. Pages live in its sqlpage_files table.",
                      "defaultValue": "postgres://${{db.POSTGRES_USER}}:${{db.POSTGRES_PASSWORD}}@${{db.RAILWAY_PRIVATE_DOMAIN}}:5432/${{db.POSTGRES_DB}}"
                    },
                    "ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Login password, generated. Copy it to sign in. At least 12 characters.",
                      "defaultValue": "{{ADMIN_PASSWORD}}"
                    },
                    "ADMIN_USERNAME": {
                      "isOptional": false,
                      "description": "Login user for the site and the /admin/ page editor.",
                      "defaultValue": "admin"
                    },
                    "SQLPAGE_ENVIRONMENT": {
                      "isOptional": false,
                      "description": "production hides SQL errors from visitors; development shows them (handy while building).",
                      "defaultValue": "production"
                    },
                    "SQLPAGE_SITE_PREFIX": {
                      "isOptional": true,
                      "description": "Optional. Serve under a sub-path, e.g. /app/."
                    },
                    "SQLPAGE_MAX_UPLOADED_FILE_SIZE": {
                      "isOptional": true,
                      "description": "Optional. Maximum form/upload size in bytes (default 5 MiB)."
                    },
                    "RAILWAY_HEALTHCHECK_TIMEOUT_SEC": {
                      "isOptional": false,
                      "description": "The first start waits for PostgreSQL and runs migrations.",
                      "defaultValue": "300"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                },
                "ec2340c8-7f10-4a74-ba2b-07f1195f82d6": {
                  "icon": null,
                  "name": "db",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "postgres:16.15@sha256:65b16a8b326e0cfbdf33fa7e783f2a0cb352a61448616ccccfd616ef42aa0f65"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Data directory inside the volume (the volume root holds lost+found).",
                      "defaultValue": "/var/lib/postgresql/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "PostgreSQL database.",
                      "defaultValue": "sqlpage"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "PostgreSQL user.",
                      "defaultValue": "sqlpage"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "PostgreSQL password, generated.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "ec2340c8-7f10-4a74-ba2b-07f1195f82d6": {
                      "mountPath": "/var/lib/postgresql"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "sqlpage",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-10-07T10:14:36.716Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-10-07T09:44:24.348Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_a4ad4cb0b5a8436ba035",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 130,
    "typical_build_seconds": 0,
    "typical_start_seconds": 20,
    "slowest_service": "sqlpage"
  }
}
