File size: 1,598 Bytes
82fcb44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/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 "=========================================="