Files
TurboTrades/frontend/start.sh
2026-01-10 04:57:43 +00:00

70 lines
1.8 KiB
Bash

#!/bin/bash
# TurboTrades Frontend Startup Script
# This script helps you start the development server quickly
echo "🚀 TurboTrades Frontend Startup"
echo "================================"
echo ""
# Check if Node.js is installed
if ! command -v node &> /dev/null
then
echo "❌ Node.js is not installed. Please install Node.js 18+ first."
echo " Download from: https://nodejs.org/"
exit 1
fi
# Check Node.js version
NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
if [ "$NODE_VERSION" -lt 18 ]; then
echo "⚠️ Warning: Node.js version should be 18 or higher"
echo " Current version: $(node -v)"
echo " Download from: https://nodejs.org/"
echo ""
fi
echo "✅ Node.js $(node -v) detected"
echo "✅ npm $(npm -v) detected"
echo ""
# Check if node_modules exists
if [ ! -d "node_modules" ]; then
echo "📦 Installing dependencies..."
echo " This may take a few minutes on first run..."
npm install
if [ $? -ne 0 ]; then
echo ""
echo "❌ Failed to install dependencies"
exit 1
fi
echo "✅ Dependencies installed successfully"
echo ""
else
echo "✅ Dependencies already installed"
echo ""
fi
# Check if .env exists
if [ ! -f ".env" ]; then
echo "⚠️ No .env file found. Using default configuration..."
echo " Backend API: http://localhost:3000"
echo " WebSocket: ws://localhost:3000"
echo ""
fi
# Display helpful information
echo "📝 Quick Tips:"
echo " - Backend should be running on http://localhost:3000"
echo " - Frontend will start on http://localhost:5173"
echo " - Press Ctrl+C to stop the server"
echo " - Hot reload is enabled - changes will reflect automatically"
echo ""
echo "🌐 Starting development server..."
echo "================================"
echo ""
# Start the development server
npm run dev