# RentCache Makefile .PHONY: help dev prod build up down logs shell test clean # Default target help: ## Show this help message @echo "RentCache - Intelligent Rentcast API caching proxy" @echo "" @echo "Available targets:" @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) # Development dev: ## Start development environment with hot reload @echo "๐Ÿš€ Starting RentCache in development mode..." @docker compose --profile redis up --build -d @echo "โœ… RentCache available at: https://rentcache.l.supported.systems" @echo "๐Ÿ“š API docs: https://rentcache.l.supported.systems/docs" @echo "โค๏ธ Health: https://rentcache.l.supported.systems/health" prod: ## Start production environment @echo "๐Ÿญ Starting RentCache in production mode..." @MODE=production DEBUG=false docker compose up --build -d @echo "โœ… RentCache running in production mode" # Docker management build: ## Build Docker images @docker compose build up: ## Start services @docker compose up -d down: ## Stop services @docker compose down logs: ## View logs @docker compose logs -f rentcache shell: ## Open shell in running container @docker compose exec rentcache /bin/bash # Testing and development test: ## Run tests @echo "๐Ÿงช Running tests..." @uv run pytest tests/ -v test-cov: ## Run tests with coverage @echo "๐Ÿงช Running tests with coverage..." @uv run pytest tests/ --cov=src/rentcache --cov-report=html lint: ## Run linting @echo "๐Ÿ” Running linting..." @uv run ruff check src/ tests/ @uv run mypy src/ format: ## Format code @echo "โœจ Formatting code..." @uv run black src/ tests/ @uv run ruff --fix src/ tests/ # Database and cache db-shell: ## Open database shell @echo "๐Ÿ—„๏ธ Opening database shell..." @docker compose exec rentcache uv run python -c "from rentcache.database import engine; import sqlite3; sqlite3.connect('data/rentcache.db').execute('.tables')" cache-clear: ## Clear all cache @echo "๐Ÿงน Clearing cache..." @docker compose exec rentcache uv run rentcache clear-cache --all health: ## Check system health @echo "โค๏ธ Checking health..." @docker compose exec rentcache uv run rentcache health stats: ## Show usage statistics @echo "๐Ÿ“Š Usage statistics..." @docker compose exec rentcache uv run rentcache stats # Cleanup clean: ## Clean up containers, volumes, and images @echo "๐Ÿงน Cleaning up..." @docker compose down -v --remove-orphans @docker system prune -f clean-all: clean ## Clean everything including images @docker compose down -v --rmi all --remove-orphans @docker system prune -af # API key management create-key: ## Create API key (usage: make create-key NAME=myapp KEY=your_key) @docker compose exec rentcache uv run rentcache create-key $(NAME) $(KEY) --daily-limit 1000 list-keys: ## List all API keys @docker compose exec rentcache uv run rentcache list-keys # Install local development install: ## Install for local development @echo "๐Ÿ“ฆ Installing dependencies..." @uv sync @echo "โœ… Ready for development" local-dev: install ## Run locally for development @echo "๐Ÿ–ฅ๏ธ Starting local development server..." @uv run rentcache server --reload # URL helpers url: ## Show the service URL @echo "๐ŸŒ RentCache URL: https://rentcache.l.supported.systems" docs: ## Open API documentation @echo "๐Ÿ“š API Documentation: https://rentcache.l.supported.systems/docs" # Quick setup setup: ## Complete setup (build, create network if needed, start) @echo "๐Ÿš€ Setting up RentCache..." @docker network create caddy 2>/dev/null || true @make build @make dev @echo "" @echo "๐ŸŽ‰ RentCache is ready!" @make url