eth-id 0.1.0

Zero-Knowledge Document Verification CLI and Library
Documentation
.PHONY: help build test clean install run demo fmt lint audit release

help:
	@echo "ETH.id - Zero-Knowledge Document Verification"
	@echo "=============================================="
	@echo ""
	@echo "Available targets:"
	@echo "  make build      - Build debug binary"
	@echo "  make release    - Build optimized release binary"
	@echo "  make test       - Run all tests"
	@echo "  make test-unit  - Run unit tests only"
	@echo "  make test-int   - Run integration tests only"
	@echo "  make test-adv   - Run adversarial tests only"
	@echo "  make clean      - Clean build artifacts"
	@echo "  make install    - Install binary globally"
	@echo "  make run        - Run with example document"
	@echo "  make demo       - Run interactive demo"
	@echo "  make fmt        - Format code"
	@echo "  make lint       - Run clippy linter"
	@echo "  make audit      - Security audit"
	@echo "  make docs       - Generate documentation"
	@echo "  make check      - Run all checks (fmt, lint, test)"

build:
	@echo "πŸ”¨ Building debug binary..."
	cargo build

release:
	@echo "πŸš€ Building release binary..."
	cargo build --release
	@echo "βœ… Binary: target/release/eth"
	@ls -lh target/release/eth

test:
	@echo "πŸ§ͺ Running all tests..."
	cargo test

test-unit:
	@echo "πŸ§ͺ Running unit tests..."
	cargo test --lib

test-int:
	@echo "πŸ§ͺ Running integration tests..."
	cargo test --test integration_e2e

test-adv:
	@echo "πŸ§ͺ Running adversarial tests..."
	cargo test --test adversarial_tests

test-claims:
	@echo "πŸ§ͺ Running claims tests..."
	cargo test --test claims_tests

test-privacy:
	@echo "πŸ§ͺ Running privacy tests..."
	cargo test --test privacy_tests

clean:
	@echo "🧹 Cleaning build artifacts..."
	cargo clean
	@rm -rf target/
	@echo "βœ… Clean complete"

install: release
	@echo "πŸ“¦ Installing binary..."
	@./scripts/install.sh

run:
	@echo "πŸƒ Running with example document..."
	cargo run -- verify \
		--doc examples/sample_documents/brazilian_id.txt \
		--claim "maior de 18 anos" \
		--output text

demo:
	@echo "🎬 Running interactive demo..."
	@./examples/demo.sh

fmt:
	@echo "🎨 Formatting code..."
	cargo fmt --all

lint:
	@echo "πŸ” Running clippy..."
	cargo clippy -- -D warnings

audit:
	@echo "πŸ”’ Running security audit..."
	cargo audit || echo "Install cargo-audit: cargo install cargo-audit"

docs:
	@echo "πŸ“š Generating documentation..."
	cargo doc --no-deps --open

check: fmt lint test
	@echo "βœ… All checks passed!"

bench:
	@echo "⚑ Running benchmarks..."
	cargo bench

watch:
	@echo "πŸ‘€ Watching for changes..."
	cargo watch -x build -x test

coverage:
	@echo "πŸ“Š Generating coverage report..."
	cargo tarpaulin --out Html --output-dir coverage || echo "Install tarpaulin: cargo install cargo-tarpaulin"

# Development helpers
dev-setup:
	@echo "πŸ› οΈ  Setting up development environment..."
	rustup component add rustfmt clippy
	cargo install cargo-watch cargo-audit cargo-tarpaulin || true
	@echo "βœ… Development environment ready"

# Example commands
example-age:
	cargo run -- verify --doc examples/sample_documents/brazilian_id.txt --claim "maior de 18 anos"

example-cpf:
	cargo run -- verify --doc examples/sample_documents/brazilian_id.txt --claim "CPF bate com 123.456.789-09"

example-income:
	cargo run -- verify --doc examples/sample_documents/income_proof.txt --claim "renda acima de 5000"

example-passport:
	cargo run -- verify --doc examples/sample_documents/passport.txt --claim "passaporte estΓ‘ expirado"

example-debug:
	cargo run -- verify --doc examples/sample_documents/brazilian_id.txt --claim "maior de 18 anos" --debug

# Audit commands
audit-list:
	cargo run -- audit --list

audit-config:
	cargo run -- config --show

# ZK commands
zk-info:
	cargo run -- zk

# Build for all platforms (requires cross)
build-all:
	@echo "🌍 Building for all platforms..."
	cargo build --release --target x86_64-unknown-linux-gnu
	cargo build --release --target x86_64-apple-darwin
	cargo build --release --target x86_64-pc-windows-gnu

# Docker
docker-build:
	@echo "🐳 Building Docker image..."
	docker build -t eth-id:latest .

docker-run:
	@echo "🐳 Running in Docker..."
	docker run -it --rm eth-id:latest

# Quick commands
q: build test
	@echo "βœ… Quick build and test complete"

qq: build
	@echo "βœ… Quick build complete"