facerecog / scripts /setup.sh
atomio
Initial commit
194469b
Raw History Blame Contribute Delete
1.86 kB
#!/bin/bash
# Face Recognition API Setup Script
set -e
echo "πŸš€ Setting up Face Recognition API..."
# Check if Python 3.11+ is installed
python_version=$(python3 --version 2>&1 | awk '{print $2}' | cut -d. -f1,2)
required_version="3.11"
if [ "$(printf '%s\n' "$required_version" "$python_version" | sort -V | head -n1)" != "$required_version" ]; then
echo "❌ Python 3.11 or higher is required. Current version: $python_version"
exit 1
fi
echo "βœ… Python version check passed: $python_version"
# Create virtual environment
if [ ! -d "venv" ]; then
echo "πŸ“¦ Creating virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment
echo "πŸ”§ Activating virtual environment..."
source venv/bin/activate
# Upgrade pip
echo "⬆️ Upgrading pip..."
pip install --upgrade pip
# Install dependencies
echo "πŸ“š Installing dependencies..."
pip install -e ".[dev,test]"
# Copy environment file
if [ ! -f ".env" ]; then
echo "πŸ“ Creating .env file from template..."
cp .env.example .env
echo "⚠️ Please edit .env file with your Supabase credentials"
else
echo "βœ… .env file already exists"
fi
# Create necessary directories
echo "πŸ“ Creating directories..."
mkdir -p uploads
mkdir -p temp
mkdir -p logs
# Install pre-commit hooks
echo "πŸͺ Installing pre-commit hooks..."
pre-commit install
# Run initial checks
echo "πŸ” Running initial code checks..."
ruff check . --exclude=venv,build,dist --fix || true
ruff format . --exclude=venv,build,dist
echo "βœ… Setup complete!"
echo ""
echo "Next steps:"
echo "1. Edit .env file with your Supabase credentials"
echo "2. Run the SQL files in sql/ directory in your Supabase SQL Editor"
echo "3. Activate virtual environment: source venv/bin/activate"
echo "4. Start development server: make dev"
echo ""
echo "For more commands, run: make help"