-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (54 loc) · 2.81 KB
/
Copy pathMakefile
File metadata and controls
68 lines (54 loc) · 2.81 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
.PHONY: start pull clean build deps warmup stop
ACTIVATE := source .venv/bin/activate
PORT_BACKEND := 8080
PORT_FRONTEND := 5173
# ── Main target: kill stale → deps → build → warm-up → server ────────────
start: stop deps build
@$(ACTIVATE) && python3 scripts/warmup.py
@echo "\n Launching backend (:$(PORT_BACKEND)) + frontend (:$(PORT_FRONTEND))...\n"
@$(ACTIVATE) && python3 run.py &
@sleep 2
@cd frontend/mac && npx vite --force --port $(PORT_FRONTEND) &
@sleep 2
@echo ""
@echo " ──────────────────────────────────────"
@echo " \033[92m✓\033[0m \033[1mREADY\033[0m"
@echo ""
@echo " App: http://localhost:$(PORT_FRONTEND)/"
@echo " Backend: http://localhost:$(PORT_BACKEND)/"
@echo " Mock: http://localhost:$(PORT_FRONTEND)/?mock"
@echo " Preview: http://localhost:$(PORT_FRONTEND)/?preview=concierge"
@echo " ──────────────────────────────────────"
@echo ""
@echo " Press Ctrl+C to stop all servers."
@wait
# ── Kill anything on our ports ────────────────────────────────────────────
stop:
@lsof -ti:$(PORT_BACKEND) 2>/dev/null | xargs kill 2>/dev/null || true
@lsof -ti:$(PORT_FRONTEND) 2>/dev/null | xargs kill 2>/dev/null || true
@pkill -f 'osascript.*set targetApp' 2>/dev/null || true
@sleep 0.5
# ── Install / sync dependencies ───────────────────────────────────────────
deps:
@if [ ! -d .venv ]; then \
echo " Creating virtualenv..."; \
python3 -m venv .venv; \
fi
@echo " Syncing dependencies..."
@$(ACTIVATE) && pip install -q -r requirements.txt 2>&1 | tail -1
# ── Build frontend ────────────────────────────────────────────────────────
build:
@echo " Building frontend..."
@cd frontend/mac && npm run build 2>&1 | tail -3
# ── Warm-up only (no server) ─────────────────────────────────────────────
warmup:
@$(ACTIVATE) && python3 scripts/warmup.py
# ── Git helpers ───────────────────────────────────────────────────────────
pull:
@git stash drop 2>/dev/null || true
@git checkout -- . 2>/dev/null || true
@git pull origin main --ff-only 2>/dev/null || true
clean:
@git stash drop 2>/dev/null || true
@git checkout -- .
@echo "Clean — all local changes reset to remote."