Spaces:
Sleeping
Sleeping
|
Download DEPLOY_CHECKLIST.md from 01ammu/data-cleaning-openenv: direct link, hf CLI and curl.
- Browser
- Download file 5.17 kB
-
https://huggingface.co/spaces/01ammu/data-cleaning-openenv/resolve/main/DEPLOY_CHECKLIST.md
- Command line
-
hf download hf://spaces/01ammu/data-cleaning-openenv/DEPLOY_CHECKLIST.md
-
curl -L -o DEPLOY_CHECKLIST.md https://huggingface.co/spaces/01ammu/data-cleaning-openenv/resolve/main/DEPLOY_CHECKLIST.md
5.17 kB
| # π Phase 4.2 - Production Deployment Checklist | |
| **Status**: Ready for Production | **Estimated Time**: 5 minutes | **Cost**: $0 (NO CREDIT CARD NEEDED) | |
| --- | |
| ## β What's Already Done | |
| - [x] Backend deployed to HuggingFace Spaces (`https://01ammu-data-cleaning-openenv.hf.space`) | |
| - [x] Database: SQLite (included with HF Spaces) | |
| - [x] API endpoints working | |
| - [ ] **Frontend deployed** β You are here | |
| --- | |
| ## π― Your Task: Deploy Frontend to Vercel (5 minutes) | |
| ### Step 1: Go to Vercel | |
| 1. [ ] Open https://vercel.com | |
| 2. [ ] Click **Sign Up** | |
| 3. [ ] Choose **GitHub** (simplest) | |
| 4. [ ] Authorize Vercel to access your repos | |
| ### Step 2: Import Your Project | |
| 1. [ ] Click **+ New Project** | |
| 2. [ ] Search for: `data-cleaning-openenv` | |
| 3. [ ] Click **Import** | |
| ### Step 3: Configure Project | |
| 1. [ ] **Framework**: Vite | |
| 2. [ ] **Root Directory**: `frontend` | |
| 3. [ ] **Build Command**: `npm run build` (auto-filled) | |
| 4. [ ] **Output Directory**: `dist` (auto-filled) | |
| ### Step 4: Add Environment Variable | |
| 1. [ ] Scroll to **Environment Variables** | |
| 2. [ ] Click **+ Add** | |
| 3. [ ] **Name**: `VITE_API_BASE_URL` | |
| 4. [ ] **Value**: `https://01ammu-data-cleaning-openenv.hf.space/api` | |
| 5. [ ] Click **Add** | |
| ### Step 5: Deploy! | |
| 1. [ ] Click **Deploy** | |
| 2. [ ] Wait 1-2 minutes | |
| 3. [ ] β Done! Vercel shows your live URL | |
| --- | |
| ## β¨ Your Live URLs | |
| Once deployed, you'll have: | |
| | Service | URL | | |
| |---------|-----| | |
| | **Frontend** | `https://data-cleaning-openenv.vercel.app` (or custom domain) | | |
| | **Backend** | `https://01ammu-data-cleaning-openenv.hf.space` | | |
| | **API Docs** | `https://01ammu-data-cleaning-openenv.hf.space/docs` | | |
| --- | |
| ## π§ͺ Verify It Works | |
| ### Test in Browser | |
| 1. [ ] Open your Vercel URL | |
| 2. [ ] Upload a CSV file | |
| 3. [ ] Click "Start Cleaning" | |
| 4. [ ] Wait for job to complete | |
| 5. [ ] Download cleaned data | |
| ### Test API | |
| ```bash | |
| # Check backend is alive | |
| curl https://01ammu-data-cleaning-openenv.hf.space/health | |
| # Expected: {"status": "ok"} | |
| ``` | |
| --- | |
| ## β οΈ Important Notes | |
| ### HF Spaces Sleep Behavior | |
| - **Sleeps after**: 48 hours without access | |
| - **Wake-up time**: ~30 seconds (auto-wakes on first request) | |
| - **Why**: Free tier pauses unused services | |
| - **Solution**: Just refresh the page, it'll wake up | |
| ### No Credit Card Needed | |
| - β HuggingFace Spaces: No credit card | |
| - β Vercel: No credit card | |
| - β SQLite Database: Included (no separate DB) | |
| - β **Total Cost: $0 forever** | |
| --- | |
| ## π Update Your Portfolio | |
| Once live, add to your resume: | |
| ``` | |
| Live Demo: https://data-cleaning-openenv.vercel.app | |
| (Backend: HuggingFace Spaces, Frontend: Vercel) | |
| ``` | |
| --- | |
| ## π What This Deployment Shows | |
| β¨ **Full-Stack Skills**: | |
| - React + TypeScript frontend (Vercel) | |
| - FastAPI backend (HF Spaces) | |
| - SQLite database | |
| - Production deployment experience | |
| β¨ **Cloud Knowledge**: | |
| - Multiple cloud platforms (Vercel + HF Spaces) | |
| - Environment variable management | |
| - CI/CD (Vercel auto-deploys on git push) | |
| - Free tier optimization (no credit card = resourcefulness) | |
| --- | |
| ## Done! π | |
| When all checkboxes above are complete: | |
| 1. β Frontend is live on Vercel | |
| 2. β Backend is live on HF Spaces | |
| 3. β File upload β cleaning β download works | |
| 4. β You have a production-grade portfolio project | |
| 5. β Zero cost, zero credit cards, 5 minutes setup | |
| **Next**: Share your live link! This is portfolio gold π | |
| --- | |
| ## Deploying via Docker Compose & GHCR (alternative) | |
| If you prefer running the full stack yourself (self-hosted or cloud VM), this repo includes Dockerfiles and compose manifests. | |
| 1. Build & publish images (CI does this automatically to GHCR): | |
| - ghcr.io/<owner>/data-cleaning-openenv-backend:latest | |
| - ghcr.io/<owner>/data-cleaning-openenv-frontend:latest | |
| 2. Use docker-compose.prod.yml to run services locally or on a host: | |
| - Copy .env.example to .env and set production secrets (DATABASE_URL, POSTGRES_PASSWORD, JWT_SECRET) | |
| - docker compose -f docker-compose.prod.yml pull | |
| - docker compose -f docker-compose.prod.yml up -d | |
| 3. Verify health endpoints: | |
| - curl http://<HOST>:8000/api/health | |
| 4. Notes on secrets & TLS: | |
| - Use environment variables or a secrets manager (Vault, cloud secrets) | |
| - Terminate TLS at a reverse proxy (NGINX, cloud LB) and ensure JWT_SECRET is kept secret | |
| --- | |
| ## Troubleshooting | |
| ### "Vercel deployment failed" | |
| 1. Check GitHub repo is public (Vercel needs access) | |
| 2. Verify `frontend` directory exists | |
| 3. Check `package.json` has correct build script | |
| 4. View Vercel logs for details | |
| ### "Frontend can't reach backend" | |
| 1. Make sure `VITE_API_BASE_URL` is set to: `https://01ammu-data-cleaning-openenv.hf.space/api` | |
| 2. Backend URL must end with `/api` (don't forget!) | |
| 3. Re-deploy frontend: Vercel dashboard β Deployments β Redeploy | |
| ### "Backend is slow / timing out" | |
| HF Spaces might be sleeping. Just refresh the page. It'll wake up in 30 seconds. | |
| --- | |
| ## Cost Breakdown | |
| | Component | Service | Monthly Cost | Credit Card | | |
| |-----------|---------|--------------|------------| | |
| | Frontend | Vercel | $0 | No β | | |
| | Backend | HF Spaces | $0 | No β | | |
| | Database | SQLite | $0 | No β | | |
| | **Total** | | **$0** | **No** β | | |
| Perfect for a student portfolio! π | |