#!/bin/bash

# Script to setup Google OAuth for Daleeli IQ Backend

echo "🚀 Setting up Google OAuth for Backend..."
echo ""

# Check if virtual environment exists
if [ -d "venv" ]; then
    echo "📦 Activating virtual environment..."
    source venv/bin/activate
fi

# Install required packages
echo "📥 Installing required packages..."
pip install -r requirements.txt

echo ""
echo "✅ Packages installed!"
echo ""

# Check if .env file exists
if [ ! -f ".env" ]; then
    echo "📝 Creating .env file..."
    echo "GOOGLE_CLIENT_ID=YOUR_WEB_CLIENT_ID.apps.googleusercontent.com" > .env
    echo "⚠️  Please update GOOGLE_CLIENT_ID in .env file with your actual Web Client ID from Firebase Console"
else
    echo "✅ .env file already exists"
fi

echo ""
echo "📋 Next steps:"
echo "1. Update GOOGLE_CLIENT_ID in .env file"
echo "2. Run: python manage.py makemigrations accounts"
echo "3. Run: python manage.py migrate"
echo ""
echo "✨ Setup complete!"

