102 lines
2.3 KiB
Bash
Executable File
102 lines
2.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Street Lingo Development Startup Script
|
|
echo "🌍 Starting Street Lingo Platform..."
|
|
echo ""
|
|
|
|
# Colors for output
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m' # No Color
|
|
|
|
# Function to print colored output
|
|
print_status() {
|
|
echo -e "${GREEN}[INFO]${NC} $1"
|
|
}
|
|
|
|
print_warning() {
|
|
echo -e "${YELLOW}[WARN]${NC} $1"
|
|
}
|
|
|
|
print_error() {
|
|
echo -e "${RED}[ERROR]${NC} $1"
|
|
}
|
|
|
|
print_info() {
|
|
echo -e "${BLUE}[INFO]${NC} $1"
|
|
}
|
|
|
|
# Check if we're in the right directory
|
|
if [ ! -f "backend/main.py" ]; then
|
|
print_error "Please run this script from the root directory of the project"
|
|
exit 1
|
|
fi
|
|
|
|
# Start backend
|
|
print_status "Starting backend server on port 8000..."
|
|
cd backend
|
|
uv run python main.py &
|
|
BACKEND_PID=$!
|
|
cd ..
|
|
|
|
# Wait a moment for backend to start
|
|
sleep 3
|
|
|
|
# Start Indonesian app
|
|
print_status "Starting Indonesian app (Street Lingo Indo) on port 3000..."
|
|
cd apps/indonesian-app
|
|
npm install
|
|
npm run dev &
|
|
INDO_PID=$!
|
|
cd ../..
|
|
|
|
# Start German app
|
|
print_status "Starting German app (Street Lingo Berlin) on port 3001..."
|
|
cd apps/german-app
|
|
npm install
|
|
npm run dev &
|
|
GERMAN_PID=$!
|
|
cd ../..
|
|
|
|
# Wait a moment for apps to start
|
|
sleep 5
|
|
|
|
echo ""
|
|
print_info "🎉 Street Lingo Platform is now running!"
|
|
echo ""
|
|
echo "📱 Applications:"
|
|
echo " 🇮🇩 Indonesian App: http://localhost:3000"
|
|
echo " 🇩🇪 German App: http://localhost:3001"
|
|
echo ""
|
|
echo "🔧 Backend API:"
|
|
echo " 📡 Main API: http://localhost:8000"
|
|
echo " 📊 API Docs: http://localhost:8000/docs"
|
|
echo ""
|
|
echo "🌐 WebSocket Endpoints:"
|
|
echo " 🇮🇩 Indonesian WS: ws://localhost:8000/ws/speech/indonesian"
|
|
echo " 🇩🇪 German WS: ws://localhost:8000/ws/speech/german"
|
|
echo ""
|
|
echo "🎯 API Routes:"
|
|
echo " 🇮🇩 Indonesian API: http://localhost:8000/api/scenarios/indonesian"
|
|
echo " 🇩🇪 German API: http://localhost:8000/api/scenarios/german"
|
|
echo ""
|
|
print_warning "Press Ctrl+C to stop all services"
|
|
echo ""
|
|
|
|
# Function to cleanup processes
|
|
cleanup() {
|
|
print_status "Stopping all Street Lingo services..."
|
|
kill $BACKEND_PID 2>/dev/null
|
|
kill $INDO_PID 2>/dev/null
|
|
kill $GERMAN_PID 2>/dev/null
|
|
print_status "All services stopped. Goodbye!"
|
|
exit 0
|
|
}
|
|
|
|
# Set up signal handlers
|
|
trap cleanup SIGINT SIGTERM
|
|
|
|
# Wait for user to stop
|
|
wait |