#!/bin/bash # Local development script for Email Alerts Application # This script runs the application locally for testing echo "๐Ÿš€ Starting Email Alerts Application locally..." # Check if virtual environment exists if [ ! -d "venv" ]; then echo "โŒ Virtual environment not found. Creating one..." python3 -m venv venv fi # Activate virtual environment echo "๐Ÿ”ง Activating virtual environment..." source venv/bin/activate # Install dependencies if needed echo "๐Ÿ“ฆ Installing dependencies..." pip install -r requirements.txt # Clear any cached Python files echo "๐Ÿงน Clearing Python cache..." find . -name "*.pyc" -delete 2>/dev/null || true find . -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true # Check if port 5237 is available if lsof -Pi :5237 -sTCP:LISTEN -t >/dev/null ; then echo "โš ๏ธ Port 5237 is already in use. Stopping existing process..." pkill -f "python.*run_server.py" 2>/dev/null || true sleep 2 fi echo "๐ŸŒ Starting local server on port 5237..." echo "๐Ÿ“ฑ Web interface will be available at: http://localhost:5237" echo "๐Ÿ”— Dashboard: http://localhost:5237/" echo "โš™๏ธ Settings: http://localhost:5237/settings" echo "" echo "๐Ÿ’ก To test the connection:" echo " 1. Go to http://localhost:5237/settings" echo " 2. Enter Zoho credentials:" echo " Email: projects@manaknightdigital.com" echo " Password: 4o%!sbk\$(3!>@#567!!" echo " 3. Click 'Test Connection'" echo "" echo "๐Ÿ›‘ Press Ctrl+C to stop the server" echo "" # Start the server python run_server.py