{
  "manifest_version": "1.0.0",
  "template": {
    "id": "c399d91d-af42-4b62-ab98-0c1d611e4d09",
    "slug": "paperclip-latest-version",
    "name": "Paperclip Latest Version [Aug 26]",
    "description": "Deploy Latest Version of Paperclip in one click.",
    "url": "https://railway.com/deploy/paperclip-latest-version",
    "upstream": {
      "repo_url": "https://github.com/marco-quintella/paperclip-railway-template"
    }
  },
  "services": [
    {
      "name": "Paperclip",
      "source": {
        "repo": "https://github.com/marco-quintella/paperclip-railway-template"
      },
      "needs_volume": true,
      "volume_mount_path": "/paperclip",
      "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": "HOST",
      "service": "Paperclip",
      "description": "Host address where is reunning, keep 0.0.0.0 for local",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "PORT",
      "service": "Paperclip",
      "description": "Port where is running.",
      "secret": false,
      "strategy": "default",
      "default": "3100"
    },
    {
      "key": "SERVE_UI",
      "service": "Paperclip",
      "description": "Wheter the UI mode must be served",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "DATABASE_URL",
      "service": "Paperclip",
      "description": "Postgres database URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERCLIP_HOME",
      "service": "Paperclip",
      "description": "Home address",
      "secret": false,
      "strategy": "default",
      "default": "/paperclip"
    },
    {
      "key": "BETTER_AUTH_SECRET",
      "service": "Paperclip",
      "description": "Authentication Secret",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "BETTER_AUTH_BASE_URL",
      "service": "Paperclip",
      "description": "Base URL for Authentication Engine",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PAPERCLIP_PUBLIC_URL",
      "service": "Paperclip",
      "description": "Public accessible URL on the Web",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PAPERCLIP_DEPLOYMENT_MODE",
      "service": "Paperclip",
      "description": "Deployment Mode: keep authenticated to have protection",
      "secret": false,
      "strategy": "default",
      "default": "authenticated"
    },
    {
      "key": "PAPERCLIP_DEPLOYMENT_EXPOSURE",
      "service": "Paperclip",
      "description": "Kind of exposure you want",
      "secret": false,
      "strategy": "default",
      "default": "private"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Storage path",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Host path",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "DB Port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "DB Username",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "PG Database name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "DB Password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "DB name",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "DB URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "DB User",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "SSL Cert Days",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "DB Password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "DB Public URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Draining Secs",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "paperclip-latest-version"
      }
    },
    "cli": "railway deploy --template paperclip-latest-version",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "c399d91d-af42-4b62-ab98-0c1d611e4d09",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "7406636a-6f52-4e16-a434-777262e9f0da": {
                  "icon": "https://paperclip.ing/favicon.svg",
                  "name": "Paperclip",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/api/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/marco-quintella/paperclip-railway-template",
                    "rootDirectory": null
                  },
                  "variables": {
                    "HOST": {
                      "isOptional": false,
                      "description": "Host address where is reunning, keep 0.0.0.0 for local",
                      "defaultValue": "0.0.0.0"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "Port where is running.",
                      "defaultValue": "3100"
                    },
                    "SERVE_UI": {
                      "isOptional": false,
                      "description": "Wheter the UI mode must be served",
                      "defaultValue": "true"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Postgres database URL",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "PAPERCLIP_HOME": {
                      "isOptional": false,
                      "description": "Home address",
                      "defaultValue": "/paperclip"
                    },
                    "BETTER_AUTH_SECRET": {
                      "isOptional": false,
                      "description": "Authentication Secret",
                      "defaultValue": "{{BETTER_AUTH_SECRET}}"
                    },
                    "BETTER_AUTH_BASE_URL": {
                      "isOptional": false,
                      "description": "Base URL for Authentication Engine",
                      "defaultValue": "https://${{Paperclip.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "PAPERCLIP_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Public accessible URL on the Web",
                      "defaultValue": "https://${{Paperclip.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "PAPERCLIP_DEPLOYMENT_MODE": {
                      "isOptional": false,
                      "description": "Deployment Mode: keep authenticated to have protection",
                      "defaultValue": "authenticated"
                    },
                    "PAPERCLIP_DEPLOYMENT_EXPOSURE": {
                      "isOptional": false,
                      "description": "Kind of exposure you want",
                      "defaultValue": "private"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "7406636a-6f52-4e16-a434-777262e9f0da": {
                      "mountPath": "/paperclip"
                    }
                  }
                },
                "cadc69a8-a489-4eaa-ad10-7d36d1b2148e": {
                  "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": false,
                      "description": "Storage path",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Host path",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "DB Port",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "DB Username",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "PG Database name",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "DB Password",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "DB name",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "DB URL",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "DB User",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "SSL Cert Days",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "DB Password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "DB Public URL",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Draining Secs",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "cadc69a8-a489-4eaa-ad10-7d36d1b2148e": {
                      "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": "Paperclip",
      "method": "GET",
      "path": "/api/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-11T04:14:34.944Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-11T00:49:02.066Z",
  "success_rate_30d": 0.5,
  "validation": {
    "last_run_id": "run_c12680d199f3452587e4",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 376,
    "typical_build_seconds": 317,
    "typical_start_seconds": 41,
    "slowest_service": "Paperclip"
  }
}
