-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (46 loc) · 1.92 KB
/
Makefile
File metadata and controls
69 lines (46 loc) · 1.92 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
.PHONY: help dev dev-backend dev-frontend build lint test test-backend test-frontend format migrate seed clean
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
# === Development ===
dev: ## Start all services via Docker Compose
docker compose up
dev-backend: ## Start only the API service
docker compose up api
dev-frontend: ## Start the frontend dev server locally
cd frontend && pnpm dev
# === Build ===
build: ## Build frontend for production
cd frontend && pnpm build
docker-build: ## Build Docker images for backend and frontend
docker build -t quicktrust-api --target production backend/
docker build -t quicktrust-web --target production frontend/
# === Quality ===
lint: ## Run linters (backend + frontend)
cd backend && ruff check . && ruff format --check .
cd frontend && pnpm lint
format: ## Auto-format code
cd backend && ruff format .
cd frontend && pnpm lint --fix
test: test-backend test-frontend ## Run all tests
test-backend: ## Run backend tests
cd backend && pytest --tb=short -q
test-frontend: ## Run frontend type check
cd frontend && pnpm exec tsc --noEmit
# === Database ===
migrate: ## Run database migrations
cd backend && alembic upgrade head
migrate-new: ## Create a new migration (usage: make migrate-new MSG="description")
cd backend && alembic revision --autogenerate -m "$(MSG)"
seed: ## Seed the database with sample data
docker compose exec api python -m seeds.run_seeds
# === Utilities ===
clean: ## Clean up Docker volumes and build artifacts
docker compose down -v
rm -rf frontend/.next frontend/node_modules/.cache
rm -f backend/quicktrust.db
logs: ## Tail all service logs
docker compose logs -f
shell-api: ## Open a shell in the API container
docker compose exec api bash
shell-db: ## Open a psql shell
docker compose exec postgres psql -U quicktrust -d quicktrust