-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (38 loc) · 1.55 KB
/
Makefile
File metadata and controls
47 lines (38 loc) · 1.55 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
.PHONY: all setup build-web build-master run dev test clean help
help:
@echo "make all - 설치 + 정적 빌드 + 마스터 DB + 앱 실행"
@echo "make setup - 의존성만 설치"
@echo "make build-web - Next.js 정적 빌드"
@echo "make build-master - 마스터 DB 빌드"
@echo "make run - FastAPI 서버 실행 (1024 포트, 정적빌드 포함)"
@echo "make dev - 백엔드(8000) + 프론트(3000) 분리 실행"
@echo "make test - pytest"
@echo "make clean - master/, cache/, .venv/, web/node_modules/, web/out 삭제"
all: setup build-web build-master run
setup:
@command -v uv >/dev/null 2>&1 || { echo "→ uv 설치 중..."; brew install uv; }
@echo "→ Python 의존성"
uv sync
@echo "→ Web 의존성"
cd web && npm install --no-audit --no-fund
build-web:
cd web && npm run build
build-master: setup
@if [ ! -f master/catalog.json ]; then \
echo "→ 마스터 DB 빌드 (DINOv2 ~340MB 다운로드 + Mercari 스크래핑, 15~60분)"; \
uv run python scripts/build_master.py --workers 8; \
else \
echo "✓ master/catalog.json 존재"; \
fi
run: setup build-web
uv run uvicorn api.main:app --host 0.0.0.0 --port 1024 --reload
dev: setup
@echo "→ 두 프로세스 분리 실행. 한 터미널에서:"
@echo " uv run uvicorn api.main:app --reload --port 8000"
@echo " 다른 터미널에서:"
@echo " cd web && NEXT_PUBLIC_API_BASE=http://localhost:8000 npm run dev"
test: setup
uv run pytest -v
clean:
rm -rf master/ cache/ .venv/ web/node_modules/ web/.next/ web/out/
@echo "✓ Cleaned"