.PHONY: all help build build-backend build-frontend run dev test lint format clean docker-build package doctor demo install
BINARY=target/debug/apicentric
RELEASE_BINARY=target/release/apicentric
SERVICES_DIR=examples
DB_PATH=data/apicentric.db
all: build
help:
@printf ' \n'
@printf ' \033[1;36m___ ______ _____ _____ _____ _ _ _____ ______ _____ _____ \033[0m\n'
@printf ' \033[1;36m/ _ \\ | ___ \\_ _/ __ \\ ___| \\ | |_ _|| ___ \\_ _/ __ \\\\ \033[0m\n'
@printf ' \033[1;36m/ /_\\ \\| |_/ / | | | / \\/ |__ | \\| | | | | |_/ / | | | / \\/\033[0m\n'
@printf ' \033[1;36m| _ || __/ | | | | | __|| . ` | | | | / | | | | \033[0m\n'
@printf ' \033[1;36m| | | || | _| |_| \\__/\\ |___| |\\ | | | | |\\ \\ _| |_| \\__/\033[0m\n'
@printf ' \033[1;36m\\_| |_/\\_| \\___/ \\____\\____/\\_| \\_/ \\_/ \\_| \\_|\\___/ \\____/\033[0m\n'
@printf ' \n'
@printf ' \033[1;33mโก Core Commands:\033[0m\n'
@printf ' \033[1;32mmake build\033[0m - ๐๏ธ Build complete project (Backend & Frontend)\n'
@printf ' \033[1;32mmake run\033[0m - ๐ Start simulator with examples\n'
@printf ' \033[1;32mmake dev\033[0m - ๐ Hot-reload development environment\n'
@printf ' \033[1;32mmake wizard\033[0m - ๐ง Interactive project management wizard\n'
@printf ' \n'
@printf ' \033[1;33m๐ฎ Interfaces:\033[0m\n'
@printf ' \033[1;32mmake tui\033[0m - ๐ฅ๏ธ Launch Terminal User Interface\n'
@printf ' \033[1;32mmake gui\033[0m - ๐จ Launch Desktop GUI Administration\n'
@printf ' \n'
@printf ' \033[1;33m๐ฌ Simulation & Testing:\033[0m\n'
@printf ' \033[1;32mmake twin\033[0m - ๐ค Run IoT Digital Twin simulator\n'
@printf ' \033[1;32mmake contract\033[0m - ๐ Execute contract-driven API tests\n'
@printf ' \033[1;32mmake cloud\033[0m - โ๏ธ Start server in cloud-ready mode\n'
@printf ' \n'
@printf ' \033[1;33m๐ ๏ธ Development & QA:\033[0m\n'
@printf ' \033[1;32mmake test\033[0m - ๐งช Run full test suite\n'
@printf ' \033[1;32mmake lint\033[0m - ๐งน Static analysis & linting\n'
@printf ' \033[1;32mmake format\033[0m - ๐จ Auto-format all source code\n'
@printf ' \033[1;32mmake doctor\033[0m - ๐ฉบ Run project diagnostics\n'
@printf ' \n'
@printf ' \033[1;33m๐ฆ Distribution:\033[0m\n'
@printf ' \033[1;32mmake package\033[0m - ๐ฆ Create production tarball\n'
@printf ' \033[1;32mmake docker-build\033[0m - ๐ณ Build release Docker image\n'
@printf ' \033[1;32mmake demo\033[0m - ๐ฌ Run visual demonstration\n'
@printf ' \n'
@printf ' \033[1;33m๐งน Utility:\033[0m\n'
@printf ' \033[1;32mmake clean\033[0m - ๐๏ธ Deep clean build artifacts\n'
@printf ' \033[1;32mmake install\033[0m - ๐ฅ Bootstrap dependencies\n'
@printf ' \n'
install:
@echo "๐ฆ Installing dependencies..."
cargo fetch
cd webui && npm install
build: build-backend build-frontend
build-backend:
@echo "๐ฆ Building backend (debug)..."
cargo build --features full
build-frontend:
@echo "๐ฆ Building frontend..."
cd webui && npm run build
run: build-backend
@echo "๐ Starting simulator..."
mkdir -p data
$(BINARY) --db-path $(DB_PATH) simulator start --services-dir $(SERVICES_DIR)
dev:
@echo "๐ Starting development environment..."
(cargo watch -x run & cd webui && npm run dev)
test:
@echo "๐งช Running tests..."
cargo test
@[ -f scripts/test_mcp.sh ] && ./scripts/test_mcp.sh || echo "No MCP tests found"
lint:
@echo "๐งน Linting..."
cargo clippy -- -D warnings
cd webui && npm run lint
format:
@echo "๐จ Formatting..."
cargo fmt
cd webui && npm run format
clean:
@echo "๐งน Cleaning up..."
cargo clean
rm -rf webui/.next
rm -rf logs/*
rm -rf demo_output
doctor: build-backend
@$(BINARY) doctor
demo: build-backend
@echo "๐ฌ Running demo..."
./scripts/demo_all.sh
package:
@echo "๐ฆ Packaging for production..."
./scripts/build-production.sh
tui: build-backend
@echo "๐ฅ๏ธ Launching TUI..."
$(BINARY) tui
gui: build-backend
@echo "๐จ Launching GUI..."
$(BINARY) gui
twin: build-backend
@echo "๐ค Starting IoT Digital Twin..."
$(BINARY) twin run --device examples/iot/smarthome/thermostat-nest.yaml
contract: build-backend
@echo "๐ Running contract tests..."
$(BINARY) simulator test --path examples/iot/smarthome/thermostat-nest.yaml --url http://localhost:9005
cloud: build-backend
@echo "โ๏ธ Starting cloud mode..."
$(BINARY) cloud --port 8080
wizard:
@chmod +x scripts/wizard.sh
@./scripts/wizard.sh
docker-build:
@echo "๐ณ Building Docker images..."
docker build -t apicentric:latest .