{
  "manifest_version": "1.0.0",
  "template": {
    "id": "0b207204-8dad-4b54-8a25-b6c062885567",
    "slug": "paperclip-production",
    "name": "Paperclip | Open-Source Control Plane for AI Agent Teams",
    "description": "Run a company of AI agents: org chart, goals, budgets, approvals. Postgres.",
    "url": "https://railway.com/deploy/paperclip-production",
    "upstream": {
      "repo_url": "https://github.com/nomideusz/paperclip-railway"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "Paperclip",
      "source": {
        "repo": "https://github.com/nomideusz/paperclip-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/paperclip",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Data subdirectory - keeps Postgres happy on Railway volumes",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database name",
      "secret": false,
      "strategy": "default",
      "default": "paperclip"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Database user",
      "secret": false,
      "strategy": "default",
      "default": "paperclip"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Auto-generated database password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Time for Postgres to shut down cleanly on redeploy",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "PORT",
      "service": "Paperclip",
      "description": "Port Paperclip listens on. Leave as is.",
      "secret": false,
      "strategy": "default",
      "default": "3100"
    },
    {
      "key": "ADMIN_EMAIL",
      "service": "Paperclip",
      "description": "Email for the first admin account, created on first boot. You sign in with it and ADMIN_PASSWORD.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "DATABASE_URL",
      "service": "Paperclip",
      "description": "Postgres connection over Railway's private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "ADMIN_PASSWORD",
      "service": "Paperclip",
      "description": "Password for the first admin account. Generated; read it here after deploy. Only used on first boot - change it in Paperclip afterwards.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PAPERCLIP_VERSION",
      "service": "Paperclip",
      "description": "Paperclip image tag to build from (github.com/paperclipai/paperclip/releases, without the v). Raise it and redeploy to upgrade; migrations run on start.",
      "secret": false,
      "strategy": "default",
      "default": "2026.1012.0"
    },
    {
      "key": "BETTER_AUTH_SECRET",
      "service": "Paperclip",
      "description": "Signs sessions and agent tokens. Generated; changing it signs everyone out.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PAPERCLIP_PUBLIC_URL",
      "service": "Paperclip",
      "description": "Public URL of this instance, used for sign-in, invite links and agent callbacks. Change it if you add a custom domain.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Paperclip",
      "description": "Time running agent jobs get to stop cleanly on redeploy.",
      "secret": false,
      "strategy": "default",
      "default": "90"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "paperclip-production"
      }
    },
    "cli": "railway deploy --template paperclip-production",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "0b207204-8dad-4b54-8a25-b6c062885567",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "0361a3a4-0eb8-4c69-b9fa-69aea48efa61": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "build": {},
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Data subdirectory - keeps Postgres happy on Railway volumes",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database name",
                      "defaultValue": "paperclip"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database user",
                      "defaultValue": "paperclip"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated database password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Time for Postgres to shut down cleanly on redeploy",
                      "defaultValue": "60"
                    }
                  },
                  "networking": {
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "634e4924-97b7-43d1-a42d-f68e9d15734e": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "40ce216b-8cc6-4372-a4b9-4df7030b0353": {
                  "icon": "https://raw.githubusercontent.com/nomideusz/paperclip-railway/main/icon.png",
                  "name": "Paperclip",
                  "build": {
                    "dockerfilePath": "Dockerfile"
                  },
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/api/health",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 600,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/nomideusz/paperclip-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Paperclip listens on. Leave as is.",
                      "defaultValue": "3100"
                    },
                    "ADMIN_EMAIL": {
                      "isOptional": false,
                      "description": "Email for the first admin account, created on first boot. You sign in with it and ADMIN_PASSWORD.",
                      "defaultValue": "{{ADMIN_EMAIL}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Postgres connection over Railway's private network.",
                      "defaultValue": "postgres://${{Postgres.POSTGRES_USER}}:${{Postgres.POSTGRES_PASSWORD}}@${{Postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/${{Postgres.POSTGRES_DB}}"
                    },
                    "ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the first admin account. Generated; read it here after deploy. Only used on first boot - change it in Paperclip afterwards.",
                      "defaultValue": "{{ADMIN_PASSWORD}}"
                    },
                    "OPENAI_API_KEY": {
                      "isOptional": true,
                      "description": "Optional. OpenAI API key for Codex agents (and OpenCode).",
                      "defaultValue": ""
                    },
                    "ANTHROPIC_API_KEY": {
                      "isOptional": true,
                      "description": "Optional. Anthropic API key for Claude Code agents. Or set CLAUDE_CODE_OAUTH_TOKEN to use a Claude subscription.",
                      "defaultValue": ""
                    },
                    "PAPERCLIP_VERSION": {
                      "isOptional": false,
                      "description": "Paperclip image tag to build from (github.com/paperclipai/paperclip/releases, without the v). Raise it and redeploy to upgrade; migrations run on start.",
                      "defaultValue": "2026.1012.0"
                    },
                    "BETTER_AUTH_SECRET": {
                      "isOptional": false,
                      "description": "Signs sessions and agent tokens. Generated; changing it signs everyone out.",
                      "defaultValue": "{{BETTER_AUTH_SECRET}}"
                    },
                    "PAPERCLIP_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Public URL of this instance, used for sign-in, invite links and agent callbacks. Change it if you add a custom domain.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "CLAUDE_CODE_OAUTH_TOKEN": {
                      "isOptional": true,
                      "description": "Optional. Claude subscription token for Claude Code agents, from `claude setup-token` on your machine.",
                      "defaultValue": ""
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Time running agent jobs get to stop cleanly on redeploy.",
                      "defaultValue": "90"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:3100": {
                        "port": 3100
                      }
                    }
                  },
                  "volumeMounts": {
                    "83415879-27c4-427f-bf61-acb2fff5b2c9": {
                      "mountPath": "/paperclip"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Paperclip",
      "method": "GET",
      "path": "/api/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-10-18T16:14:44.681Z",
  "generator_version": "0.1.0"
}
