Files
warehouse13/quickstart.sh
pratik fbb1dfa67b Integrate dark theme styling from main branch with Angular Material
- Apply dark blue color scheme (#0f172a, #1e293b, #334155) throughout UI
- Update header with blue gradient and Obsidian branding
- Add missing toolbar buttons: Auto-refresh, Seed Data, Search filter
- Implement action buttons (Download, Delete) in artifacts table
- Add client-side search/filtering functionality
- Update app to support sim_source_id field in database
- Move quickstart scripts to repository root for easier access
- Apply dark theme to tables, tabs, and all Material components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 11:42:34 -05:00

190 lines
5.6 KiB
Bash

#!/bin/bash
set -e
echo "========================================="
echo "Test Artifact Data Lake - Quick Start"
echo "========================================="
echo ""
# Check if Docker is installed
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
COMPOSE_CMD=""
if command -v docker-compose &> /dev/null; then
COMPOSE_CMD="docker-compose"
elif docker compose version &> /dev/null; then
COMPOSE_CMD="docker compose"
else
echo "Error: Docker Compose is not installed. Please install Docker Compose first."
exit 1
fi
# Parse command line arguments
REBUILD=false
FULL_STACK=false
DEV_MODE=false
while [[ $# -gt 0 ]]; do
case $1 in
--rebuild)
REBUILD=true
shift
;;
--full-stack)
FULL_STACK=true
shift
;;
--dev)
DEV_MODE=true
shift
;;
--help)
echo "Usage: $0 [OPTIONS]"
echo ""
echo "Options:"
echo " --rebuild Force rebuild of all containers"
echo " --full-stack Start complete stack including frontend (production build)"
echo " --dev Start backend only, use separate dev server for frontend"
echo " --help Show this help message"
echo ""
echo "Default: Starts backend services only (recommended for development)"
echo ""
exit 0
;;
*)
echo "Unknown option: $1"
echo "Use --help for usage information"
exit 1
;;
esac
done
# 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 ""
# Stop existing containers if rebuild is requested
if [ "$REBUILD" = true ]; then
echo "🔄 Rebuilding containers..."
echo "Stopping existing containers..."
$COMPOSE_CMD down
if [ "$FULL_STACK" = true ]; then
echo "Removing existing images for full rebuild..."
$COMPOSE_CMD -f docker-compose.production.yml down --rmi local 2>/dev/null || true
echo "Building and starting full stack..."
$COMPOSE_CMD -f docker-compose.production.yml up -d --build
else
echo "Removing existing backend images for rebuild..."
$COMPOSE_CMD down --rmi local 2>/dev/null || true
echo "Building and starting backend services..."
$COMPOSE_CMD up -d --build
fi
else
# Regular startup
if [ "$FULL_STACK" = true ]; then
echo "Starting full production stack (backend + frontend)..."
$COMPOSE_CMD -f docker-compose.production.yml up -d
else
echo "Starting backend services..."
$COMPOSE_CMD up -d
fi
fi
echo ""
echo "Waiting for services to be ready..."
sleep 15
echo ""
echo "========================================="
if [ "$FULL_STACK" = true ]; then
echo "Complete Stack is running! 🚀"
else
echo "Backend Services are running!"
fi
echo "========================================="
echo ""
echo "API: http://localhost:8000"
echo "API Docs: http://localhost:8000/docs"
echo "MinIO Console: http://localhost:9001"
echo " Username: minioadmin"
echo " Password: minioadmin"
echo ""
if [ "$FULL_STACK" = true ]; then
echo "Frontend: http://localhost:80"
echo " (Production build with Nginx)"
echo ""
echo "To view logs: $COMPOSE_CMD -f docker-compose.production.yml logs -f"
echo "To stop: $COMPOSE_CMD -f docker-compose.production.yml down"
else
echo "To view logs: $COMPOSE_CMD logs -f"
echo "To stop: $COMPOSE_CMD down"
echo ""
echo "========================================="
echo "Frontend Options:"
echo "========================================="
echo ""
echo "Development (with hot reload):"
echo " ./dev-start.sh"
echo " Frontend will be available at: http://localhost:4200"
echo ""
echo "Or start full production stack:"
echo " ./quickstart.sh --full-stack"
echo " Complete stack at: http://localhost:80"
fi
echo ""
echo "========================================="
echo "Rebuild Options:"
echo "========================================="
echo ""
echo "Force rebuild backend: ./quickstart.sh --rebuild"
echo "Force rebuild full stack: ./quickstart.sh --rebuild --full-stack"
echo ""
echo "========================================="
echo "Testing the API..."
echo "========================================="
echo ""
# Wait a bit more for API to be fully ready
sleep 5
# Test health endpoint
if curl -s http://localhost:8000/health | grep -q "healthy"; then
echo "✓ API is healthy!"
echo ""
if [ "$FULL_STACK" = false ]; then
echo "🎯 Ready for development!"
echo "Run './dev-start.sh' to start the frontend with hot reload"
echo ""
fi
echo "Example: Upload a test file"
echo "----------------------------"
echo 'echo "test,data" > test.csv'
echo 'curl -X POST "http://localhost:8000/api/v1/artifacts/upload" \'
echo ' -F "file=@test.csv" \'
echo ' -F "test_name=sample_test" \'
echo ' -F "test_suite=demo" \'
echo ' -F "test_result=pass"'
echo ""
else
echo "⚠ API is not responding yet. Please wait a moment and check http://localhost:8000/health"
fi
echo "========================================="
echo "Setup complete! 🚀"
echo "========================================="