Spaces:
Build error
Build error
Talking Avatar with AI - Deployment Guide
π Deployment Options
This project is configured to be deployed as a single Docker container, which hosts both the Node.js backend and the React frontend.
Option 1: Render (Recommended)
Render is a unified cloud to build and run all your apps and websites.
Create Render Account
- Go to https://render.com
- Sign up with GitHub
Create New Web Service
- Click "New +" -> "Web Service"
- Connect your GitHub repository
- Render should automatically detect the
render.yamlorDockerfile. - If asked, choose Docker as the runtime.
Configuration
- Name:
healbot-avatar(or your choice) - Region: Choose one close to you
- Branch:
main - Runtime: Docker
- Plan: Free (or higher)
- Name:
Deploy
- Click "Create Web Service"
- Render will build the Docker image (this may take a few minutes) and deploy it.
Option 2: Hugging Face Spaces
You can deploy this application to Hugging Face Spaces using their Docker SDK.
Create Hugging Face Account
- Go to https://huggingface.co
- Sign up
Create New Space
- Click on your profile -> "New Space"
- Space Name:
healbot-avatar - License: MIT (optional)
- SDK: Docker
- Hardware: CPU Basic (Free) is usually sufficient, but Upgrade if needed for faster TTS.
Upload Code
- You can sync your GitHub repo with the Space, or push your code directly to the Space's repo.
- Ensure the
Dockerfileis in the root directory.
Configuration
- Hugging Face Spaces usually listen on port 7860. You might need to update the
Dockerfileorserver.jsif HF doesn't map port 3000 automatically. - Note: For Hugging Face, it is recommended to change the port in
apps/backend/server.jsto7860or use an environment variable. - Add a variable
PORT=7860in the Space Settings -> "Variables and secrets".
- Hugging Face Spaces usually listen on port 7860. You might need to update the
π Pre-Deployment Checklist
- β Removed Vercel and Railway configurations
- β
Added
Dockerfilefor multi-stage build - β
Added
render.yamlfor Render Blueprints - β Backend serves Frontend static files
- β
edge-ttsandffmpegincluded in Docker image
π§ Environment Variables
Render / Hugging Face:
PORT: Defaults to3000. Set to7860for Hugging Face if needed.
π§ͺ Testing After Deployment
- Open your deployed URL (e.g.,
https://healbot-avatar.onrender.comorhttps://huggingface.co/spaces/username/healbot-avatar) - The frontend should load.
- Send a message. The backend should process it using
edge-ttsand return the audio and animation.
π Troubleshooting
- Build Fails: Check the logs. Ensure
ffmpegandpythonare correctly installed in the Docker image. - Audio Issues: If TTS fails, check if
edge-ttsis working. The logs will show python errors. - Connection Refused: Ensure the port matches the environment variable.