-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
103 lines (80 loc) · 2.44 KB
/
Makefile
File metadata and controls
103 lines (80 loc) · 2.44 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.PHONY: dev backend frontend infra stop clean seed test lint setup docs sync pr ship merge branches worktree-clean branch-clean
# --- First time setup ---
setup:
./setup.sh
# --- Infrastructure (Postgres + Redis) ---
infra:
docker compose up -d postgres redis
@echo "Waiting for PostgreSQL..."
@until docker compose exec -T postgres pg_isready -U tasktime >/dev/null 2>&1; do sleep 1; done
@echo "PostgreSQL ready on :5432, Redis ready on :6379"
# --- Dev servers ---
backend: infra
cd backend && npm run dev
frontend:
cd frontend && npm run dev
# Start both backend and frontend (backend in background)
dev: infra
@echo "Starting backend on :3000 and frontend on :5173..."
@cd backend && npm run dev &
@cd frontend && npm run dev
# --- Database ---
seed:
cd backend && npm run db:seed
db-push:
cd backend && npm run db:migrate:deploy
db-reset:
cd backend && npm run db:migrate:reset && npm run db:seed
db-studio:
cd backend && npx prisma studio
# --- Documentation ---
docs:
@NODE_BIN=$$(command -v node) || { echo "Error: node not found on PATH"; exit 1; }; \
$$NODE_BIN scripts/generate-docs.js
# --- Quality ---
test:
cd backend && npm test
# Security: dependency vulnerabilities (run periodically and before release)
audit:
cd backend && npm audit
cd frontend && npm audit
test-cov:
cd backend && npm run test:coverage
lint:
cd backend && npm run lint
cd frontend && npm run lint
# --- Git workflow ---
sync:
@git fetch origin
@git rebase origin/main
@echo "Synced with origin/main"
pr:
@git push -u origin $$(git branch --show-current)
@gh pr create --fill
ship: sync lint pr
merge:
@gh pr merge --squash --delete-branch
branches:
@git branch -a --format='%(refname:short) %(committerdate:relative)' | grep -E 'claude/|cursor/' | sort
# --- Cleanup ---
stop:
docker compose down
@-pkill -f "tsx watch" 2>/dev/null || true
@-pkill -f "vite" 2>/dev/null || true
@echo "All services stopped"
clean: stop
docker compose down -v
rm -rf backend/node_modules frontend/node_modules
@echo "Cleaned up volumes and node_modules"
# --- TBD: Cleanup stale worktrees and merged branches ---
worktree-clean:
@echo "Removing stale git worktrees..."
@git worktree prune
@git worktree list
@echo "Done."
branch-clean:
@echo "Removing local branches merged into main..."
@git branch --merged main | grep -vE '^\*|main$$' | xargs -r git branch -d
@echo "Removing remote-tracking branches that no longer exist..."
@git fetch --prune
@echo "Done."