-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (53 loc) · 3.38 KB
/
Makefile
File metadata and controls
73 lines (53 loc) · 3.38 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
# ── GitUnderstand Makefile ──
# Run `make help` to see all available commands.
.PHONY: help dev dev-backend dev-diagrams-backend dev-web \
test test-backend test-diagrams-backend test-web \
lint lint-backend lint-web build build-web \
docker-up docker-down db-push db-studio clean
# ── Help ──────────────────────────────────────────────────────
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-24s\033[0m %s\n", $$1, $$2}'
# ── Development ───────────────────────────────────────────────
dev: ## Start all services via Docker Compose
docker compose up --build
dev-backend: ## Run the ingestion backend (Python) locally
cd src && python -m api
dev-diagrams-backend: ## Run the diagram backend (Python) locally
cd diagrams/backend && uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
dev-web: ## Run the Next.js frontend locally
cd diagrams && pnpm dev
# ── Testing ───────────────────────────────────────────────────
test: test-backend test-diagrams-backend test-web ## Run all tests
test-backend: ## Run ingestion backend tests (pytest)
pytest tests/ -v
test-diagrams-backend: ## Run diagram backend tests (pytest)
cd diagrams/backend && python -m pytest tests/ -v
test-web: ## Run frontend tests (vitest)
cd diagrams && pnpm test
# ── Linting ───────────────────────────────────────────────────
lint: lint-backend lint-web ## Run all linters
lint-backend: ## Lint Python code (ruff)
ruff check src/ tests/
lint-web: ## Lint frontend code (Next.js built-in ESLint)
cd diagrams && pnpm lint
# ── Building ──────────────────────────────────────────────────
build: build-web ## Build all artifacts
build-web: ## Build the Next.js frontend
cd diagrams && SKIP_ENV_VALIDATION=1 pnpm build
# ── Docker ────────────────────────────────────────────────────
docker-up: ## Start all services in Docker (detached)
docker compose up -d --build
docker-down: ## Stop all Docker services
docker compose down
# ── Database ──────────────────────────────────────────────────
db-push: ## Push Drizzle schema to the database
cd diagrams && pnpm db:push
db-studio: ## Open Drizzle Studio (database GUI)
cd diagrams && pnpm db:studio
# ── Cleanup ───────────────────────────────────────────────────
clean: ## Remove build artifacts and caches
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
rm -rf diagrams/.next diagrams/node_modules/.cache
@echo "Cleaned build artifacts and caches."