-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (70 loc) · 1.92 KB
/
Makefile
File metadata and controls
89 lines (70 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
.PHONY: build run test clean deps build-api run-api frontend-install frontend-dev frontend-build
# Build the application
build:
@echo "Building crypto-alert..."
@go build -o bin/crypto-alert cmd/main.go
@echo "Build complete: bin/crypto-alert"
# Build the API server
build-api:
@echo "Building log API server..."
@go build -o bin/log-api cmd/api/main.go
@echo "Build complete: bin/log-api"
# Run the application
run:
@echo "Running crypto-alert..."
@go run cmd/main.go
# Run the API server
run-api:
@echo "Running log API server..."
@go run cmd/api/main.go
# Frontend commands
frontend-install:
@echo "Installing frontend dependencies..."
@cd frontend && npm install
frontend-dev:
@echo "Starting frontend development server..."
@cd frontend && npm run dev
frontend-build:
@echo "Building frontend for production..."
@cd frontend && npm run build
# Docker commands
docker-build:
@echo "Building frontend Docker image..."
@docker-compose build
docker-up:
@echo "Starting frontend Docker container..."
@docker-compose up -d
docker-down:
@echo "Stopping frontend Docker container..."
@docker-compose down
docker-logs:
@echo "Showing frontend Docker logs..."
@docker-compose logs -f frontend
docker-dev:
@echo "Starting frontend Docker container (development mode)..."
@docker-compose -f docker-compose.dev.yml up
docker-dev-down:
@echo "Stopping frontend Docker container (development mode)..."
@docker-compose -f docker-compose.dev.yml down
# Run tests
test:
@echo "Running tests..."
@go test -v ./...
# Clean build artifacts
clean:
@echo "Cleaning..."
@rm -rf bin/
@go clean
# Download dependencies
deps:
@echo "Downloading dependencies..."
@go mod download
@go mod tidy
# Format code
fmt:
@echo "Formatting code..."
@go fmt ./...
# Lint code
lint:
@echo "Linting code..."
@golangci-lint run || echo "Install golangci-lint for linting: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest"