#!/bin/bash set -e echo "=========================================" echo "Test Artifact Data Lake - Development Setup" echo "=========================================" echo "" # Check if Node.js is installed if ! command -v node &> /dev/null; then echo "Error: Node.js is not installed. Please install Node.js 18+ first." exit 1 fi # Check Node.js version NODE_VERSION=$(node --version | cut -d'v' -f2 | cut -d'.' -f1) if [ "$NODE_VERSION" -lt "18" ]; then echo "Error: Node.js version 18 or higher is required. Current version: $(node --version)" exit 1 fi # Check if npm is installed if ! command -v npm &> /dev/null; then echo "Error: npm is not installed. Please install npm first." exit 1 fi # Check if Docker is installed for backend services if ! command -v docker &> /dev/null; then echo "Error: Docker is not installed. Please install Docker first." exit 1 fi # Check if Docker Compose is installed if ! command -v docker-compose &> /dev/null; then echo "Error: Docker Compose is not installed. Please install Docker Compose first." exit 1 fi echo "✓ Node.js version: $(node --version)" echo "✓ npm version: $(npm --version)" echo "✓ Docker version: $(docker --version)" echo "" # Create .env file if it doesn't exist if [ ! -f .env ]; then echo "Creating .env file from .env.example..." cp .env.example .env echo "✓ .env file created" else echo "✓ .env file already exists" fi echo "" echo "Starting backend services (PostgreSQL, MinIO, API)..." docker-compose up -d postgres minio api echo "" echo "Waiting for backend services to be ready..." sleep 10 echo "" echo "Installing frontend dependencies..." cd frontend npm install echo "" echo "=========================================" echo "Development Environment Ready!" echo "=========================================" echo "" echo "Backend API: http://localhost:8000" echo "API Docs: http://localhost:8000/docs" echo "MinIO Console: http://localhost:9001" echo " Username: minioadmin" echo " Password: minioadmin" echo "" echo "To start the frontend development server:" echo " cd frontend" echo " npm run start" echo "" echo "Frontend will be available at: http://localhost:4200" echo "" echo "To view backend logs: docker-compose logs -f api" echo "To stop backend: docker-compose down" echo "" echo "Starting frontend development server..." npm run start