@echo off
cd /d "%~dp0"

echo ============================================
echo   GA Commission System - Start All
echo ============================================
echo.
echo  Starting BACKEND (ga-api 8082) and
echo  FRONTEND (ga-frontend 3000) in two windows.
echo  Do NOT close those two windows.
echo.

start "GA Backend (ga-api 8082)" cmd /k "cd /d %~dp0 && .\gradlew.bat :ga-api:bootRun"
start "GA Frontend (3000)" cmd /k "cd /d %~dp0ga-frontend && npm install && npm run dev"

echo.
echo  Starting up... first run may take a few minutes.
echo  When both windows are ready, open your browser:
echo.
echo      http://localhost:3000
echo.
echo  Login ID / PW :  admin  /  admin1234!
echo.
echo  To stop: close the two black windows.
echo.
pause
