#!/bin/bash # Network Scanner Frontend Start Script echo "╔══════════════════════════════════════════════════════════════════════════════╗" echo "║ Network Scanner Frontend - Starting... ║" echo "╚══════════════════════════════════════════════════════════════════════════════╝" echo "" # Check if node_modules exists if [ ! -d "node_modules" ]; then echo "❌ Dependencies not installed. Running setup..." ./setup.sh if [ $? -ne 0 ]; then exit 1 fi fi # Check if backend is running echo "🔍 Checking backend connection..." if curl -s http://localhost:8000/health > /dev/null 2>&1; then echo "✅ Backend is running" else echo "⚠️ Backend not detected at http://localhost:8000" echo " Make sure to start the backend server first:" echo " cd .. && python main.py" echo "" read -p "Continue anyway? (y/n) " -n 1 -r echo "" if [[ ! $REPLY =~ ^[Yy]$ ]]; then exit 1 fi fi echo "" echo "🚀 Starting development server..." echo "" echo "Frontend will be available at: http://localhost:3000" echo "Press Ctrl+C to stop" echo "" npm run dev