Repository navigation
Expand file tree
/
Copy pathverify-setup.sh
More file actions
executable file
·67 lines (58 loc) · 2.29 KB
/
Copy pathverify-setup.sh
File metadata and controls
executable file
·67 lines (58 loc) · 2.29 KB
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
#!/bin/bash
set -e
echo "=== Elion AI Engineer Interview - Setup Verification ==="
echo ""
# Step 1: Check Docker
echo "1. Checking Docker..."
if ! docker info > /dev/null 2>&1; then
echo " ❌ Docker is not running. Please start Docker Desktop."
exit 1
fi
echo " ✅ Docker is running"
# Step 2: Check Postgres container
echo "2. Checking PostgreSQL container..."
if ! docker compose ps 2>/dev/null | grep -q "elion-ai-postgres.*running"; then
echo " ❌ PostgreSQL container is not running. Run: docker compose up -d"
exit 1
fi
echo " ✅ PostgreSQL container is running"
# Step 3: Check .env.local
echo "3. Checking environment file..."
if [ ! -f .env.local ]; then
echo " ⚠️ No .env.local found (using defaults — that's fine for setup)"
else
echo " ✅ .env.local exists"
fi
# Step 4: Check database connection
echo "4. Checking database connection..."
if ! PGPASSWORD=elion_dev_password psql -h localhost -U elion -d elion_ai_interview -c "SELECT 1" > /dev/null 2>&1; then
echo " ❌ Cannot connect to database. Is PostgreSQL running?"
exit 1
fi
echo " ✅ Database connection successful"
# Step 5: Check tables exist
echo "5. Checking database tables..."
TABLE_COUNT=$(PGPASSWORD=elion_dev_password psql -h localhost -U elion -d elion_ai_interview -t -c "SELECT count(*) FROM information_schema.tables WHERE table_schema = 'public'" 2>/dev/null | tr -d ' ')
if [ "$TABLE_COUNT" -lt 2 ]; then
echo " ❌ Expected at least 2 tables, found $TABLE_COUNT. Run: make migrate"
exit 1
fi
echo " ✅ Found $TABLE_COUNT tables"
# Step 6: Check transcript data
echo "6. Checking transcript data..."
TRANSCRIPT_COUNT=$(PGPASSWORD=elion_dev_password psql -h localhost -U elion -d elion_ai_interview -t -c "SELECT count(*) FROM transcript" 2>/dev/null | tr -d ' ')
if [ "$TRANSCRIPT_COUNT" -lt 1 ]; then
echo " ❌ No transcripts found. Run: make seed"
exit 1
fi
echo " ✅ Found $TRANSCRIPT_COUNT transcripts"
# Step 7: Check API health
echo "7. Checking API health..."
HEALTH_RESPONSE=$(curl -s http://localhost:8000/api/health 2>/dev/null || echo "")
if [ -z "$HEALTH_RESPONSE" ]; then
echo " ⚠️ API not responding. Run: make dev (in another terminal)"
else
echo " ✅ API is healthy"
fi
echo ""
echo "=== Setup verification complete! ==="