Deployment Overview
This guide covers deploying your chat application to production. You have several options depending on your budget and requirements.
Deployment Options
| Option | Cost | Effort | Best For |
|---|---|---|---|
| Hugging Face Spaces (backend) | Free tier | Low | AI/ML apps, students |
| Render (backend only) | Free tier (sleeps after inactivity) | Low | Free hosting |
| Fly.io (backend only) | ~$2-5/month | Medium | Always-on production |
| VPS (DigitalOcean, AWS) | ~$6-50/month | High | Full control |
| EAS Build (mobile) | Free tier (30 builds/month) | Low | Publishing mobile app |
What You Need to Deploy
- Backend: Flask app → production server (Gunicorn + Docker on Hugging Face Spaces)
- Database: SQLite → PostgreSQL (Supabase for production)
- Mobile: Expo app → APK/IPA → App Store / Google Play
- API Keys: OpenAI (or other provider) configured on the server
The Recommended Path
For a first deployment, use this path:
Backend: Hugging Face Spaces (free, Docker-based)
↓
Database: Supabase PostgreSQL (free tier)
↓
Mobile: EAS Build → share QR code via Expo
↓
Final: Publish to app stores (optional)
Files in This Section
| File | What it covers |
|---|---|
backend-production.md |
Deploy Flask to Hugging Face Spaces step-by-step |
database-production.md |
Migrate from SQLite to PostgreSQL (Supabase) |
mobile-production.md |
Build APK/IPA with EAS Build |
cost-estimation.md |
How much will this cost at scale? |
Prerequisites for Deployment
- A GitHub account (to push your code)
- A Hugging Face account (sign up at https://huggingface.co/join)
- An Expo account (sign up at https://expo.dev)
- Docker installed (for building the production Docker image)
- Your project committed to a git repo
cd aiproject
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/YOUR_USERNAME/aiproject.git
git push -u origin main