-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_local.sh
More file actions
41 lines (33 loc) · 1.88 KB
/
start_local.sh
File metadata and controls
41 lines (33 loc) · 1.88 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
#!/usr/bin/env bash
# ─────────────────────────────────────────────────────────────────────────────
# CodeGraph — Local development startup script
#
# Usage:
# ./start_local.sh # starts both frontend dev server & backend
# ANTHROPIC_API_KEY=sk-... ./start_local.sh # with AI features enabled
# ─────────────────────────────────────────────────────────────────────────────
set -e
ROOT="$(cd "$(dirname "$0")" && pwd)"
# ── Backend ──────────────────────────────────────────────
echo "→ Installing Python dependencies…"
cd "$ROOT"
pip install -r backend/requirements.txt -q
echo "→ Starting FastAPI backend on http://localhost:8000 …"
uvicorn backend.main:app --host 127.0.0.1 --port 8000 --reload &
BACKEND_PID=$!
# ── Frontend ─────────────────────────────────────────────
echo "→ Installing frontend dependencies…"
cd "$ROOT/frontend"
npm install -q
echo "→ Starting Vite dev server on http://localhost:5173 …"
npm run dev &
FRONTEND_PID=$!
# ── Cleanup on exit ──────────────────────────────────────
trap "echo ''; echo 'Shutting down…'; kill $BACKEND_PID $FRONTEND_PID 2>/dev/null" EXIT INT TERM
echo ""
echo "✓ CodeGraph is running!"
echo " → Open http://localhost:5173 in your browser"
echo " → Backend API: http://localhost:8000/api"
echo " → Press Ctrl+C to stop"
echo ""
wait