-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (52 loc) · 3.21 KB
/
Makefile
File metadata and controls
79 lines (52 loc) · 3.21 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
BACKEND_DIR := harvest-finance/backend
FRONTEND_DIR := harvest-finance/frontend
.PHONY: help dev build test lint format \
db:migrate db:migrate:revert db:seed db:seed:clear db:seed:reset \
docker:up docker:down docker:logs
help:
@grep -E '^[a-zA-Z_:/-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-22s\033[0m %s\n", $$1, $$2}'
## ── Development ────────────────────────────────────────────────────────────────
dev: ## Start backend in watch mode
cd $(BACKEND_DIR) && npm run start:dev
dev:frontend: ## Start frontend dev server
cd $(FRONTEND_DIR) && npm run dev
dev:all: ## Start all services via Docker Compose
docker compose up -d
## ── Build ───────────────────────────────────────────────────────────────────
build: ## Build the backend
cd $(BACKEND_DIR) && npm run build
build:frontend: ## Build the frontend
cd $(FRONTEND_DIR) && npm run build
## ── Code quality ────────────────────────────────────────────────────────────
lint: ## Lint and auto-fix backend source
cd $(BACKEND_DIR) && npm run lint
format: ## Format backend source with Prettier
cd $(BACKEND_DIR) && npm run format
## ── Tests ───────────────────────────────────────────────────────────────────
test: ## Run backend unit tests
cd $(BACKEND_DIR) && npm run test
test:cov: ## Run backend unit tests with coverage report
cd $(BACKEND_DIR) && npm run test:cov
test:e2e: ## Run backend end-to-end tests
cd $(BACKEND_DIR) && npm run test:e2e
test:watch: ## Run backend unit tests in watch mode
cd $(BACKEND_DIR) && npm run test:watch
## ── Database ────────────────────────────────────────────────────────────────
db:migrate: ## Run pending TypeORM migrations
cd $(BACKEND_DIR) && npm run migration:run
db:migrate:revert: ## Revert the last TypeORM migration
cd $(BACKEND_DIR) && npm run migration:revert
db:seed: ## Seed the database with initial data
cd $(BACKEND_DIR) && npm run seed
db:seed:clear: ## Clear all seeded data from the database
cd $(BACKEND_DIR) && npm run seed:clear
db:seed:reset: ## Clear and re-seed the database
cd $(BACKEND_DIR) && npm run seed:reset
## ── Docker ──────────────────────────────────────────────────────────────────
docker:up: ## Start all Docker Compose services in the background
docker compose up -d
docker:down: ## Stop and remove all Docker Compose services
docker compose down
docker:logs: ## Tail logs for all running Docker Compose services
docker compose logs -f