π Deploy VerityNgn UI to Streamlit Community Cloud
Current Status
β UI is running locally: http://localhost:8501β API is running locally: http://localhost:8080
β ngrok tunnel active: https://oriented-flea-large.ngrok-free.app
π Quick Deployment Steps
Step 1: Push Code to GitHub (if not already)
Step 2: Sign Up for Streamlit Community
- Go to: https://share.streamlit.io
- Sign in with your GitHub account
- Free forever (no credit card needed!)
Step 3: Deploy App
- Click: βNew appβ button
-
Fill in:
- Repository:
yourusername/verityngn-oss(your repo) - Branch:
main - Main file path:
ui/streamlit_app.py - App URL: Choose subdomain (e.g.,
verityngn)
- Repository:
-
Advanced settings (optional):
- Python version: 3.12
- Click βDeployβ
Step 4: Configure Secrets
IMPORTANT: Add your API URL before the app starts!- While app is deploying, click ββοΈ Settingsβ
- Click βSecretsβ tab
- Add this configuration:
- Click βSaveβ
- App will automatically restart with new secrets
Step 5: Wait for Deployment
- Takes ~2-3 minutes
- Watch the logs for progress
- App will auto-open when ready
Step 6: Test Your Deployed App
- Visit your app:
https://verityngn.streamlit.app(or your chosen URL) - Test health: Should show βAPI is healthyβ indicator
- Submit a video: Try the example videos
- View reports: Check existing verification results
βοΈ Configuration Files Created
Iβve created these files for you:1. ui/.streamlit/config.toml
Streamlit app configuration (theme, server settings)
2. ui/.streamlit/secrets.toml.example
Template showing what secrets to add (donβt commit real secrets!)
3. ui/packages.txt
System dependencies for Streamlit Cloud
4. ui/README.md
Complete deployment documentation
π§ Secrets Configuration
What You Need to Add
In Streamlit Cloud Dashboard β Settings β Secrets:What You DONβT Need
- β
GOOGLE_APPLICATION_CREDENTIALS- API handles this - β
GOOGLE_CLOUD_PROJECT- API handles this - β Any other secrets - UI is stateless!
π― Using ngrok URL
Current URL
Important Notes
β οΈ Free ngrok URL changes when you restart ngrok! When URL changes:- Get new ngrok URL
- Go to Streamlit Cloud β Settings β Secrets
- Update
VERITYNGN_API_URL - Save (app auto-restarts)
Better Option: Paid ngrok or Cloud Run
Paid ngrok ($8/month):- Reserve domain:
https://verityngn-api.ngrok.app - Never changes!
- Update secrets once
- Permanent URL
- Better performance
- No dependency on local machine
π§ͺ Testing Checklist
Before going live:- Local UI works: http://localhost:8501
- Local API works: http://localhost:8080/health
- ngrok tunnel works: https://oriented-flea-large.ngrok-free.app/health
- Code pushed to GitHub
- Streamlit account created
- Secrets configured
- App deployed successfully
π What Users Will See
1. Home Page
- Submit YouTube video URLs
- See processing status
- View recent reports
2. View Reports
- Browse all verification reports
- See truthfulness scores
- Expand claim details
3. Processing Status
- Real-time progress updates
- Estimated completion time
- Error messages if any
π Troubleshooting
App wonβt start
Check logs in Streamlit Cloud dashboard Common issues:- Missing
VERITYNGN_API_URLsecret - Wrong file path (should be
ui/streamlit_app.py) - Python version mismatch
Canβt connect to API
Verify:- ngrok is still running locally
- API is healthy:
curl https://your-url/health - URL in secrets matches ngrok URL exactly
ngrok URL changed
Fix:- Get new URL from ngrok terminal
- Update secrets in Streamlit Cloud
- Save (auto-restarts app)
Deployment timeout
Streamlit Cloud might be busy- Wait 5-10 minutes
- Try deploying again
- Check Streamlit status: https://status.streamlit.io
π¨ Customization
Change App Appearance
Editui/.streamlit/config.toml:
Add Features
Modifyui/streamlit_app.py and components in ui/components/
Update Dependencies
Editui/requirements.txt (use minimal dependencies for faster deploys)
π Going Live
Share Your App
Once deployed, share the URL:Add to GitHub README
Add a badge to your repo README:Monitor Usage
View stats in Streamlit Cloud dashboard:- Active users
- Resource usage
- Error rates
- Logs
π Next Steps
Immediate
- Deploy to Streamlit Community (follow steps above)
- Test with ngrok URL
- Share with users
Short-term
- Get paid ngrok for persistent URL
- OR deploy API to Cloud Run
Long-term
- Deploy API to Cloud Run (production)
- Remove ngrok dependency
- Add authentication if needed
- Scale as needed
β Ready to Deploy?
Run these commands:Your ngrok URL: https://oriented-flea-large.ngrok-free.app
Local UI: http://localhost:8501
Streamlit Cloud: https://share.streamlit.io Letβs deploy! π
