@echo off
:: ============================================================
:: Start offer dev environment
::   Backend : http://127.0.0.1:8000  (Django, uses venv)
::   Frontend: http://localhost:5173  (Vite)
:: Close the window to stop the service.
:: ============================================================

set "ROOT=%~dp0"
set "BACKEND=%ROOT%offer_backend"
set "FRONTEND=%ROOT%offer_frontend"
set "VENV_PY=%BACKEND%\.venv\Scripts\python.exe"

echo [*] Starting backend (Django :8000) ...
start "offer-backend" /D "%BACKEND%" cmd /k "%VENV_PY%" manage.py runserver 0.0.0.0:8000

echo [*] Starting frontend (Vite :5173) ...
start "offer-frontend" /D "%FRONTEND%" cmd /k npm run dev

echo.
echo === Started ===
echo Backend : http://127.0.0.1:8000
echo Frontend: http://localhost:5173
echo.
pause
