first commit
This commit is contained in:
84
frontend/start.bat
Normal file
84
frontend/start.bat
Normal file
@@ -0,0 +1,84 @@
|
||||
@echo off
|
||||
REM TurboTrades Frontend Startup Script for Windows
|
||||
REM This script helps you start the development server quickly
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
echo TurboTrades Frontend Startup
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
REM Check if Node.js is installed
|
||||
where node >nul 2>nul
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo [ERROR] Node.js is not installed!
|
||||
echo.
|
||||
echo Please install Node.js 18 or higher from:
|
||||
echo https://nodejs.org/
|
||||
echo.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Display Node.js version
|
||||
echo [OK] Node.js is installed
|
||||
node -v
|
||||
echo [OK] npm is installed
|
||||
npm -v
|
||||
echo.
|
||||
|
||||
REM Check if node_modules exists
|
||||
if not exist "node_modules\" (
|
||||
echo [INFO] Installing dependencies...
|
||||
echo This may take a few minutes on first run...
|
||||
echo.
|
||||
call npm install
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo.
|
||||
echo [ERROR] Failed to install dependencies
|
||||
echo.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
echo.
|
||||
echo [OK] Dependencies installed successfully
|
||||
echo.
|
||||
) else (
|
||||
echo [OK] Dependencies already installed
|
||||
echo.
|
||||
)
|
||||
|
||||
REM Check if .env exists
|
||||
if not exist ".env" (
|
||||
echo [WARNING] No .env file found
|
||||
echo Using default configuration:
|
||||
echo - Backend API: http://localhost:3000
|
||||
echo - WebSocket: ws://localhost:3000
|
||||
echo.
|
||||
)
|
||||
|
||||
REM Display helpful information
|
||||
echo ========================================
|
||||
echo Quick Tips
|
||||
echo ========================================
|
||||
echo.
|
||||
echo - Make sure backend is running on port 3000
|
||||
echo - Frontend will start on http://localhost:5173
|
||||
echo - Press Ctrl+C to stop the server
|
||||
echo - Hot reload is enabled
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Starting Development Server...
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
REM Start the development server
|
||||
call npm run dev
|
||||
|
||||
REM If npm run dev exits, pause so user can see any errors
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo.
|
||||
echo [ERROR] Development server failed to start
|
||||
echo.
|
||||
pause
|
||||
)
|
||||
Reference in New Issue
Block a user