update makefile

This commit is contained in:
Do Le Long An 2026-01-24 14:29:42 +07:00 committed by GitHub
parent 12a5366ab3
commit 34822aaa83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,15 +1,42 @@
# ==============================================================================
# Development Commands
# ==============================================================================
.PHONY: dev
dev: server client ## Run both backend and frontend development servers
.PHONY: server
server:
@uv run python server_main.py --port 6400 --reload
server: ## Start the backend server in the background
@echo "Starting server in background..."
@uv run python server_main.py --port 6400 --reload &
.PHONY: client
client:
client: ## Start the frontend development server
@cd frontend && VITE_API_BASE_URL=http://localhost:6400 npm run dev
.PHONY: stop
stop: ## Stop backend and frontend servers
@echo "Stopping backend server (port 6400)..."
@lsof -t -i:6400 | xargs kill -9 2>/dev/null || echo "Backend server not found on port 6400."
@echo "Stopping frontend server (port 5173)..."
@lsof -t -i:5173 | xargs kill -9 2>/dev/null || echo "Frontend server not found on port 5173."
# ==============================================================================
# Tools & Maintenance
# ==============================================================================
.PHONY: sync
sync:
sync: ## Sync Vue graphs to the server database
@uv run python tools/sync_vuegraphs.py
.PHONY: validate-yamls
validate-yamls:
validate-yamls: ## Validate all YAML configuration files
@uv run python tools/validate_all_yamls.py
# ==============================================================================
# Help
# ==============================================================================
.PHONY: help
help: ## Display this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'