{
  "manifest_version": "1.0.0",
  "template": {
    "id": "14dc81a8-b06e-4378-a20a-1d12110e6c05",
    "slug": "giftwrapt",
    "name": "giftwrapt",
    "description": "Minimal GiftWrapt install with core service, database, and cron jobs.",
    "url": "https://railway.com/deploy/giftwrapt",
    "upstream": {
      "image": "ghcr.io/shawnphoffman/giftwrapt:latest"
    }
  },
  "services": [
    {
      "name": "cron-intelligence-recommendations",
      "source": {
        "image": "curlimages/curl:8.20.0"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "cron-item-scrape-queue",
      "source": {
        "image": "curlimages/curl:8.20.0"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "cron-birthday-emails",
      "source": {
        "image": "curlimages/curl:8.20.0"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "giftwrapt-postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "giftwrapt",
      "source": {
        "image": "ghcr.io/shawnphoffman/giftwrapt:latest"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "cron-cleanup-verification",
      "source": {
        "image": "curlimages/curl:8.20.0"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "cron-auto-archive",
      "source": {
        "image": "curlimages/curl:8.20.0"
      },
      "needs_volume": false,
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "CRON_SECRET",
      "service": "cron-intelligence-recommendations",
      "description": "Cron secret defined on the core giftwrapt service",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "BETTER_AUTH_URL",
      "service": "cron-intelligence-recommendations",
      "description": "URL telling the cron service how to reach the main service",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "CRON_SECRET",
      "service": "cron-item-scrape-queue",
      "description": "Cron secret defined on the core giftwrapt service",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "BETTER_AUTH_URL",
      "service": "cron-item-scrape-queue",
      "description": "URL telling the cron service how to reach the main service",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "CRON_SECRET",
      "service": "cron-birthday-emails",
      "description": "Cron secret defined on the core giftwrapt service",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "BETTER_AUTH_URL",
      "service": "cron-birthday-emails",
      "description": "URL telling the cron service how to reach the main service",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGHOST",
      "service": "giftwrapt-postgres",
      "description": "Internal hostname for the Postgres service. Auto-set from Railway's private domain.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGUSER",
      "service": "giftwrapt-postgres",
      "description": "Postgres user. References POSTGRES_USER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "giftwrapt-postgres",
      "description": "Postgres database name. References POSTGRES_DB.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "giftwrapt-postgres",
      "description": "Postgres password. References POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_URL",
      "service": "giftwrapt-postgres",
      "description": "Full connection string the app reads. Auto-built from the vars above.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "giftwrapt-postgres",
      "description": "Auto-generated database password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "giftwrapt-postgres",
      "description": "Public connection string for external tools like psql. Not used by the app.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "HOST",
      "service": "giftwrapt",
      "description": "Network interface to bind. :: enables IPv6 for Railway's private network. Don't change.",
      "secret": false,
      "strategy": "default",
      "default": "::"
    },
    {
      "key": "PORT",
      "service": "giftwrapt",
      "description": "Port the app listens on. Must match the port the cron services target.",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "CRON_SECRET",
      "service": "giftwrapt",
      "description": "Auto-generated bearer token that gates /api/cron/* endpoints. Shared with the cron services.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "DATABASE_URL",
      "service": "giftwrapt",
      "description": "Postgres connection string. References the Postgres service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "BETTER_AUTH_URL",
      "service": "giftwrapt",
      "description": "Public URL of this app. Used for auth callbacks. Set to https://${{RAILWAY_PUBLIC_DOMAIN}}.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "BETTER_AUTH_SECRET",
      "service": "giftwrapt",
      "description": "Auto-generated secret used to sign auth sessions. Rotate to invalidate all sessions.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "CRON_SECRET",
      "service": "cron-cleanup-verification",
      "description": "Cron secret defined on the core giftwrapt service",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "BETTER_AUTH_URL",
      "service": "cron-cleanup-verification",
      "description": "URL telling the cron service how to reach the main service",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "CRON_SECRET",
      "service": "cron-auto-archive",
      "description": "Cron secret defined on the core giftwrapt service",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "BETTER_AUTH_URL",
      "service": "cron-auto-archive",
      "description": "URL telling the cron service how to reach the main service",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "giftwrapt"
      }
    },
    "cli": "railway deploy --template giftwrapt",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "14dc81a8-b06e-4378-a20a-1d12110e6c05",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "0fd50118-de86-413e-9ccf-742f2bb7b4d3": {
                  "icon": "https://devicons.railway.com/i/bash.svg",
                  "name": "cron-intelligence-recommendations",
                  "deploy": {
                    "startCommand": "sh -c 'curl -fsSL --retry 3 -H \"Authorization: Bearer $CRON_SECRET\" \"$BETTER_AUTH_URL/api/cron/intelligence-recommendations\"'",
                    "healthcheckPath": null
                  },
                  "source": {
                    "image": "curlimages/curl:8.20.0"
                  },
                  "variables": {
                    "CRON_SECRET": {
                      "isOptional": false,
                      "description": "Cron secret defined on the core giftwrapt service",
                      "defaultValue": "${{giftwrapt.CRON_SECRET}}"
                    },
                    "BETTER_AUTH_URL": {
                      "isOptional": false,
                      "description": "URL telling the cron service how to reach the main service",
                      "defaultValue": "http://${{giftwrapt.RAILWAY_PRIVATE_DOMAIN}}:${{giftwrapt.PORT}}"
                    }
                  }
                },
                "4ee6242b-0d85-4dde-a0e5-a99f5dedeba0": {
                  "icon": "https://devicons.railway.com/i/bash.svg",
                  "name": "cron-item-scrape-queue",
                  "deploy": {
                    "startCommand": "sh -c 'curl -fsSL --retry 3 -H \"Authorization: Bearer $CRON_SECRET\" \"$BETTER_AUTH_URL/api/cron/item-scrape-queue\"'",
                    "healthcheckPath": null
                  },
                  "source": {
                    "image": "curlimages/curl:8.20.0"
                  },
                  "variables": {
                    "CRON_SECRET": {
                      "isOptional": false,
                      "description": "Cron secret defined on the core giftwrapt service",
                      "defaultValue": "${{giftwrapt.CRON_SECRET}}"
                    },
                    "BETTER_AUTH_URL": {
                      "isOptional": false,
                      "description": "URL telling the cron service how to reach the main service",
                      "defaultValue": "http://${{giftwrapt.RAILWAY_PRIVATE_DOMAIN}}:${{giftwrapt.PORT}}"
                    }
                  }
                },
                "5f633edb-fd7a-40bb-a806-54f5585d747b": {
                  "icon": "https://devicons.railway.com/i/bash.svg",
                  "name": "cron-birthday-emails",
                  "deploy": {
                    "startCommand": "sh -c 'curl -fsSL --retry 3 -H \"Authorization: Bearer $CRON_SECRET\" \"$BETTER_AUTH_URL/api/cron/birthday-emails\"'",
                    "healthcheckPath": null
                  },
                  "source": {
                    "image": "curlimages/curl:8.20.0"
                  },
                  "variables": {
                    "CRON_SECRET": {
                      "isOptional": false,
                      "description": "Cron secret defined on the core giftwrapt service",
                      "defaultValue": "${{giftwrapt.CRON_SECRET}}"
                    },
                    "BETTER_AUTH_URL": {
                      "isOptional": false,
                      "description": "URL telling the cron service how to reach the main service",
                      "defaultValue": "http://${{giftwrapt.RAILWAY_PRIVATE_DOMAIN}}:${{giftwrapt.PORT}}"
                    }
                  }
                },
                "66d2d21c-35ee-4b2d-8c0b-e50e31d73439": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "giftwrapt-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": "Postgres data directory. Leave empty to use image default (/var/lib/postgresql/data).",
                      "defaultValue": ""
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Internal hostname for the Postgres service. Auto-set from Railway's private domain.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": true,
                      "description": "Postgres port. Leave empty to use default (5432).",
                      "defaultValue": ""
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Postgres user. References POSTGRES_USER.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Postgres database name. References POSTGRES_DB.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Postgres password. References POSTGRES_PASSWORD.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": true,
                      "description": "Database name. Leave empty to use image default (railway).",
                      "defaultValue": ""
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Full connection string the app reads. Auto-built from the vars above.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": true,
                      "description": "Database user. Leave empty to use image default (postgres).",
                      "defaultValue": ""
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "description": "SSL cert rotation window. Leave empty to use default.",
                      "defaultValue": ""
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated database password.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Public connection string for external tools like psql. Not used by the app.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": true,
                      "description": "Graceful shutdown timeout. Leave empty to use default.",
                      "defaultValue": ""
                    }
                  },
                  "volumeMounts": {
                    "66d2d21c-35ee-4b2d-8c0b-e50e31d73439": {
                      "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."
                  }
                },
                "9e46c6c9-e6cd-4007-9148-45c3f19b0ce2": {
                  "icon": "https://www.giftwrapt.dev/apple-touch-icon.png",
                  "name": "giftwrapt",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/api/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/shawnphoffman/giftwrapt:latest"
                  },
                  "variables": {
                    "HOST": {
                      "isOptional": false,
                      "description": "Network interface to bind. :: enables IPv6 for Railway's private network. Don't change.",
                      "defaultValue": "::"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "Port the app listens on. Must match the port the cron services target.",
                      "defaultValue": "3000"
                    },
                    "CRON_SECRET": {
                      "isOptional": false,
                      "description": "Auto-generated bearer token that gates /api/cron/* endpoints. Shared with the cron services.",
                      "defaultValue": "{{CRON_SECRET}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Postgres connection string. References the Postgres service.",
                      "defaultValue": "${{giftwrapt-postgres.DATABASE_URL}}"
                    },
                    "RESEND_API_KEY": {
                      "isOptional": true,
                      "description": "Resend API key for outbound email. Leave empty to disable email.",
                      "defaultValue": ""
                    },
                    "STORAGE_BUCKET": {
                      "isOptional": true,
                      "description": "Bucket name for uploaded images.",
                      "defaultValue": ""
                    },
                    "STORAGE_REGION": {
                      "isOptional": true,
                      "description": "S3 region for the storage backend.",
                      "defaultValue": ""
                    },
                    "BETTER_AUTH_URL": {
                      "isOptional": false,
                      "description": "Public URL of this app. Used for auth callbacks. Set to https://${{RAILWAY_PUBLIC_DOMAIN}}.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "STORAGE_ENDPOINT": {
                      "isOptional": true,
                      "description": "S3-compatible storage endpoint URL. Leave all STORAGE_* empty to disable image uploads.",
                      "defaultValue": ""
                    },
                    "RESEND_FROM_EMAIL": {
                      "isOptional": true,
                      "description": "Verified Resend sender address, e.g. noreply@yourdomain.com.",
                      "defaultValue": ""
                    },
                    "BETTER_AUTH_SECRET": {
                      "isOptional": false,
                      "description": "Auto-generated secret used to sign auth sessions. Rotate to invalidate all sessions.",
                      "defaultValue": "{{BETTER_AUTH_SECRET}}"
                    },
                    "STORAGE_ACCESS_KEY_ID": {
                      "isOptional": true,
                      "description": "Storage access key ID.",
                      "defaultValue": ""
                    },
                    "STORAGE_FORCE_PATH_STYLE": {
                      "isOptional": true,
                      "description": "Use path-style URLs (endpoint/bucket/key) instead of virtual-hosted (bucket.endpoint/key). Leave empty for AWS S3 / Cloudflare R2. Set to true for MinIO, Garage, RustFS, or other self-hosted S3 backends.",
                      "defaultValue": ""
                    },
                    "STORAGE_SECRET_ACCESS_KEY": {
                      "isOptional": true,
                      "description": "Storage secret access key.",
                      "defaultValue": ""
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                },
                "bb2e5198-78d4-40b1-bc0e-f08dfdb3fc4d": {
                  "icon": "https://devicons.railway.com/i/bash.svg",
                  "name": "cron-cleanup-verification",
                  "deploy": {
                    "startCommand": "sh -c 'curl -fsSL --retry 3 -H \"Authorization: Bearer $CRON_SECRET\" \"$BETTER_AUTH_URL/api/cron/cleanup-verification\"'",
                    "healthcheckPath": null
                  },
                  "source": {
                    "image": "curlimages/curl:8.20.0"
                  },
                  "variables": {
                    "CRON_SECRET": {
                      "isOptional": false,
                      "description": "Cron secret defined on the core giftwrapt service",
                      "defaultValue": "${{giftwrapt.CRON_SECRET}}"
                    },
                    "BETTER_AUTH_URL": {
                      "isOptional": false,
                      "description": "URL telling the cron service how to reach the main service",
                      "defaultValue": "http://${{giftwrapt.RAILWAY_PRIVATE_DOMAIN}}:${{giftwrapt.PORT}}"
                    }
                  }
                },
                "e2a816f9-d007-489c-9628-4d718e64eade": {
                  "icon": "https://devicons.railway.com/i/bash.svg",
                  "name": "cron-auto-archive",
                  "deploy": {
                    "startCommand": "sh -c 'curl -fsSL --retry 3 -H \"Authorization: Bearer $CRON_SECRET\" \"$BETTER_AUTH_URL/api/cron/auto-archive\"'",
                    "healthcheckPath": null
                  },
                  "source": {
                    "image": "curlimages/curl:8.20.0"
                  },
                  "variables": {
                    "CRON_SECRET": {
                      "isOptional": false,
                      "description": "Cron secret defined on the core giftwrapt service",
                      "defaultValue": "${{giftwrapt.CRON_SECRET}}"
                    },
                    "BETTER_AUTH_URL": {
                      "isOptional": false,
                      "description": "URL telling the cron service how to reach the main service",
                      "defaultValue": "http://${{giftwrapt.RAILWAY_PRIVATE_DOMAIN}}:${{giftwrapt.PORT}}"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "giftwrapt",
      "method": "GET",
      "path": "/api/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 7,
    "needs_volume": true
  },
  "generated_at": "2026-09-11T04:14:34.944Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-09T06:43:16.608Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_cb9dc5cb46d941dd943f",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "SUCCESS,SUCCESS,SUCCESS,SUCCESS,FAILED,SUCCESS,SUCCESS"
      }
    ]
  }
}
