-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (59 loc) · 2.89 KB
/
Copy pathMakefile
File metadata and controls
76 lines (59 loc) · 2.89 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
.PHONY: help install dev dev-backend dev-frontend db-up db-down db-reset migrate seed test verify-m1 verify-m2 verify-m3 verify-m4 clean
SHELL := /bin/bash
BACKEND_DIR := backend
FRONTEND_DIR := frontend
PYTHON := python3
UV := $(shell command -v uv 2>/dev/null)
PNPM := $(shell command -v pnpm 2>/dev/null)
help: ## Show available targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'
install: ## Install backend (uv) and frontend (pnpm) dependencies
@echo "→ Backend"
@cd $(BACKEND_DIR) && \
if [ -n "$(UV)" ]; then uv sync; else $(PYTHON) -m venv .venv && . .venv/bin/activate && pip install -e .; fi
@echo "→ Frontend"
@cd $(FRONTEND_DIR) && \
if [ -n "$(PNPM)" ]; then pnpm install; else npm install; fi
db-up: ## Start Postgres via docker-compose
docker compose up -d postgres
@echo "→ Waiting for Postgres to be ready..."
@until docker compose exec -T postgres pg_isready -U tata -d tata_concierge >/dev/null 2>&1; do sleep 1; done
@echo "→ Postgres is ready."
db-down: ## Stop Postgres
docker compose down
db-reset: ## Drop the database and recreate it (DESTRUCTIVE)
docker compose down -v
$(MAKE) db-up
$(MAKE) migrate
$(MAKE) seed
migrate: ## Run Alembic migrations
cd $(BACKEND_DIR) && \
if [ -n "$(UV)" ]; then uv run alembic upgrade head; else . .venv/bin/activate && alembic upgrade head; fi
seed: ## Load catalog and demo customers into Postgres
cd $(BACKEND_DIR) && \
if [ -n "$(UV)" ]; then uv run python -m app.scripts.seed; else . .venv/bin/activate && python -m app.scripts.seed; fi
dev-backend: ## Run FastAPI on :8000 (auto-reload)
cd $(BACKEND_DIR) && \
if [ -n "$(UV)" ]; then uv run uvicorn app.main:app --reload --port 8000; else . .venv/bin/activate && uvicorn app.main:app --reload --port 8000; fi
dev-frontend: ## Run Next.js on :3000
cd $(FRONTEND_DIR) && \
if [ -n "$(PNPM)" ]; then pnpm dev; else npm run dev; fi
dev: db-up ## Start Postgres + backend + frontend together
@echo "→ Postgres up. Starting backend and frontend in parallel."
@$(MAKE) -j 2 dev-backend dev-frontend
test: ## Run backend pytest + frontend vitest
cd $(BACKEND_DIR) && \
if [ -n "$(UV)" ]; then uv run pytest -v; else . .venv/bin/activate && pytest -v; fi
cd $(FRONTEND_DIR) && \
if [ -n "$(PNPM)" ]; then pnpm test; else npm test; fi
verify-m1: ## Verify Milestone 1 — Spine (DB, audit, health, frontend landing)
bash scripts/verify_m1.sh
verify-m2: ## Verify Milestone 2 — Tool registry
bash scripts/verify_m2.sh
verify-m3: ## Verify Milestone 3 — Concierge graph + Sales sub-agent
bash scripts/verify_m3.sh
verify-m4: ## Verify Milestone 4 — Streaming + /concierge UI
bash scripts/verify_m4.sh
clean: ## Remove generated build artifacts
rm -rf $(BACKEND_DIR)/.venv $(BACKEND_DIR)/__pycache__ $(BACKEND_DIR)/.pytest_cache
rm -rf $(FRONTEND_DIR)/.next $(FRONTEND_DIR)/node_modules