{
  "manifest_version": "1.0.0",
  "template": {
    "id": "2a250a45-9d8b-4fb6-bb4c-5c0d4aa803b6",
    "slug": "clingysocks",
    "name": "ClingySOCKs",
    "description": "Deploy your own AI agents with relational memory engine instantly",
    "url": "https://railway.com/deploy/clingysocks",
    "upstream": {
      "image": "ghcr.io/baysuk728/clingysocks-frontend:latest"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "frontend",
      "source": {
        "image": "ghcr.io/baysuk728/clingysocks-frontend:latest"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "backend",
      "source": {
        "image": "ghcr.io/baysuk728/clingysocks-backend:latest"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Internal database variable. Do not modify!",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Internal database variable. Do not modify!",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Internal database variable. Do not modify!",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Internal database variable. Do not modify!",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Internal database variable. Do not modify!",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Internal database variable. Do not modify!",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Internal database variable. Do not modify!",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Internal database variable. Do not modify!",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Internal database variable. Do not modify!",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "Internal database variable. Do not modify!",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PORT",
      "service": "frontend",
      "description": "Internal variable. Do not modify!",
      "secret": false,
      "strategy": "default",
      "default": "80"
    },
    {
      "key": "VITE_MEMORY_API_URL",
      "service": "frontend",
      "description": "uto-generated link to your backend API. Do not modify.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "JWT_SECRET",
      "service": "backend",
      "description": "JWT secret for local auth tokens (auto-generated if empty, set for production)",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "CORS_ORIGINS",
      "service": "backend",
      "description": "Internal variable. Do not modify!",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "DATABASE_URL",
      "service": "backend",
      "description": "Internal variable. Do not modify!",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ENCRYPTION_KEY",
      "service": "backend",
      "description": "Encryption key for API keys stored in DB (64 hex chars or passphrase)",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "REQUIRE_SECRETS",
      "service": "backend",
      "description": "Set to true to refuse startup without ENCRYPTION_KEY and JWT_SECRET",
      "secret": true,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "OPENROUTER_API_KEY",
      "service": "backend",
      "description": "REQUIRED: Your OpenRouter API key. Get one at https://openrouter.ai/keys — This is the only key you need to start using the app!",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "clingysocks"
      }
    },
    "cli": "railway deploy --template clingysocks",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "2a250a45-9d8b-4fb6-bb4c-5c0d4aa803b6",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "07860624-42f2-4855-8332-e640aa77fce0": {
                  "icon": "https://devicons.railway.app/i/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": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": ""
                    },
                    "PGUSER": {
                      "isOptional": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": "postgres"
                    },
                    "DATABASE_URL": {
                      "isOptional": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": ""
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": true,
                      "description": "Internal database variable. Do not modify!",
                      "defaultValue": ""
                    }
                  },
                  "volumeMounts": {
                    "07860624-42f2-4855-8332-e640aa77fce0": {
                      "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."
                  }
                },
                "9c420dfd-133d-46be-9871-d0b6425cf4f2": {
                  "name": "frontend",
                  "source": {
                    "image": "ghcr.io/baysuk728/clingysocks-frontend:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": true,
                      "description": "Internal variable. Do not modify!",
                      "defaultValue": "80"
                    },
                    "VITE_MEMORY_API_URL": {
                      "description": "uto-generated link to your backend API. Do not modify.",
                      "defaultValue": "https://${{backend.RAILWAY_PUBLIC_DOMAIN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:80": {
                        "port": 80
                      }
                    }
                  }
                },
                "ccb402ed-3a97-4f8d-a032-7560a4086607": {
                  "name": "backend",
                  "source": {
                    "image": "ghcr.io/baysuk728/clingysocks-backend:latest"
                  },
                  "variables": {
                    "JWT_SECRET": {
                      "description": "JWT secret for local auth tokens (auto-generated if empty, set for production)",
                      "defaultValue": "{{JWT_SECRET}}"
                    },
                    "CORS_ORIGINS": {
                      "description": "Internal variable. Do not modify!",
                      "defaultValue": "https://${{frontend.RAILWAY_PUBLIC_DOMAIN}}, http://localhost:5173"
                    },
                    "DATABASE_URL": {
                      "description": "Internal variable. Do not modify!",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "ENCRYPTION_KEY": {
                      "description": "Encryption key for API keys stored in DB (64 hex chars or passphrase)",
                      "defaultValue": "{{ENCRYPTION_KEY}}"
                    },
                    "REQUIRE_SECRETS": {
                      "description": "Set to true to refuse startup without ENCRYPTION_KEY and JWT_SECRET",
                      "defaultValue": "true"
                    },
                    "OPENROUTER_API_KEY": {
                      "description": "REQUIRED: Your OpenRouter API key. Get one at https://openrouter.ai/keys — This is the only key you need to start using the app!",
                      "defaultValue": "{{OPENROUTER_API_KEY}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-19T22:14:40.433Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-18T06:35:24.694Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_37a2521f0a3d4ae2b9c2",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 78,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "backend"
  }
}
