Translation_app_ / docs /README_DEPLOYMENT.md
Athena1621's picture
feat: Implement Multi-Lingual Product Catalog Translator frontend with Streamlit
67f25fb

A newer version of the Streamlit SDK is available: 1.54.0

Upgrade

πŸš€ Quick Deployment Guide

🎯 Choose Your Deployment Method

🟒 Option 1: Quick Demo (Recommended for Interviews)

Perfect for demonstrations and quick testing.

Windows:

# Double-click or run:
start_demo.bat

Linux/Mac:

./start_demo.sh

What it does:

  • Starts backend on port 8001
  • Starts frontend on port 8501
  • Opens browser automatically
  • Shows progress in separate windows

🟑 Option 2: Docker Deployment (Recommended for Production)

Professional containerized deployment.

Prerequisites:

Windows:

# Double-click or run:
deploy_docker.bat

Linux/Mac:

./deploy_docker.sh

What it does:

  • Builds Docker containers
  • Sets up networking
  • Provides health checks
  • Includes nginx reverse proxy (optional)

πŸ“Š Check Deployment Status

Windows:

check_status.bat

Linux/Mac:

curl http://localhost:8001/    # Backend health
curl http://localhost:8501/    # Frontend health

πŸ”— Access Your Application

Once deployed, access these URLs:


πŸ›‘ Stop Services

Quick Demo:

  • Windows: Run stop_services.bat or close command windows
  • Linux/Mac: Press Ctrl+C in terminal

Docker:

docker-compose down

πŸ†˜ Troubleshooting

Common Issues:

  1. Port already in use:

    # Kill existing processes
    taskkill /f /im python.exe     # Windows
    pkill -f python                # Linux/Mac
    
  2. Models not loading:

    • Check if models/indictrans2/ directory exists
    • Ensure models were downloaded properly
    • Check backend logs for errors
  3. Frontend can't connect to backend:

    • Verify backend is running on port 8001
    • Check frontend/app.py has correct API_BASE_URL
  4. Docker issues:

    # Check Docker status
    docker ps
    docker-compose logs
    
    # Reset Docker
    docker-compose down
    docker system prune -f
    docker-compose up --build
    

πŸ”§ Configuration

Environment Variables:

Create .env file in root directory:

MODEL_TYPE=indictrans2
MODEL_PATH=models/indictrans2
DEVICE=cpu
DATABASE_PATH=data/translations.db

For Production:

  • Copy .env.production to .env
  • Update database settings
  • Configure CORS origins
  • Set up monitoring

πŸ“ˆ Performance Tips

  1. Use GPU if available:

    DEVICE=cuda  # in .env file
    
  2. Increase memory for Docker:

    • Docker Desktop β†’ Settings β†’ Resources β†’ Memory: 8GB+
  3. Monitor resource usage:

    docker stats           # Docker containers
    htop                   # System resources
    

πŸŽ‰ Success Indicators

βœ… Deployment Successful When:


πŸ†˜ Need Help?

  1. Check the logs:

    • Quick Demo: Look at command windows
    • Docker: docker-compose logs -f
  2. Verify prerequisites:

    • Python 3.11+ installed
    • All dependencies in requirements.txt
    • Models downloaded in correct location
  3. Test individual components:


🎯 For Interview Demos: Use Quick Demo option - it's fastest and shows everything working!