-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (40 loc) · 2.15 KB
/
Makefile
File metadata and controls
59 lines (40 loc) · 2.15 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
.PHONY: dev dev-backend dev-frontend build build-backend build-frontend docker-build docker-up docker-down test lint clean install-deps
# ── Development ────────────────────────────────────────────────────────────────
dev:
@echo "Start dev-backend and dev-frontend in separate terminals."
@echo " make dev-backend"
@echo " make dev-frontend"
dev-backend:
@which air > /dev/null || go install github.com/air-verse/air@latest
air -c .air.toml
dev-frontend:
cd web && npm run dev
# ── Local binary builds ────────────────────────────────────────────────────────
build: build-backend build-frontend
build-backend:
go build -ldflags="-s -w" -o bin/server ./cmd/server
build-frontend:
cd web && npm install && npm run build
# ── Docker ─────────────────────────────────────────────────────────────────────
docker-build:
docker compose build
# Start without Redis (embedded bolt store)
docker-up:
docker compose up --build
# Start with external Redis store (set STORE_URL=redis://redis:6379 in .env)
docker-up-redis:
docker compose --profile redis up --build
docker-down:
docker compose down
# ── Test & Lint ────────────────────────────────────────────────────────────────
test:
go test ./...
lint:
@which golangci-lint > /dev/null || (echo "Install golangci-lint: https://golangci-lint.run/usage/install/" && exit 1)
golangci-lint run ./...
cd web && npm run check
# ── Utilities ──────────────────────────────────────────────────────────────────
clean:
rm -rf bin/ web/dist/
install-deps:
cd web && npm install