#!/bin/bash # Setup script for uv-based development environment set -e echo "🚀 Setting up Northern Thailand Ping River Monitor with uv..." # Check if uv is installed if ! command -v uv &> /dev/null; then echo "❌ uv is not installed. Please install it first:" echo " curl -LsSf https://astral.sh/uv/install.sh | sh" exit 1 fi echo "✅ uv found: $(uv --version)" # Initialize uv project if not already initialized if [ ! -f "uv.lock" ]; then echo "🔧 Initializing uv project..." uv sync else echo "📦 Syncing dependencies with uv..." uv sync fi # Install pre-commit hooks echo "🎣 Installing pre-commit hooks..." uv run pre-commit install # Create .env file if it doesn't exist if [ ! -f ".env" ] && [ -f ".env.example" ]; then echo "📝 Creating .env file from template..." cp .env.example .env echo "⚠️ Please edit .env file with your configuration" fi echo "✅ Setup complete!" echo "" echo "📚 Quick start commands:" echo " make install-dev # Install all dependencies" echo " make run-test # Run a test cycle" echo " make run-api # Start the web API" echo " make test # Run tests" echo " make lint # Check code quality" echo "" echo "🎉 Happy monitoring!"