{
  "manifest_version": "1.0.0",
  "template": {
    "id": "4ed0e0be-72e8-4765-b191-3fe84ad663ce",
    "slug": "chirp-links",
    "name": "Chirp Links",
    "description": "Deploy private short links with bounded aggregate analytics.",
    "url": "https://railway.com/deploy/chirp-links",
    "upstream": {
      "repo_url": "https://github.com/lbliii/chirp-links"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "web",
      "source": {
        "repo": "https://github.com/lbliii/chirp-links"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Location where the database will be initialized",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Railway private domain name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Port to connect to Postgres.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "User exposed to the Railway data panel.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Database exposed to the Railway data panel.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Password exposed to the Railway data panel.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database created when Postgres starts.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Private PostgreSQL connection URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "PostgreSQL application user.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "SSL certificate expiry in days.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated PostgreSQL password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "Public PostgreSQL URL used by the Railway data panel.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Allow Postgres to shut down cleanly.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "CHIRP_ENV",
      "service": "web",
      "description": "Run Chirp Links with production safety defaults.",
      "secret": false,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "DATABASE_URL",
      "service": "web",
      "description": "Private Railway PostgreSQL connection.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "CHIRP_SECRET_KEY",
      "service": "web",
      "description": "Generated signing key for owner sessions.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "LINKS_ADMIN_TOKEN",
      "service": "web",
      "description": "Generated owner token for creating and managing short links.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "CHIRP_SKIP_MIGRATIONS",
      "service": "web",
      "description": "Skip startup migration because Railway runs the pre-deploy migration command.",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "RAILPACK_PYTHON_VERSION",
      "service": "web",
      "description": "Python runtime used by Railpack.",
      "secret": false,
      "strategy": "default",
      "default": "3.14"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "chirp-links"
      }
    },
    "cli": "railway deploy --template chirp-links",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "4ed0e0be-72e8-4765-b191-3fe84ad663ce",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "3e3fa6e1-0a02-4acf-a1cc-b72c477a2827": {
                  "icon": "https://devicons.railway.app/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": "Location where the database will be initialized",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Railway private domain name.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Port to connect to Postgres.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "User exposed to the Railway data panel.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Database exposed to the Railway data panel.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Password exposed to the Railway data panel.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database created when Postgres starts.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private PostgreSQL connection URL.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "PostgreSQL application user.",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "description": "SSL certificate expiry in days.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated PostgreSQL password.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": true,
                      "description": "Public PostgreSQL URL used by the Railway data panel.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Allow Postgres to shut down cleanly.",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "3e3fa6e1-0a02-4acf-a1cc-b72c477a2827": {
                      "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."
                  }
                },
                "d37c6b00-72b7-46fa-8969-e063462eaed3": {
                  "icon": "https://raw.githubusercontent.com/lbliii/chirp-links/v0.1.0/favicon.svg",
                  "name": "web",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/ready",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/lbliii/chirp-links",
                    "rootDirectory": null
                  },
                  "variables": {
                    "CHIRP_ENV": {
                      "isOptional": false,
                      "description": "Run Chirp Links with production safety defaults.",
                      "defaultValue": "production"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private Railway PostgreSQL connection.",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "CHIRP_SECRET_KEY": {
                      "isOptional": false,
                      "description": "Generated signing key for owner sessions.",
                      "defaultValue": "{{CHIRP_SECRET_KEY}}"
                    },
                    "LINKS_ADMIN_TOKEN": {
                      "isOptional": false,
                      "description": "Generated owner token for creating and managing short links.",
                      "defaultValue": "{{LINKS_ADMIN_TOKEN}}"
                    },
                    "CHIRP_SKIP_MIGRATIONS": {
                      "isOptional": false,
                      "description": "Skip startup migration because Railway runs the pre-deploy migration command.",
                      "defaultValue": "1"
                    },
                    "RAILPACK_PYTHON_VERSION": {
                      "isOptional": false,
                      "description": "Python runtime used by Railpack.",
                      "defaultValue": "3.14"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "web",
      "method": "GET",
      "path": "/ready",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-09T01:21:12.174Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_3c299a8e01dc49cb92b9",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "FAILED,SUCCESS"
      }
    ]
  }
}
