{
  "manifest_version": "1.0.0",
  "template": {
    "id": "69c63ab5-f680-47f2-bb9b-04a26a2191a0",
    "slug": "chat-ui-pro-stack-self-hosted-huggingcha",
    "name": "Chat UI Pro Stack: Self Hosted HuggingChat with Bifrost and Mongo",
    "description": "The open chat app behind HuggingChat, on any model, with its own database.",
    "url": "https://railway.com/deploy/chat-ui-pro-stack-self-hosted-huggingcha",
    "upstream": {
      "image": "maximhq/bifrost:latest"
    }
  },
  "services": [
    {
      "name": "Bifrost",
      "source": {
        "image": "maximhq/bifrost:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/data",
      "http": true
    },
    {
      "name": "ChatUI",
      "source": {
        "image": "ghcr.io/huggingface/chat-ui:latest"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "MongoDB",
      "source": {
        "image": "mongo:7"
      },
      "needs_volume": true,
      "volume_mount_path": "/data/db",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "APP_HOST",
      "service": "Bifrost",
      "description": "Provide a value for APP_HOST.",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "APP_PORT",
      "service": "Bifrost",
      "description": "Provide a value for APP_PORT.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "LOG_LEVEL",
      "service": "Bifrost",
      "description": "Provide a value for LOG_LEVEL.",
      "secret": false,
      "strategy": "default",
      "default": "info"
    },
    {
      "key": "LOG_STYLE",
      "service": "Bifrost",
      "description": "Provide a value for LOG_STYLE.",
      "secret": false,
      "strategy": "default",
      "default": "json"
    },
    {
      "key": "BIFROST_CONFIG",
      "service": "Bifrost",
      "description": "Provide a value for BIFROST_CONFIG.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "Bifrost",
      "description": "Provide a value for RAILWAY_RUN_UID.",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "ORIGIN",
      "service": "ChatUI",
      "description": "Provide a value for ORIGIN.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "MONGODB_URL",
      "service": "ChatUI",
      "description": "Provide a value for MONGODB_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "OPENAI_API_KEY",
      "service": "ChatUI",
      "description": "Provide a value for OPENAI_API_KEY.",
      "secret": true,
      "strategy": "default",
      "default": "sk-bifrost"
    },
    {
      "key": "MONGODB_DB_NAME",
      "service": "ChatUI",
      "description": "Provide a value for MONGODB_DB_NAME.",
      "secret": false,
      "strategy": "default",
      "default": "chatui"
    },
    {
      "key": "OPENAI_BASE_URL",
      "service": "ChatUI",
      "description": "Provide a value for OPENAI_BASE_URL.",
      "secret": false,
      "strategy": "default",
      "default": "http://bifrost.railway.internal:8080/openai/v1"
    },
    {
      "key": "PUBLIC_APP_NAME",
      "service": "ChatUI",
      "description": "Provide a value for PUBLIC_APP_NAME.",
      "secret": false,
      "strategy": "default",
      "default": "ChatUI"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Provide a value for PGDATA.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Provide a value for POSTGRES_DB.",
      "secret": false,
      "strategy": "default",
      "default": "app"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Provide a value for POSTGRES_USER.",
      "secret": false,
      "strategy": "default",
      "default": "app"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "chat-ui-pro-stack-self-hosted-huggingcha"
      }
    },
    "cli": "railway deploy --template chat-ui-pro-stack-self-hosted-huggingcha",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "69c63ab5-f680-47f2-bb9b-04a26a2191a0",
            "serializedConfig": {
              "services": {
                "23fad519-7568-4482-b326-9e6dd0e659bd": {
                  "icon": "https://framerusercontent.com/images/k49dViw06yckDjJt5uERdfTSjU.png",
                  "name": "Bifrost",
                  "deploy": {
                    "healthcheckPath": "/health"
                  },
                  "source": {
                    "image": "maximhq/bifrost:latest"
                  },
                  "variables": {
                    "APP_HOST": {
                      "defaultValue": "0.0.0.0"
                    },
                    "APP_PORT": {
                      "defaultValue": "8080"
                    },
                    "LOG_LEVEL": {
                      "defaultValue": "info"
                    },
                    "LOG_STYLE": {
                      "defaultValue": "json"
                    },
                    "BIFROST_CONFIG": {
                      "defaultValue": "{\"config_store\":{\"enabled\":true,\"type\":\"postgres\",\"config\":{\"host\":\"${{Postgres.RAILWAY_PRIVATE_DOMAIN}}\",\"port\":\"5432\",\"user\":\"${{Postgres.POSTGRES_USER}}\",\"password\":\"${{Postgres.POSTGRES_PASSWORD}}\",\"db_name\":\"${{Postgres.POSTGRES_DB}}\",\"ssl_mode\":\"disable\"}},\"logs_store\":{\"enabled\":true,\"type\":\"postgres\",\"config\":{\"host\":\"${{Postgres.RAILWAY_PRIVATE_DOMAIN}}\",\"port\":\"5432\",\"user\":\"${{Postgres.POSTGRES_USER}}\",\"password\":\"${{Postgres.POSTGRES_PASSWORD}}\",\"db_name\":\"${{Postgres.POSTGRES_DB}}\",\"ssl_mode\":\"disable\"}}}"
                    },
                    "RAILWAY_RUN_UID": {
                      "defaultValue": "0"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  },
                  "volumeMounts": {
                    "23fad519-7568-4482-b326-9e6dd0e659bd": {
                      "mountPath": "/app/data"
                    }
                  }
                },
                "9fdc0ad9-ce18-4931-8677-7f3e8b95156c": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/hugging-face.png",
                  "name": "ChatUI",
                  "source": {
                    "image": "ghcr.io/huggingface/chat-ui:latest"
                  },
                  "variables": {
                    "ORIGIN": {
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "MONGODB_URL": {
                      "defaultValue": "mongodb://${{MongoDB.RAILWAY_PRIVATE_DOMAIN}}:27017"
                    },
                    "OPENAI_API_KEY": {
                      "defaultValue": "sk-bifrost"
                    },
                    "MONGODB_DB_NAME": {
                      "defaultValue": "chatui"
                    },
                    "OPENAI_BASE_URL": {
                      "defaultValue": "http://bifrost.railway.internal:8080/openai/v1"
                    },
                    "PUBLIC_APP_NAME": {
                      "defaultValue": "ChatUI"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:3000": {
                        "port": 3000
                      }
                    }
                  }
                },
                "db6a9c26-d2cd-4c8d-a9c5-d2a74e09dabe": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgresql.svg",
                  "name": "Postgres",
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "defaultValue": "app"
                    },
                    "POSTGRES_USER": {
                      "defaultValue": "app"
                    },
                    "POSTGRES_PASSWORD": {
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "db6a9c26-d2cd-4c8d-a9c5-d2a74e09dabe": {
                      "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."
                  }
                },
                "f0dde23a-01c9-4f7f-9784-31ed13e44b72": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mongodb.svg",
                  "name": "MongoDB",
                  "source": {
                    "image": "mongo:7"
                  },
                  "volumeMounts": {
                    "f0dde23a-01c9-4f7f-9784-31ed13e44b72": {
                      "mountPath": "/data/db"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Bifrost",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 4,
    "needs_volume": true
  },
  "generated_at": "2026-09-21T22:14:44.200Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-20T08:54:26.933Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_85a20004fa34444c9fca",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": false,
        "detail": "1 service(s) crashed within 30s"
      }
    ]
  }
}
