-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (58 loc) · 1.68 KB
/
Makefile
File metadata and controls
70 lines (58 loc) · 1.68 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
.PHONY: help install build run-api run-worker test lint fmt clean migrate docker-up docker-down
# Default target
help:
@echo "Typecraft - Makefile Commands"
@echo ""
@echo " make install - Install Go dependencies"
@echo " make build - Build binaries"
@echo " make run-api - Run API server"
@echo " make run-worker - Run async worker"
@echo " make test - Run tests"
@echo " make lint - Run linter"
@echo " make fmt - Format code"
@echo " make migrate - Run database migrations"
@echo " make docker-up - Start Docker services"
@echo " make docker-down - Stop Docker services"
@echo " make clean - Clean build artifacts"
install:
@echo "📦 Installing dependencies..."
go mod download
go mod tidy
build:
@echo "🔨 Building binaries..."
go build -o bin/api ./cmd/api
go build -o bin/worker ./cmd/worker
run-api:
@echo "🚀 Starting API server..."
go run ./cmd/api/main.go
run-worker:
@echo "⚙️ Starting worker..."
go run ./cmd/worker/main.go
test:
@echo "🧪 Running tests..."
go test -v -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
lint:
@echo "🔍 Running linter..."
golangci-lint run ./...
fmt:
@echo "✨ Formatting code..."
gofmt -s -w .
goimports -w .
migrate:
@echo "🗄️ Running migrations..."
# TODO: Implement migrations
@echo "Migrations not yet implemented"
docker-up:
@echo "🐳 Starting Docker services..."
docker compose up -d
@echo "✅ Services running: PostgreSQL, Redis, MinIO"
docker-down:
@echo "🛑 Stopping Docker services..."
docker compose down
clean:
@echo "🧹 Cleaning build artifacts..."
rm -rf bin/
rm -rf dist/
rm -f coverage.out coverage.html
go clean