File size: 5,396 Bytes
d1f3f31 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | @echo off
REM =============================================================================
REM AI-Powered Sentiment Analysis System - Complete Startup Script
REM =============================================================================
setlocal enabledelayedexpansion
cls
echo.
echo βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
echo β AI-Powered Aspect-Based Sentiment Analysis System β
echo β π― Complete Startup Script π― β
echo βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
echo.
REM Set project root
set PROJECT_ROOT=%~dp0
cd /d "%PROJECT_ROOT%"
echo [1/6] Checking environment...
if not exist ".venv" (
echo β ERROR: Virtual environment not found at .venv
echo Run: python -m venv .venv
pause
exit /b 1
)
echo β
Virtual environment found
echo.
echo [2/6] Checking Python dependencies...
call .venv\Scripts\python.exe -c "import fastapi, spacy, whisper" >nul 2>&1
if errorlevel 1 (
echo β οΈ Installing dependencies...
call .venv\Scripts\pip.exe install -r requirements.txt
if errorlevel 1 (
echo β Failed to install dependencies
pause
exit /b 1
)
) else (
echo β
All Python dependencies installed
)
echo.
echo [3/6] Checking spaCy models...
call .venv\Scripts\python.exe -c "import spacy; spacy.load('en_core_web_sm')" >nul 2>&1
if errorlevel 1 (
echo β οΈ Downloading spaCy English model...
call .venv\Scripts\python.exe -m spacy download en_core_web_sm
if errorlevel 1 (
echo β Failed to download spaCy model
pause
exit /b 1
)
) else (
echo β
spaCy model available
)
echo.
echo [4/6] Checking Node.js for frontend...
where node >nul 2>&1
if errorlevel 1 (
echo β Node.js not found. Install from: https://nodejs.org/
pause
exit /b 1
)
echo β
Node.js found
where npm >nul 2>&1
if errorlevel 1 (
echo β npm not found
pause
exit /b 1
)
echo β
npm found
echo.
echo [5/6] Checking frontend dependencies...
if not exist "frontend\node_modules" (
echo β οΈ Installing frontend dependencies...
cd frontend
call npm install
if errorlevel 1 (
echo β Failed to install frontend dependencies
pause
exit /b 1
)
cd ..
) else (
echo β
Frontend dependencies installed
)
echo.
echo [6/6] Running system tests...
call .venv\Scripts\python.exe test_system.py >nul 2>&1
if errorlevel 1 (
echo β οΈ Some tests failed, but system may still work
) else (
echo β
All system tests passed
)
echo.
echo βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
echo β β
SYSTEM READY TO START β
echo βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
echo.
echo π STARTING SERVICES...
echo.
echo Opening 3 windows:
echo 1. Backend API (http://localhost:8000)
echo 2. Frontend Dev Server (http://localhost:5173)
echo 3. Test Client (open in browser when ready)
echo.
timeout /t 2
REM Start backend in new window
echo Starting Backend API...
start "Backend API" cmd /k "cd /d "%PROJECT_ROOT%" && .venv\Scripts\python.exe -m uvicorn src.api.server:app --reload --port 8000"
timeout /t 3
REM Start frontend in new window
echo Starting Frontend Dev Server...
start "Frontend Dev" cmd /k "cd /d "%PROJECT_ROOT%\frontend" && npm run dev"
timeout /t 3
REM Open test client in browser
echo Opening test client in browser...
start test_client.html
echo.
echo βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
echo β π STARTUP COMPLETE β
echo βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
echo.
echo π Access points:
echo.
echo Frontend Dashboard: http://localhost:5173
echo API Health Check: http://localhost:8000/health
echo API Documentation: http://localhost:8000/docs
echo Raw Test Client: file:///%PROJECT_ROOT%test_client.html
echo.
echo.
echo βΉοΈ To stop the services:
echo - Close the Backend API window (Ctrl+C)
echo - Close the Frontend window (Ctrl+C)
echo.
echo π Documentation:
echo - SYSTEM_GUIDE.md - Comprehensive documentation
echo - README.md - Project overview
echo.
pause
|