{
  "manifest_version": "1.0.0",
  "template": {
    "id": "f04eccc8-ad81-448e-8a6a-6f056e8de10e",
    "slug": "koillection-collection-manager",
    "name": "Koillection collection manager",
    "description": "Protected collection management with PostgreSQL and durable uploads.",
    "url": "https://railway.com/deploy/koillection-collection-manager",
    "upstream": {
      "image": "caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648"
    }
  },
  "services": [
    {
      "name": "Koillection",
      "source": {
        "image": "koillection/koillection:1.8.3@sha256:9648cd4e2bb97351f1e7b27787e2ec1ff537f18180b97df7988aa50cf9b38625"
      },
      "needs_volume": true,
      "volume_mount_path": "/uploads",
      "http": false
    },
    {
      "name": "Koillection PostgreSQL",
      "source": {
        "image": "postgres:16.10-alpine@sha256:029660641a0cfc575b14f336ba448fb8a75fd595d42e1fa316b9fb4378742297"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "Koillection Gateway",
      "source": {
        "image": "caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "Koillection",
      "description": "Private HTTP listener.",
      "secret": false,
      "strategy": "default",
      "default": "80"
    },
    {
      "key": "PHP_TZ",
      "service": "Koillection",
      "description": "Application timezone.",
      "secret": false,
      "strategy": "default",
      "default": "UTC"
    },
    {
      "key": "APP_ENV",
      "service": "Koillection",
      "description": "Production runtime mode.",
      "secret": false,
      "strategy": "default",
      "default": "prod"
    },
    {
      "key": "DB_HOST",
      "service": "Koillection",
      "description": "Private PostgreSQL hostname.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "DB_NAME",
      "service": "Koillection",
      "description": "Application database name.",
      "secret": false,
      "strategy": "default",
      "default": "koillection"
    },
    {
      "key": "DB_PORT",
      "service": "Koillection",
      "description": "Private PostgreSQL port.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "DB_USER",
      "service": "Koillection",
      "description": "Application database user.",
      "secret": false,
      "strategy": "default",
      "default": "koillection"
    },
    {
      "key": "APP_DEBUG",
      "service": "Koillection",
      "description": "Disables debug output.",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "DB_DRIVER",
      "service": "Koillection",
      "description": "PostgreSQL database driver.",
      "secret": false,
      "strategy": "default",
      "default": "pdo_pgsql"
    },
    {
      "key": "APP_SECRET",
      "service": "Koillection",
      "description": "Generated session secret.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "DB_VERSION",
      "service": "Koillection",
      "description": "PostgreSQL compatibility major.",
      "secret": false,
      "strategy": "default",
      "default": "16"
    },
    {
      "key": "DB_PASSWORD",
      "service": "Koillection",
      "description": "Reference to the generated database password.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "HTTPS_ENABLED",
      "service": "Koillection",
      "description": "Uses secure session cookies behind Railway TLS.",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "JWT_PASSPHRASE",
      "service": "Koillection",
      "description": "Generated API signing-key passphrase.",
      "secret": false,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PHP_MEMORY_LIMIT",
      "service": "Koillection",
      "description": "Bounded PHP memory limit.",
      "secret": false,
      "strategy": "default",
      "default": "512M"
    },
    {
      "key": "UPLOAD_MAX_FILESIZE",
      "service": "Koillection",
      "description": "Maximum uploaded file size.",
      "secret": false,
      "strategy": "default",
      "default": "100M"
    },
    {
      "key": "PGDATA",
      "service": "Koillection PostgreSQL",
      "description": "Database directory inside the volume.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Koillection PostgreSQL",
      "description": "Application database.",
      "secret": false,
      "strategy": "default",
      "default": "koillection"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Koillection PostgreSQL",
      "description": "Application database user.",
      "secret": false,
      "strategy": "default",
      "default": "koillection"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Koillection PostgreSQL",
      "description": "Generated database password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PORT",
      "service": "Koillection Gateway",
      "description": "Public gateway listener.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "UPSTREAM",
      "service": "Koillection Gateway",
      "description": "Private Koillection endpoint.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "GATEWAY_CONFIG",
      "service": "Koillection Gateway",
      "description": "Pinned bootstrap-only authentication policy.",
      "secret": false,
      "strategy": "default",
      "default": ":8080 {\n  handle /healthz {\n    rewrite * /api\n    reverse_proxy http://__UPSTREAM__\n  }\n  @bootstrap path /first-connection* /register*\n  basic_auth @bootstrap {\n    __USERNAME__ __PASSWORD_HASH__\n  }\n  handle {\n    reverse_proxy http://__UPSTREAM__ {\n      header_up X-Forwarded-Proto {http.request.header.X-Forwarded-Proto}\n    }\n  }\n}"
    },
    {
      "key": "GATEWAY_PASSWORD",
      "service": "Koillection Gateway",
      "description": "Generated bootstrap and registration password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "GATEWAY_USERNAME",
      "service": "Koillection Gateway",
      "description": "Username protecting first-owner setup and registration.",
      "secret": false,
      "strategy": "default",
      "default": "koillection"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "koillection-collection-manager"
      }
    },
    "cli": "railway deploy --template koillection-collection-manager",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "f04eccc8-ad81-448e-8a6a-6f056e8de10e",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "746ec62a-12f9-4f19-9751-83868979d989": {
                  "icon": null,
                  "name": "Koillection",
                  "deploy": {
                    "startCommand": "/bin/bash -ec 'until (echo >/dev/tcp/$DB_HOST/$DB_PORT) 2>/dev/null; do sleep 2; done; exec /app/public/docker/entrypoint.sh'",
                    "healthcheckPath": "/api",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 600,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "koillection/koillection:1.8.3@sha256:9648cd4e2bb97351f1e7b27787e2ec1ff537f18180b97df7988aa50cf9b38625"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Private HTTP listener.",
                      "defaultValue": "80"
                    },
                    "PHP_TZ": {
                      "isOptional": false,
                      "description": "Application timezone.",
                      "defaultValue": "UTC"
                    },
                    "APP_ENV": {
                      "isOptional": false,
                      "description": "Production runtime mode.",
                      "defaultValue": "prod"
                    },
                    "DB_HOST": {
                      "isOptional": false,
                      "description": "Private PostgreSQL hostname.",
                      "defaultValue": "${{Koillection PostgreSQL.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "DB_NAME": {
                      "isOptional": false,
                      "description": "Application database name.",
                      "defaultValue": "koillection"
                    },
                    "DB_PORT": {
                      "isOptional": false,
                      "description": "Private PostgreSQL port.",
                      "defaultValue": "5432"
                    },
                    "DB_USER": {
                      "isOptional": false,
                      "description": "Application database user.",
                      "defaultValue": "koillection"
                    },
                    "APP_DEBUG": {
                      "isOptional": false,
                      "description": "Disables debug output.",
                      "defaultValue": "0"
                    },
                    "DB_DRIVER": {
                      "isOptional": false,
                      "description": "PostgreSQL database driver.",
                      "defaultValue": "pdo_pgsql"
                    },
                    "APP_SECRET": {
                      "isOptional": false,
                      "description": "Generated session secret.",
                      "defaultValue": "{{APP_SECRET}}"
                    },
                    "DB_VERSION": {
                      "isOptional": false,
                      "description": "PostgreSQL compatibility major.",
                      "defaultValue": "16"
                    },
                    "DB_PASSWORD": {
                      "isOptional": false,
                      "description": "Reference to the generated database password.",
                      "defaultValue": "${{Koillection PostgreSQL.POSTGRES_PASSWORD}}"
                    },
                    "HTTPS_ENABLED": {
                      "isOptional": false,
                      "description": "Uses secure session cookies behind Railway TLS.",
                      "defaultValue": "1"
                    },
                    "JWT_PASSPHRASE": {
                      "isOptional": false,
                      "description": "Generated API signing-key passphrase.",
                      "defaultValue": "{{JWT_PASSPHRASE}}"
                    },
                    "PHP_MEMORY_LIMIT": {
                      "isOptional": false,
                      "description": "Bounded PHP memory limit.",
                      "defaultValue": "512M"
                    },
                    "UPLOAD_MAX_FILESIZE": {
                      "isOptional": false,
                      "description": "Maximum uploaded file size.",
                      "defaultValue": "100M"
                    }
                  },
                  "volumeMounts": {
                    "746ec62a-12f9-4f19-9751-83868979d989": {
                      "sizeMB": 5000,
                      "mountPath": "/uploads"
                    }
                  }
                },
                "dc7b6899-a99e-46c8-a2c1-b81db27a1b20": {
                  "icon": null,
                  "name": "Koillection PostgreSQL",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": null,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "postgres:16.10-alpine@sha256:029660641a0cfc575b14f336ba448fb8a75fd595d42e1fa316b9fb4378742297"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Database directory inside the volume.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Application database.",
                      "defaultValue": "koillection"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Application database user.",
                      "defaultValue": "koillection"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated database password.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "dc7b6899-a99e-46c8-a2c1-b81db27a1b20": {
                      "sizeMB": 5000,
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "f556ca59-10f3-4f24-9c97-9fb8f19763f5": {
                  "icon": null,
                  "name": "Koillection Gateway",
                  "deploy": {
                    "startCommand": "/bin/sh -ec 'password_hash=\"$(caddy hash-password --plaintext \"$GATEWAY_PASSWORD\")\"; printf \"%s\\n\" \"$GATEWAY_CONFIG\" | sed -e \"s|__USERNAME__|$GATEWAY_USERNAME|g\" -e \"s|__PASSWORD_HASH__|$password_hash|g\" -e \"s|__UPSTREAM__|$UPSTREAM|g\" >/tmp/Caddyfile; exec caddy run --config /tmp/Caddyfile --adapter caddyfile'",
                    "healthcheckPath": "/healthz",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 600,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Public gateway listener.",
                      "defaultValue": "8080"
                    },
                    "UPSTREAM": {
                      "isOptional": false,
                      "description": "Private Koillection endpoint.",
                      "defaultValue": "${{Koillection.RAILWAY_PRIVATE_DOMAIN}}:80"
                    },
                    "GATEWAY_CONFIG": {
                      "isOptional": false,
                      "description": "Pinned bootstrap-only authentication policy.",
                      "defaultValue": ":8080 {\n  handle /healthz {\n    rewrite * /api\n    reverse_proxy http://__UPSTREAM__\n  }\n  @bootstrap path /first-connection* /register*\n  basic_auth @bootstrap {\n    __USERNAME__ __PASSWORD_HASH__\n  }\n  handle {\n    reverse_proxy http://__UPSTREAM__ {\n      header_up X-Forwarded-Proto {http.request.header.X-Forwarded-Proto}\n    }\n  }\n}"
                    },
                    "GATEWAY_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated bootstrap and registration password.",
                      "defaultValue": "{{GATEWAY_PASSWORD}}"
                    },
                    "GATEWAY_USERNAME": {
                      "isOptional": false,
                      "description": "Username protecting first-owner setup and registration.",
                      "defaultValue": "koillection"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {
                        "port": 8080
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Koillection Gateway",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-10T19:15:33.021Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_4013d95e5d204fa691b0",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 127,
    "typical_build_seconds": 5,
    "typical_start_seconds": 10,
    "slowest_service": "Koillection Gateway"
  }
}
