#!/bin/bash echo "==========================================" echo "Tracker Microservice Setup" echo "==========================================" # Check Python version echo "" echo "Checking Python version..." python3 --version # Install insightfy-utils from wheel first echo "" echo "Installing insightfy-utils..." python3 -m pip install --user app/insightfy_utils-0.1.0-py3-none-any.whl # Install dependencies echo "" echo "Installing dependencies..." python3 -m pip install --user -r requirements.txt # Check if .env exists echo "" if [ -f ".env" ]; then echo "✅ .env file exists" else echo "⚠️ .env file not found. Creating from .env.example..." cp .env.example .env echo "✅ Created .env file. Please edit it with your credentials." fi # Run migration echo "" echo "Do you want to run the database migration now? (y/n)" read -r response if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then echo "Running migration..." python3 migrate_attendance.py else echo "Skipping migration. Run 'python3 migrate_attendance.py' when ready." fi echo "" echo "==========================================" echo "✅ Setup Complete!" echo "==========================================" echo "" echo "Next steps:" echo "1. Edit .env file with your database credentials" echo "2. Run migration: python3 migrate_attendance.py" echo "3. Start service: python3 -m uvicorn app.main:app --host 0.0.0.0 --port 8003 --reload" echo "4. Or press F5 in VS Code to debug" echo "" echo "API Documentation: http://localhost:8003/docs" echo "=========================================="