| @echo off |
| |
| |
| |
|
|
| setlocal enabledelayedexpansion |
|
|
| cls |
| echo. |
| echo βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| echo β AI-Powered Aspect-Based Sentiment Analysis System β |
| echo β π― Complete Startup Script π― β |
| echo βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| echo. |
| |
| |
| 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 |
| |
| |
| 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 |
| |
| |
| echo Starting Frontend Dev Server... |
| start "Frontend Dev" cmd /k "cd /d "%PROJECT_ROOT%\frontend" && npm run dev" |
|
|
| timeout /t 3 |
| |
| |
| 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 |
|
|