-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·46 lines (37 loc) · 1 KB
/
run.sh
File metadata and controls
executable file
·46 lines (37 loc) · 1 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
#!/usr/bin/env bash
set -e
echo "========================================="
echo " MedStudy AI - Medical Study Assistant"
echo "========================================="
echo ""
# Check for .env
if [ ! -f backend/.env ]; then
echo "Creating backend/.env from .env.example..."
cp backend/.env.example backend/.env
echo ">> Please edit backend/.env and add your OPENAI_API_KEY"
exit 1
fi
# Backend setup
echo "[1/2] Setting up backend..."
cd backend
python -m venv .venv 2>/dev/null || true
source .venv/bin/activate
pip install -q -r requirements.txt
cd ..
# Frontend setup
echo "[2/2] Setting up frontend..."
cd frontend
npm install --silent
cd ..
echo ""
echo "Starting services..."
echo " Backend -> http://localhost:8000"
echo " Frontend -> http://localhost:5173"
echo ""
# Run both
cd backend && source .venv/bin/activate && uvicorn app.main:app --reload --port 8000 &
BACKEND_PID=$!
cd frontend && npm run dev &
FRONTEND_PID=$!
trap "kill $BACKEND_PID $FRONTEND_PID 2>/dev/null" EXIT
wait