{
  "manifest_version": "1.0.0",
  "template": {
    "id": "a87df1af-281e-4773-986d-544cf3a400de",
    "slug": "photoflow",
    "name": "Photoflow",
    "description": "System for manging photo distribution at events",
    "url": "https://railway.com/deploy/photoflow",
    "upstream": {
      "repo_url": "https://github.com/sterno/photoflow"
    }
  },
  "services": [
    {
      "name": "photo-flow",
      "source": {
        "repo": "https://github.com/sterno/photoflow"
      },
      "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",
      "tcp_ports": [
        5432
      ],
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "AWS_REGION",
      "service": "photo-flow",
      "description": "Storage region — provided by the Bucket service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "AUTH_SECRET",
      "service": "photo-flow",
      "description": "Secret value configured automatically",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "S3_ENDPOINT",
      "service": "photo-flow",
      "description": "S3 endpoint — provided by the Bucket service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_URL",
      "service": "photo-flow",
      "description": "Database URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXTAUTH_URL",
      "service": "photo-flow",
      "description": "Public URL of the app — uses the domain Railway assigns to this service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "AWS_S3_BUCKET",
      "service": "photo-flow",
      "description": "Bucket name for uploaded photos — provided by the Bucket service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ADMIN_PASSWORD",
      "service": "photo-flow",
      "description": "Password for the first admin account — at least 12 characters.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "ADMIN_USERNAME",
      "service": "photo-flow",
      "description": "Login name for the first admin account.",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "NEXTAUTH_SECRET",
      "service": "photo-flow",
      "description": "Must equal AUTH_SECRET — mirrors it automatically; no need to change.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "AWS_ACCESS_KEY_ID",
      "service": "photo-flow",
      "description": "Access key for the Bucket storage service.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "S3_FORCE_PATH_STYLE",
      "service": "photo-flow",
      "description": "Use path-style addressing (required for MinIO/Bucket-style storage).",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "AWS_SECRET_ACCESS_KEY",
      "service": "photo-flow",
      "description": "Secret key for the Bucket storage service.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Location where the database will be initialized",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Railway Private Domain Name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Port to connect to Postgres.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Required variable for Data panel",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Required variable for the data panel.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Required variable for Data panel",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Default database created when image is started.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "URL to connect to Postgres database.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "User to connect to Postgres DB",
      "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": "Password to connect to DB",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "Public URL to connect to Postgres database, used by the Data panel.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Allow Postgres to cleanly shut down",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "photoflow"
      }
    },
    "cli": "railway deploy --template photoflow",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "a87df1af-281e-4773-986d-544cf3a400de",
            "serializedConfig": {
              "buckets": {
                "06dbf02b-2fa7-47e4-a469-a735e74d2706": {
                  "name": "Bucket"
                }
              },
              "services": {
                "031df721-c842-44e6-9893-5791997752af": {
                  "icon": "https://github.com/sterno/photo-flow/blob/main/public/logo.png",
                  "name": "photo-flow",
                  "deploy": {
                    "healthcheckPath": "/about"
                  },
                  "source": {
                    "repo": "sterno/photoflow",
                    "branch": null,
                    "rootDirectory": null
                  },
                  "variables": {
                    "AWS_REGION": {
                      "description": "Storage region — provided by the Bucket service.",
                      "defaultValue": "${{Bucket.REGION}}"
                    },
                    "AUTH_SECRET": {
                      "description": "Secret value configured automatically",
                      "defaultValue": "{{AUTH_SECRET}}"
                    },
                    "S3_ENDPOINT": {
                      "description": "S3 endpoint — provided by the Bucket service.",
                      "defaultValue": "${{Bucket.ENDPOINT}}"
                    },
                    "DATABASE_URL": {
                      "description": "Database URL",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "NEXTAUTH_URL": {
                      "description": "Public URL of the app — uses the domain Railway assigns to this service.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "AWS_S3_BUCKET": {
                      "description": "Bucket name for uploaded photos — provided by the Bucket service.",
                      "defaultValue": "${{Bucket.BUCKET}}"
                    },
                    "ADMIN_PASSWORD": {
                      "description": "Password for the first admin account — at least 12 characters.",
                      "defaultValue": "{{ADMIN_PASSWORD}}"
                    },
                    "ADMIN_USERNAME": {
                      "description": "Login name for the first admin account.",
                      "defaultValue": "admin"
                    },
                    "RESEND_API_KEY": {
                      "isOptional": true,
                      "description": "Optional — Resend API key to enable password-reset emails. Leave blank to skip.",
                      "defaultValue": ""
                    },
                    "NEXTAUTH_SECRET": {
                      "description": "Must equal AUTH_SECRET — mirrors it automatically; no need to change.",
                      "defaultValue": "${{AUTH_SECRET}}"
                    },
                    "ANTHROPIC_API_KEY": {
                      "isOptional": true,
                      "description": "Optional — Anthropic API key to enable AI photo captions and people detection. Leave blank to skip.",
                      "defaultValue": ""
                    },
                    "AWS_ACCESS_KEY_ID": {
                      "description": "Access key for the Bucket storage service.",
                      "defaultValue": "${{Bucket.ACCESS_KEY_ID}}"
                    },
                    "RESEND_FROM_EMAIL": {
                      "isOptional": true,
                      "description": "Optional — Resend From address for password-reset emails (e.g. noreply@yourdomain.com).",
                      "defaultValue": ""
                    },
                    "S3_FORCE_PATH_STYLE": {
                      "description": "Use path-style addressing (required for MinIO/Bucket-style storage).",
                      "defaultValue": "true"
                    },
                    "AWS_SECRET_ACCESS_KEY": {
                      "description": "Secret key for the Bucket storage service.",
                      "defaultValue": "${{Bucket.SECRET_ACCESS_KEY}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                },
                "04dfcdb3-5a2a-434c-8afb-d4d82b54fc02": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "build": {},
                  "deploy": {
                    "requiredMountPath": "/var/lib/postgresql/data"
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Location where the database will be initialized",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Railway Private Domain Name.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Port to connect to Postgres.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Required variable for Data panel",
                      "defaultValue": "${{ POSTGRES_USER }}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Required variable for the data panel.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Required variable for Data panel",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Default database created when image is started.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "URL to connect to Postgres database.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "User to connect to Postgres DB",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "description": "SSL certificate expiry in days.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Password to connect to DB",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "description": "Public URL to connect to Postgres database, used by the Data panel.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Allow Postgres to cleanly shut down",
                      "defaultValue": "60"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "5432": {}
                    },
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "04dfcdb3-5a2a-434c-8afb-d4d82b54fc02": {
                      "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."
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "photo-flow",
      "method": "GET",
      "path": "/about",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T10:14:37.339Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-20T09:22:14.471Z",
  "success_rate_30d": 0.1667,
  "validation": {
    "last_run_id": "run_93c28d5631074d498f0e",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": false,
        "detail": "Your workspace has been restricted. Please contact support to resolve this."
      }
    ],
    "typical_ready_seconds": 161,
    "typical_build_seconds": 122,
    "typical_start_seconds": 20,
    "slowest_service": "photo-flow"
  }
}
