Features: - Multi-platform agents (Linux, macOS, Windows - AMD64 & ARM64) - Real-time CPU, RAM, and disk usage monitoring - Responsive web dashboard with live status indicators - Session-based authentication with secure credentials - Stale agent detection and removal (6+ months inactive) - Auto-refresh dashboard (5 second intervals) - 15-second agent reporting intervals - Auto-generated agent IDs from hostnames - In-memory storage (zero database setup) - Minimal dependencies (Chi router + Templ templating) Project Structure: - cmd/: Agent and Server executables - internal/: API, Auth, Stats, Storage, and UI packages - views/: Templ templates for dashboard UI - Makefile: Build automation for all platforms Ready for deployment with comprehensive documentation: - README.md: Full project documentation - QUICKSTART.md: Getting started guide - AGENTS.md: Development guidelines
56 lines
2.1 KiB
Makefile
56 lines
2.1 KiB
Makefile
.PHONY: build build-server build-agent build-all clean templ help
|
|
|
|
# Default target
|
|
help:
|
|
@echo "Nerd Monitor - Build Commands"
|
|
@echo ""
|
|
@echo " make build - Build server and agent for current OS"
|
|
@echo " make build-server - Build server executable"
|
|
@echo " make build-agent - Build agent executable"
|
|
@echo " make build-all - Build for all platforms (Linux, macOS, Windows)"
|
|
@echo " make templ - Generate code from Templ templates"
|
|
@echo " make clean - Remove build artifacts"
|
|
@echo ""
|
|
|
|
build: templ build-server build-agent
|
|
|
|
templ:
|
|
@echo "Generating Templ templates..."
|
|
@go run github.com/a-h/templ/cmd/templ@latest generate
|
|
|
|
build-server: templ
|
|
@echo "Building server for $(GOOS)/$(GOARCH)..."
|
|
@mkdir -p bin
|
|
go build -o bin/nerd-monitor-server ./cmd/server
|
|
|
|
build-agent:
|
|
@echo "Building agent for $(GOOS)/$(GOARCH)..."
|
|
@mkdir -p bin
|
|
go build -o bin/nerd-monitor-agent ./cmd/agent
|
|
|
|
build-all: templ
|
|
@echo "Building for all platforms..."
|
|
@mkdir -p bin
|
|
@echo " Linux AMD64..."
|
|
@GOOS=linux GOARCH=amd64 go build -o bin/nerd-monitor-server-linux-amd64 ./cmd/server
|
|
@GOOS=linux GOARCH=amd64 go build -o bin/nerd-monitor-agent-linux-amd64 ./cmd/agent
|
|
@echo " Linux ARM64..."
|
|
@GOOS=linux GOARCH=arm64 go build -o bin/nerd-monitor-server-linux-arm64 ./cmd/server
|
|
@GOOS=linux GOARCH=arm64 go build -o bin/nerd-monitor-agent-linux-arm64 ./cmd/agent
|
|
@echo " macOS AMD64..."
|
|
@GOOS=darwin GOARCH=amd64 go build -o bin/nerd-monitor-server-darwin-amd64 ./cmd/server
|
|
@GOOS=darwin GOARCH=amd64 go build -o bin/nerd-monitor-agent-darwin-amd64 ./cmd/agent
|
|
@echo " macOS ARM64..."
|
|
@GOOS=darwin GOARCH=arm64 go build -o bin/nerd-monitor-server-darwin-arm64 ./cmd/server
|
|
@GOOS=darwin GOARCH=arm64 go build -o bin/nerd-monitor-agent-darwin-arm64 ./cmd/agent
|
|
@echo " Windows AMD64..."
|
|
@GOOS=windows GOARCH=amd64 go build -o bin/nerd-monitor-server-windows-amd64.exe ./cmd/server
|
|
@GOOS=windows GOARCH=amd64 go build -o bin/nerd-monitor-agent-windows-amd64.exe ./cmd/agent
|
|
@echo "Build complete!"
|
|
@ls -lh bin/
|
|
|
|
clean:
|
|
@echo "Cleaning build artifacts..."
|
|
@rm -rf bin/
|
|
@echo "Clean complete!"
|