rekordbox-viewer/start-s3-demo.sh
2025-08-06 13:45:30 +02:00

91 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
echo "🎵 Starting S3 Music Storage Demo"
echo "=================================="
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Function to print colored output
print_status() {
echo -e "${BLUE}[INFO]${NC} $1"
}
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
print_error "Docker is not running. Please start Docker and try again."
exit 1
fi
print_status "Starting MinIO and MongoDB services..."
docker-compose -f docker-compose.dev.yml up -d
# Wait for services to be ready
print_status "Waiting for services to be ready..."
sleep 10
# Check if MinIO is running
if docker ps | grep -q minio; then
print_success "MinIO is running"
else
print_error "MinIO failed to start"
exit 1
fi
# Check if MongoDB is running
if docker ps | grep -q mongo; then
print_success "MongoDB is running"
else
print_error "MongoDB failed to start"
exit 1
fi
print_status "Installing backend dependencies..."
cd packages/backend
npm install
print_status "Testing S3 connection..."
if node test-s3.js; then
print_success "S3 connection test passed"
else
print_warning "S3 connection test failed - this is normal if MinIO is still starting up"
fi
print_status "Installing frontend dependencies..."
cd ../frontend
npm install
print_success "Setup complete!"
echo ""
echo "🚀 Next steps:"
echo "1. Start the backend: cd packages/backend && npm run dev"
echo "2. Start the frontend: cd packages/frontend && npm run dev"
echo "3. Access MinIO console: http://localhost:9001 (admin/admin)"
echo "4. Test the application: http://localhost:5173"
echo ""
echo "📚 Documentation:"
echo "- S3_STORAGE_README.md - Complete feature documentation"
echo "- IMPLEMENTATION_SUMMARY.md - Implementation overview"
echo ""
echo "🧪 Testing:"
echo "- Upload music files through the web interface"
echo "- Test playback functionality"
echo "- Check MinIO console for stored files"
echo ""
print_success "Happy testing! 🎵"