Files
family-hub/setup.bat

93 lines
2.0 KiB
Batchfile

@echo off
echo ========================================
echo Family Hub - Windows Setup
echo ========================================
echo.
REM Check if Python is installed
python --version >nul 2>&1
if errorlevel 1 (
echo ERROR: Python is not installed or not in PATH
echo Please install Python 3.9+ from python.org
pause
exit /b 1
)
REM Check if Node.js is installed
node --version >nul 2>&1
if errorlevel 1 (
echo ERROR: Node.js is not installed or not in PATH
echo Please install Node.js from nodejs.org
pause
exit /b 1
)
echo [1/4] Setting up Backend Python environment...
cd backend
if not exist venv (
python -m venv venv
echo Virtual environment created.
) else (
echo Virtual environment already exists.
)
echo.
echo [2/4] Installing Python dependencies...
REM Call pip directly without activating venv
venv\Scripts\pip.exe install --upgrade pip
venv\Scripts\pip.exe install -r requirements.txt
if errorlevel 1 (
echo ERROR: Failed to install Python dependencies
cd ..
pause
exit /b 1
)
cd ..
echo.
echo [3/4] Installing Frontend dependencies...
cd frontend
call npm install
if errorlevel 1 (
echo ERROR: Failed to install npm dependencies
cd ..
pause
exit /b 1
)
cd ..
echo.
echo [4/4] Initializing database with demo data...
cd backend
REM Create data directory if it doesn't exist
if not exist data mkdir data
REM Call python directly without activating venv
venv\Scripts\python.exe init_db.py
if errorlevel 1 (
echo WARNING: Database initialization had issues
) else (
echo Database initialized successfully!
)
cd ..
echo.
echo ========================================
echo Setup Complete!
echo ========================================
echo.
echo To start the application:
echo 1. Run start-backend.bat in one terminal
echo 2. Run start-frontend.bat in another terminal
echo.
echo Or use start-all.bat to start both together
echo.
echo Application URLs:
echo Frontend: http://localhost:5173
echo Backend: http://localhost:8001
echo.
echo Login with: jess / password123
echo.
pause