#!/bin/bash # myFidelityTracker Start Script echo "🚀 Starting myFidelityTracker..." echo "" # Check if Docker is running if ! docker info > /dev/null 2>&1; then echo "❌ Docker is not running. Please start Docker Desktop and try again." exit 1 fi # Check if .env exists, if not copy from example if [ ! -f .env ]; then echo "📝 Creating .env file from .env.example..." cp .env.example .env fi # Create imports directory if it doesn't exist mkdir -p imports # Copy sample CSV if it exists in the root if [ -f "History_for_Account_X38661988.csv" ] && [ ! -f "imports/History_for_Account_X38661988.csv" ]; then echo "📋 Copying sample CSV to imports directory..." cp History_for_Account_X38661988.csv imports/ fi # Start services echo "🐳 Starting Docker containers..." docker-compose up -d # Wait for services to be healthy echo "" echo "⏳ Waiting for services to be ready..." sleep 5 # Check if backend is up echo "🔍 Checking backend health..." for i in {1..30}; do if curl -s http://localhost:8000/health > /dev/null 2>&1; then echo "✅ Backend is ready!" break fi if [ $i -eq 30 ]; then echo "⚠️ Backend is taking longer than expected to start" echo " Check logs with: docker-compose logs backend" fi sleep 2 done # Check if frontend is up echo "🔍 Checking frontend..." for i in {1..20}; do if curl -s http://localhost:3000 > /dev/null 2>&1; then echo "✅ Frontend is ready!" break fi if [ $i -eq 20 ]; then echo "⚠️ Frontend is taking longer than expected to start" echo " Check logs with: docker-compose logs frontend" fi sleep 2 done echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "✨ myFidelityTracker is running!" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" echo "🌐 Frontend: http://localhost:3000" echo "🔌 Backend: http://localhost:8000" echo "📚 API Docs: http://localhost:8000/docs" echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" echo "📖 Quick Start Guide:" echo " 1. Open http://localhost:3000 in your browser" echo " 2. Go to the 'Accounts' tab to create your first account" echo " 3. Go to the 'Import' tab to upload a Fidelity CSV file" echo " 4. View your dashboard with performance metrics" echo "" echo "🌱 To seed demo data (optional):" echo " docker-compose exec backend python seed_demo_data.py" echo "" echo "📊 To view logs:" echo " docker-compose logs -f" echo "" echo "🛑 To stop:" echo " ./stop.sh or docker-compose down" echo ""