Repository navigation
Expand file tree
/
Copy pathstart.sh
More file actions
80 lines (64 loc) · 2.01 KB
/
Copy pathstart.sh
File metadata and controls
80 lines (64 loc) · 2.01 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
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
# LegalEase AI – Start Both Servers
# Usage: bash start.sh
set -e
echo ""
echo "╔══════════════════════════════════════╗"
echo "║ LegalEase AI – India ║"
echo "║ Full Stack: Python + React ║"
echo "╚══════════════════════════════════════╝"
echo ""
# Check Python
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 not found. Install from https://python.org"
exit 1
fi
# Check Node
if ! command -v node &> /dev/null; then
echo "❌ Node.js not found. Install from https://nodejs.org"
exit 1
fi
# Check API key
if grep -q "YOUR_GEMINI_API_KEY_HERE" backend/.env; then
echo "⚠️ WARNING: You haven't set your Gemini API key in backend/.env"
echo " Get a free key at: https://aistudio.google.com/apikey"
echo ""
fi
# Setup Python venv if needed
if [ ! -d "backend/venv" ]; then
echo "📦 Creating Python virtual environment..."
python3 -m venv backend/venv
fi
# Activate venv
source backend/venv/bin/activate
# Install Python deps
echo "📦 Installing Python dependencies..."
pip install -r backend/requirements.txt -q
# Install Node deps
if [ ! -d "frontend/node_modules" ]; then
echo "📦 Installing frontend dependencies..."
cd frontend && npm install -q && cd ..
fi
# Create reports directory
mkdir -p backend/generated_reports
echo ""
echo "🚀 Starting backend on http://localhost:8000"
echo "🚀 Starting frontend on http://localhost:5173"
echo ""
echo "Press Ctrl+C to stop both servers."
echo ""
# Start backend in background
cd backend
uvicorn main:app --reload --port 8000 &
BACKEND_PID=$!
cd ..
# Give backend a moment to start
sleep 2
# Start frontend
cd frontend
npm run dev &
FRONTEND_PID=$!
cd ..
# Wait and handle Ctrl+C
trap "echo ''; echo 'Shutting down...'; kill $BACKEND_PID $FRONTEND_PID 2>/dev/null; exit 0" INT
wait $BACKEND_PID $FRONTEND_PID