Spaces:
Sleeping
Sleeping
π Quick Deploy to Hugging Face Spaces
β‘ 5-Minute Deployment
Your app is ready to deploy! Everything is configured.
π What You Need
- β Hugging Face account (you have Pro!)
- β 10 minutes of time
- β This repository
π― Deployment Steps
Step 1: Run Preparation Script (Already Done!)
cd /home/thadillo/MyProjects/participatory_planner
./prepare_hf_deployment.sh
Status: β Complete! Files are ready.
Step 2: Create Hugging Face Space
Fill in the form:
- Space name:
participatory-planner(or your choice) - License: MIT
- SDK: β οΈ Docker (IMPORTANT!)
- Hardware: CPU Basic (free) or CPU Upgrade (Pro - faster)
- Visibility: Public or Private
- Space name:
Click: "Create Space"
Step 3: Upload Files
Two options:
Option A: Web UI (Easier)
- Go to your Space β Files tab
- Click "Add file" β "Upload files"
- Upload these files/folders:
β Dockerfile β README.md β requirements.txt β app_hf.py β wsgi.py β app/ (entire folder) - Commit: "Initial deployment"
Option B: Git Push
# Add HF as remote (replace YOUR_USERNAME)
git remote add hf https://huggingface.co/spaces/YOUR_USERNAME/participatory-planner
# Push
git add Dockerfile README.md requirements.txt app_hf.py wsgi.py app/
git commit -m "π Deploy to HF Spaces"
git push hf main
Step 4: Configure Secret Key
- Go to: Your Space β Settings β Repository secrets
- Click: "New secret"
- Add:
- Name:
FLASK_SECRET_KEY - Value:
9fd11d101e36efbd3a7893f56d604b860403d247633547586c41453118e69b00
- Name:
- Save
Step 5: Wait for Build
- Go to Logs tab
- Watch the build (5-10 minutes first time)
- Look for:
β Running on http://0.0.0.0:7860 - Status will change: "Building" β "Running" β
Step 6: Access Your App! π
Your app is live at:
- Direct:
https://huggingface.co/spaces/YOUR_USERNAME/participatory-planner - Embedded:
https://YOUR_USERNAME-participatory-planner.hf.space
Login: <see-startup-logs-or-set-ADMIN_TOKEN>
β Verify Deployment
Test these features:
- App loads correctly
- Admin login works
- Can create tokens
- Can submit contributions
- AI analysis works
- Dashboard displays
- Training panel accessible
- Data persists after refresh
π§ Troubleshooting
Build Failed?
- Check Logs tab for error details
- Verify Docker SDK was selected
- Try CPU Upgrade if out of memory
App Not Loading?
- Wait 10 minutes for model download
- Check Logs for errors
- Verify port 7860 in Dockerfile
Database Issues?
- Database creates automatically on first run
- Stored in
/data/app.db(persists) - Check Space hasn't run out of storage
π Bonus: Pro Features
With your HF Pro account:
Faster Performance
- Settings β Hardware β CPU Upgrade (4 vCPU, 32GB RAM)
Private Space
- Settings β Visibility β Private
- Perfect for confidential planning sessions
Custom Domain
- Settings β Custom domains
- Add:
planning.yourdomain.com
Always-On
- Settings β Sleep time β Never sleep
- No cold starts!
π What Gets Deployed
Included:
- β
Full application code (
app/) - β AI models (download on first run)
- β Database (created automatically)
- β All features working
NOT Included:
- β Local development files
- β Your local database
- β venv/
- β .env file (use Secrets instead)
π Security Notes
Current Setup:
- β Secret key stored in HF Secrets (not in code)
- β HTTPS enabled automatically
- β Session cookies configured
- β οΈ Default admin token:
<see-startup-logs-or-set-ADMIN_TOKEN>
For Production:
- Change admin token to something secure
- Enable Space authentication (Settings)
- Make Space private if handling sensitive data
- Regular backups via Export feature
π Performance
Expected:
- Build time: 5-10 minutes (first time)
- Model download: 5 minutes (first run, then cached)
- Startup time: 10-20 seconds
- Inference: <3 seconds per submission
- Storage: ~2GB (model + database)
With Pro CPU Upgrade:
- β‘ 2x faster inference
- β‘ Faster model loading
- β‘ Better for large sessions (100+ submissions)
π Support
Documentation:
- Full guide:
HUGGINGFACE_DEPLOYMENT.md - Checklist:
HF_DEPLOYMENT_CHECKLIST.md - HF Docs: https://huggingface.co/docs/hub/spaces
Help:
- Logs: Your Space β Logs tab
- HF Discord: https://hf.co/join/discord
- HF Forum: https://discuss.huggingface.co/
π― Quick Summary
1. Create Space (SDK: Docker) β 1 min
2. Upload files β 2 min
3. Add FLASK_SECRET_KEY to Secrets β 1 min
4. Wait for build β 10 min
5. Test & enjoy! β β
Total: ~15 minutes
Cost: $0 (included in HF Pro!)
β¨ You're Ready!
Everything is configured and tested. Just follow the steps above.
Next: Click this link β https://huggingface.co/new-space
Good luck! ππ
Files prepared by: prepare_hf_deployment.sh
Deployment verified: β
Ready
Secret key generated: β
Ready
Docker config: β
Port 7860
Database: β
Auto-creates at /data/app.db