Spaces:
Configuration error
Configuration error
File size: 2,764 Bytes
80e6d23 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | #!/bin/bash
# Quick Start Script for AI Interview Prep RL Environment
echo "π AI Interview Preparation RL Environment - Quick Start"
echo "========================================================"
echo ""
# Check if we're in the right directory
if [ ! -d "backend" ] || [ ! -d "frontend" ]; then
echo "β Error: Please run this script from the project root directory"
exit 1
fi
# Function to check if command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check prerequisites
echo "π Checking prerequisites..."
echo ""
if ! command_exists python3; then
echo "β Python 3 is not installed. Please install Python 3.8+"
exit 1
fi
echo "β
Python 3 found"
if ! command_exists node; then
echo "β Node.js is not installed. Please install Node.js 16+"
exit 1
fi
echo "β
Node.js found"
if ! command_exists npm; then
echo "β npm is not installed. Please install npm"
exit 1
fi
echo "β
npm found"
echo ""
echo "========================================================"
echo "π¦ Installing Dependencies..."
echo "========================================================"
echo ""
# Backend setup
echo "π Setting up backend..."
cd backend
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
fi
echo "Activating virtual environment..."
source venv/bin/activate
echo "Installing Python packages..."
pip install -r requirements.txt
echo ""
echo "β
Backend setup complete!"
echo ""
# Frontend setup
echo "βοΈ Setting up frontend..."
cd ../frontend
echo "Installing Node packages..."
npm install
echo ""
echo "β
Frontend setup complete!"
echo ""
# Back to root
cd ..
echo "========================================================"
echo "β
Installation Complete!"
echo "========================================================"
echo ""
echo "π Optional: Set OpenAI API Key (for real LLM responses)"
echo " export OPENAI_API_KEY='your-key-here'"
echo ""
echo " Note: System works with mock answers if no API key set"
echo ""
echo "========================================================"
echo "π― To start the application:"
echo "========================================================"
echo ""
echo "Terminal 1 (Backend):"
echo " cd backend"
echo " source venv/bin/activate"
echo " python main.py"
echo ""
echo "Terminal 2 (Frontend):"
echo " cd frontend"
echo " npm run dev"
echo ""
echo "Then open: http://localhost:3000"
echo ""
echo "========================================================"
echo "π§ͺ To test the backend first:"
echo "========================================================"
echo ""
echo " cd backend"
echo " source venv/bin/activate"
echo " python test_env.py"
echo ""
echo "Happy Hacking! π"
|