-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
105 lines (85 loc) · 3.31 KB
/
Copy pathMakefile
File metadata and controls
105 lines (85 loc) · 3.31 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
104
105
.PHONY: build-all build-service build-tray build-web run-web dev run-api run-frontend clean test package monitor-up monitor-down
# Docker detection (with macOS support)
DOCKER := $(shell command -v docker 2>/dev/null || echo "/Applications/Docker.app/Contents/Resources/bin/docker")
DOCKER_COMPOSE := $(shell command -v docker-compose 2>/dev/null || echo "$(DOCKER) compose")
# -----------------------------------------------------------------------------
# 🏗️ Build Targets
# -----------------------------------------------------------------------------
# Build all components
build-all: build-service build-tray build-web
@echo "🎉 All components built successfully!"
# Build the core background service
build-service:
@echo "🔨 Building AtlanticProxy Service..."
cd scripts/proxy-client && go build -o ../../bin/atlantic-service ./cmd/service
@echo "✅ Service build completed"
# Build the system tray application
build-tray:
@echo "🔨 Building AtlanticProxy Tray..."
go build -o bin/atlantic-tray ./cmd/tray
@echo "✅ Tray build completed"
# Build the Next.js web dashboard
build-web:
@echo "🔨 Building Web Dashboard..."
cd atlantic-dashboard && npm run build
@echo "✅ Web dashboard build completed"
# -----------------------------------------------------------------------------
# 🚀 Run Targets
# -----------------------------------------------------------------------------
# Run the web dashboard in development mode
run-web:
@echo "🌐 Starting Web Dashboard..."
cd atlantic-dashboard && npm run dev
# Start everything unified
dev:
@chmod +x start-dev.sh
./start-dev.sh
# Run only the API (standalone for testing)
run-api:
@echo "📡 Starting API Server..."
cd scripts/proxy-client && go run cmd/api-only/main.go
# Run only the frontend
run-frontend: run-web
# -----------------------------------------------------------------------------
# 📦 Distribution Targets
# -----------------------------------------------------------------------------
# Production build and packaging
package:
ifeq ($(shell uname), Darwin)
@echo "🎁 Packaging for macOS..."
chmod +x scripts/package_macos.sh
./scripts/package_macos.sh
else
@echo "🎁 Packaging for production..."
chmod +x scripts/build_installers.sh
./scripts/build_installers.sh
endif
# 📊 Monitoring Targets
monitor-up:
@echo "📈 Starting Prometheus & Grafana..."
$(DOCKER_COMPOSE) -f docker/docker-compose.monitoring.yml up -d
@echo "✅ Monitoring started! Grafana: http://localhost:3001 (admin/admin)"
monitor-down:
@echo "📉 Stopping monitoring..."
$(DOCKER_COMPOSE) -f docker/docker-compose.monitoring.yml down
# -----------------------------------------------------------------------------
# 🧹 Cleanup & Test
# -----------------------------------------------------------------------------
clean:
@echo "🧹 Cleaning build artifacts..."
rm -rf bin/
rm -rf dist/
@echo "✅ Clean completed"
test:
@echo "🧪 Running tests..."
go test ./...
@echo "✅ All tests passed"
# -----------------------------------------------------------------------------
# 🛠️ Helper Targets
# -----------------------------------------------------------------------------
deps:
@echo "📦 Installing Go dependencies..."
go mod tidy
@echo "📦 Installing Web dependencies..."
cd atlantic-dashboard && npm install
@echo "✅ All dependencies installed"