{
  "manifest_version": "1.0.0",
  "template": {
    "id": "f9a7ada4-48bf-4a58-9efd-1e060b301428",
    "slug": "telegram-bot-starter-kit-python",
    "name": "Telegram Bot Starter Kit (Python)",
    "description": "Python Telegram bot: aiogram 3 webhooks, secret-token auth, Postgres.",
    "url": "https://railway.com/deploy/telegram-bot-starter-kit-python",
    "upstream": {
      "repo_url": "https://github.com/niteshkumargupta/telegram-bot-railway-template"
    }
  },
  "services": [
    {
      "name": "bot",
      "source": {
        "repo": "https://github.com/niteshkumargupta/telegram-bot-railway-template"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "DATABASE_URL",
      "service": "bot",
      "description": "Postgres connection string (private networking). Delete this variable to run with in-memory storage instead.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "WEBHOOK_SECRET",
      "service": "bot",
      "description": "Auto-generated secret validated on every Telegram webhook request (X-Telegram-Bot-Api-Secret-Token header). Do not change.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "TELEGRAM_BOT_TOKEN",
      "service": "bot",
      "description": "REQUIRED - Your Telegram bot token. Open https://t.me/BotFather, send /newbot, choose a name and a username ending in bot, then paste the token shown (looks like 123456789:AAH8x...). Keep it secret.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Postgres data directory (inside the mounted volume).",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database name used by the bot.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Connection string the bot uses over private networking.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Postgres username.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Self-signed certificate validity for the postgres-ssl image.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Auto-generated Postgres password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "telegram-bot-starter-kit-python"
      }
    },
    "cli": "railway deploy --template telegram-bot-starter-kit-python",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "f9a7ada4-48bf-4a58-9efd-1e060b301428",
            "serializedConfig": {
              "services": {
                "6b2bff0d-1642-4ded-8c78-74723ffe0f39": {
                  "icon": "https://devicons.railway.com/i/telegram.svg",
                  "name": "bot",
                  "deploy": {
                    "healthcheckPath": "/healthz"
                  },
                  "source": {
                    "repo": "niteshkumargupta/telegram-bot-railway-template",
                    "branch": null,
                    "rootDirectory": "/app"
                  },
                  "variables": {
                    "DATABASE_URL": {
                      "description": "Postgres connection string (private networking). Delete this variable to run with in-memory storage instead.",
                      "defaultValue": "${{ Postgres.DATABASE_URL }}"
                    },
                    "WEBHOOK_SECRET": {
                      "description": "Auto-generated secret validated on every Telegram webhook request (X-Telegram-Bot-Api-Secret-Token header). Do not change.",
                      "defaultValue": "{{WEBHOOK_SECRET}}"
                    },
                    "TELEGRAM_BOT_TOKEN": {
                      "description": "REQUIRED - Your Telegram bot token. Open https://t.me/BotFather, send /newbot, choose a name and a username ending in bot, then paste the token shown (looks like 123456789:AAH8x...). Keep it secret.",
                      "defaultValue": "{{TELEGRAM_BOT_TOKEN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                },
                "d02c052e-f7c5-42b0-bd0b-deef8f9f2c82": {
                  "icon": "https://devicons.railway.com/i/postgresql.svg",
                  "name": "Postgres",
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
                  },
                  "variables": {
                    "PGDATA": {
                      "description": "Postgres data directory (inside the mounted volume).",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "description": "Database name used by the bot.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "description": "Connection string the bot uses over private networking.",
                      "defaultValue": "postgresql://${{ POSTGRES_USER }}:${{ POSTGRES_PASSWORD }}@${{ RAILWAY_PRIVATE_DOMAIN }}:5432/${{ POSTGRES_DB }}"
                    },
                    "POSTGRES_USER": {
                      "description": "Postgres username.",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "description": "Self-signed certificate validity for the postgres-ssl image.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "description": "Auto-generated Postgres password.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "d02c052e-f7c5-42b0-bd0b-deef8f9f2c82": {
                      "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": "bot",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T10:14:45.332Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-09T00:15:34.024Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_84f843c4029a4ed4bf86",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "FAILED,SUCCESS"
      }
    ]
  }
}
