{
  "manifest_version": "1.0.0",
  "template": {
    "id": "9b43ef2e-5e0d-42d1-8799-5677e08e1b34",
    "slug": "fortunate-achievement",
    "name": "fortunate-achievement",
    "description": "Visual no-code platform for building and running Telegram bots.",
    "url": "https://railway.com/deploy/fortunate-achievement",
    "upstream": {
      "repo_url": "https://github.com/fedorabakumets/telegram-bot-builder"
    }
  },
  "services": [
    {
      "name": "telegram-bot-builder-_E3U",
      "source": {
        "repo": "https://github.com/fedorabakumets/telegram-bot-builder"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/uploads",
      "http": true
    },
    {
      "name": "Postgres-QrUo",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": true
    },
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.2.1"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "telegram-bot-builder-_E3U",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "5000"
    },
    {
      "key": "REDIS_URL",
      "service": "telegram-bot-builder-_E3U",
      "description": "Provide a value for REDIS_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_URL",
      "service": "telegram-bot-builder-_E3U",
      "description": "Provide a value for DATABASE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ADMIN_API_KEY",
      "service": "telegram-bot-builder-_E3U",
      "description": "Provide a value for ADMIN_API_KEY.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "SESSION_SECRET",
      "service": "telegram-bot-builder-_E3U",
      "description": "Provide a value for SESSION_SECRET.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PGDATA",
      "service": "Postgres-QrUo",
      "description": "Provide a value for PGDATA.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/postgres"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres-QrUo",
      "description": "Provide a value for POSTGRES_DB.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres-QrUo",
      "description": "Provide a value for DATABASE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres-QrUo",
      "description": "Provide a value for POSTGRES_USER.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres-QrUo",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres-QrUo",
      "description": "Provide a value for DATABASE_PUBLIC_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDISHOST",
      "service": "Redis",
      "description": "Provide a value for REDISHOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPORT",
      "service": "Redis",
      "description": "Provide a value for REDISPORT.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDISUSER",
      "service": "Redis",
      "description": "Provide a value for REDISUSER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_URL",
      "service": "Redis",
      "description": "Provide a value for REDIS_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDISPASSWORD",
      "service": "Redis",
      "description": "Provide a value for REDISPASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Provide a value for REDIS_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "REDIS_PUBLIC_URL",
      "service": "Redis",
      "description": "Provide a value for REDIS_PUBLIC_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "fortunate-achievement"
      }
    },
    "cli": "railway deploy --template fortunate-achievement",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "9b43ef2e-5e0d-42d1-8799-5677e08e1b34",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "4d6442a5-84fb-41f4-b59e-ad4ab15c5f6b": {
                  "icon": null,
                  "name": "telegram-bot-builder-_E3U",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "fedorabakumets/telegram-bot-builder",
                    "branch": null,
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "defaultValue": "5000"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "defaultValue": "${{Redis.REDIS_URL}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "defaultValue": "${{Postgres-QrUo.DATABASE_URL}}"
                    },
                    "ADMIN_API_KEY": {
                      "defaultValue": "{{ADMIN_API_KEY}}"
                    },
                    "SESSION_SECRET": {
                      "defaultValue": "{{SESSION_SECRET}}"
                    },
                    "TELEGRAM_BOT_TOKEN": {
                      "isOptional": true,
                      "defaultValue": ""
                    },
                    "TELEGRAM_CLIENT_ID": {
                      "isOptional": true,
                      "defaultValue": ""
                    },
                    "TELEGRAM_CLIENT_SECRET": {
                      "isOptional": true,
                      "defaultValue": ""
                    },
                    "VITE_TELEGRAM_CLIENT_ID": {
                      "isOptional": true,
                      "defaultValue": ""
                    },
                    "VITE_TELEGRAM_BOT_USERNAME": {
                      "isOptional": true,
                      "defaultValue": ""
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "4d6442a5-84fb-41f4-b59e-ad4ab15c5f6b": {
                      "mountPath": "/app/uploads"
                    }
                  }
                },
                "5fb2e74e-719f-44fc-8cb7-3894dab7e98e": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres-QrUo",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "defaultValue": "/var/lib/postgresql/data/postgres"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "defaultValue": "postgres"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{POSTGRES_DB}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "defaultValue": "postgres"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{POSTGRES_DB}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "5fb2e74e-719f-44fc-8cb7-3894dab7e98e": {
                      "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."
                  }
                },
                "edd15a19-463e-48c4-a06f-77bd3e2051fc": {
                  "icon": "https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg",
                  "name": "Redis",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:8.2.1"
                  },
                  "variables": {
                    "REDISHOST": {
                      "isOptional": false,
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDISPORT": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "${{Redis.REDISPORT}}"
                    },
                    "REDISUSER": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "${{Redis.REDISUSER}}"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "defaultValue": "redis://${{REDISUSER}}:${{REDIS_PASSWORD}}@${{REDISHOST}}:${{REDISPORT}}"
                    },
                    "REDISPASSWORD": {
                      "isOptional": false,
                      "defaultValue": "${{REDIS_PASSWORD}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    },
                    "REDIS_PUBLIC_URL": {
                      "isOptional": false,
                      "defaultValue": "redis://default:${{REDIS_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}"
                    }
                  },
                  "volumeMounts": {
                    "edd15a19-463e-48c4-a06f-77bd3e2051fc": {
                      "mountPath": "/data"
                    }
                  },
                  "haTemplateCode": "redis-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxies",
                      "options": [
                        1,
                        2
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "HAProxy instances routing writes to the primary",
                      "defaultValue": 2
                    },
                    "replica": {
                      "label": "Redis Replicas",
                      "options": [
                        2,
                        3,
                        4,
                        5
                      ],
                      "nodeLabel": "Redis",
                      "description": "Nodes running Redis + colocated Sentinel",
                      "defaultValue": 2
                    },
                    "internal": null,
                    "description": "This will convert your Redis instance to an HA cluster with Sentinel failover and HAProxy routing to the primary."
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "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-09T05:56:39.988Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_1e7e44d93e924fcd82d4",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 222,
    "typical_build_seconds": 152,
    "typical_start_seconds": 21,
    "slowest_service": "telegram-bot-builder-_E3U"
  }
}
