File size: 2,173 Bytes
771f178
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@echo off
title Darak AI Platform
echo ======================================
echo   Starting Darak AI Platform...
echo ======================================

cd /d "%~dp0"

:: Check Python
python --version >nul 2>&1
if errorlevel 1 (
    echo [ERROR] Python not found. Install from https://python.org
    pause
    exit /b 1
)

:: 1. Create Virtual Environment
if not exist "venv\" (
    echo [*] Creating Python Virtual Environment...
    python -m venv venv
)

echo [*] Activating Virtual Environment...
call venv\Scripts\activate.bat

echo [*] Upgrading pip...
python -m pip install --upgrade pip setuptools wheel --quiet

:: 2. Install Backend Dependencies
echo [*] Installing Backend Dependencies...
pip install -r backend\requirements.txt --quiet

:: 3. Start Backend API on port 8000
echo [*] Starting AI Backend on port 8000...
cd backend
start "Darak Backend API" cmd /c "uvicorn main:app --reload --host 0.0.0.0 --port 8000"
cd ..

:: 4. Start Frontend Dev Server on port 8765
echo [*] Starting Frontend Server on port 8765...
cd front
start "Darak Frontend Server" cmd /c "python -m http.server 8765"
cd ..

:: 5. Start Aggregator Service on port 9000 (optional)
if exist "aggregator_service\node_modules" (
    echo [*] Starting Aggregator Service on port 9000...
    cd aggregator_service
    set PORT=9000
    start "Darak Aggregator" cmd /c "node src/server.js"
    cd ..
) else (
    echo [!] Aggregator node_modules not found. Run: cd aggregator_service ^&^& npm install
)

echo ======================================
echo   Darak AI Platform is LIVE!
echo.
echo   Frontend:    http://localhost:8765
echo   Backend API: http://localhost:8000
echo   API Docs:    http://localhost:8000/docs
echo   Aggregator:  http://localhost:9000
echo ======================================
echo.
echo Opening browser...
timeout /t 2 /nobreak >nul
start http://localhost:8765

echo Press any key to stop all servers...
pause >nul

echo Stopping all servers...
taskkill /fi "WindowTitle eq Darak Backend (8765)*" /f >nul 2>&1
taskkill /fi "WindowTitle eq Darak Frontend (3333)*" /f >nul 2>&1
taskkill /fi "WindowTitle eq Darak Aggregator (9000)*" /f >nul 2>&1
echo Done.