Spaces:
Build error
Build error
| # Quick Start - Deploy to Hugging Face in 5 Minutes | |
| ## Prerequisites | |
| - Hugging Face account | |
| - NVIDIA API key | |
| - MySQL database URL | |
| --- | |
| ## Step 1: Create Hugging Face Space | |
| ```bash | |
| # Go to https://huggingface.co/spaces | |
| # Click "Create new Space" | |
| # Select "Docker" as SDK | |
| # Name it: domify-academy-bot | |
| ``` | |
| --- | |
| ## Step 2: Get Your Repository URL | |
| After creating the Space, you'll see: | |
| ``` | |
| https://huggingface.co/spaces/YOUR_USERNAME/domify-academy-bot | |
| ``` | |
| --- | |
| ## Step 3: Push Code | |
| ```bash | |
| cd /path/to/domify-academy-bot | |
| # Initialize git (if not already done) | |
| git init | |
| # Add all files | |
| git add . | |
| # Commit | |
| git commit -m "Initial commit" | |
| # Add Hugging Face remote | |
| git remote add origin https://huggingface.co/spaces/YOUR_USERNAME/domify-academy-bot | |
| # Push to Hugging Face | |
| git push -u origin main | |
| ``` | |
| --- | |
| ## Step 4: Set Environment Variables | |
| In Hugging Face Space settings: | |
| 1. Go to **Settings** β **Repository secrets** | |
| 2. Add these variables: | |
| | Key | Value | | |
| |-----|-------| | |
| | `DATABASE_URL` | `mysql://user:pass@host/db` | | |
| | `NVIDIA_API_KEY` | Your NVIDIA API key | | |
| | `JWT_SECRET` | `openssl rand -base64 32` | | |
| --- | |
| ## Step 5: Wait for Build | |
| Hugging Face automatically: | |
| 1. Detects `Dockerfile` | |
| 2. Builds the image | |
| 3. Deploys the container | |
| 4. Assigns a public URL | |
| **Check status in the "Build" tab** | |
| --- | |
| ## Step 6: Test | |
| Once deployed: | |
| ```bash | |
| # Test health endpoint | |
| curl https://YOUR_SPACE_URL/api/health | |
| # Should return: | |
| # {"status":"healthy","uptime":123.45,...} | |
| ``` | |
| --- | |
| ## Done! π | |
| Your backend is now live on Hugging Face Spaces! | |
| --- | |
| ## Troubleshooting | |
| ### Build fails | |
| **Check logs:** | |
| - Go to "Build" tab | |
| - Look for error messages | |
| - Common issues: | |
| - Missing environment variables | |
| - Database connection error | |
| - Invalid NVIDIA API key | |
| ### Application crashes | |
| **Check logs:** | |
| - Go to "Logs" tab | |
| - Look for error messages | |
| - Restart the Space if needed | |
| ### Slow responses | |
| **Possible causes:** | |
| - Database too slow | |
| - NVIDIA API busy | |
| - Rate limiting triggered | |
| --- | |
| ## Next Steps | |
| 1. Build the frontend | |
| 2. Deploy to same Space or separate URL | |
| 3. Configure custom domain | |
| 4. Set up monitoring and alerts | |
| --- | |
| ## Support | |
| - Deployment issues: See `DEPLOYMENT.md` | |
| - Backend details: See `BACKEND_README.md` | |
| - Architecture: See `ARCHITECTURE.md` | |