RamMAC / setup.bat
Aaryan17's picture
feat: upload full MAC source (mac/, frontend/, alembic/, tests/)
9c0b225 verified
@echo off
setlocal EnableDelayedExpansion
title MAC Platform β€” One-Click Setup
color 0A
echo.
echo ╔══════════════════════════════════════════════════════╗
echo β•‘ MAC Platform β€” One-Click Setup β•‘
echo β•‘ Multi-Agent Classroom (c) 2025 β•‘
echo β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
echo.
:: ── Step 1: Check Docker Desktop is running ────────────────
echo [1/6] Checking Docker Desktop...
docker info >nul 2>&1
if %errorlevel% neq 0 (
echo.
echo ERROR: Docker Desktop is not running.
echo Please start Docker Desktop and run this script again.
echo.
pause
exit /b 1
)
echo OK β€” Docker is running.
:: ── Step 2: Check Python ───────────────────────────────────
echo [2/6] Checking Python...
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: Python not found. Install Python 3.11+ from https://python.org
pause
exit /b 1
)
for /f "tokens=*" %%v in ('python --version 2^>^&1') do echo OK β€” %%v
:: ── Step 3: Start Postgres + Redis via Docker Compose ──────
echo [3/6] Starting PostgreSQL and Redis...
docker compose up -d postgres redis
if %errorlevel% neq 0 (
echo ERROR: docker compose failed. Make sure docker-compose.yml is present.
pause
exit /b 1
)
echo OK β€” Postgres and Redis started.
echo Waiting 3 seconds for DB to be ready...
timeout /t 3 /nobreak >nul
:: ── Step 4: Install Python dependencies ───────────────────
echo [4/6] Installing Python dependencies...
pip install -r requirements.txt --quiet
if %errorlevel% neq 0 (
echo WARNING: Some packages may have failed. Check requirements.txt.
)
echo OK β€” Dependencies installed.
:: ── Step 5: Detect LAN IP ──────────────────────────────────
echo [5/6] Detecting network address...
for /f "tokens=2 delims=:" %%a in ('ipconfig ^| findstr /R "IPv4.*192\.\|IPv4.*10\.\|IPv4.*172\."') do (
set LAN_IP=%%a
set LAN_IP=!LAN_IP: =!
goto :found_ip
)
set LAN_IP=localhost
:found_ip
echo OK β€” LAN IP: %LAN_IP%
:: ── Step 6: Start the MAC server ──────────────────────────
echo [6/6] Starting MAC server...
echo.
echo β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
echo β”‚ MAC is starting on: β”‚
echo β”‚ Local: http://localhost:8000 β”‚
echo β”‚ Network: http://%LAN_IP%:8000 β”‚
echo β”‚ β”‚
echo β”‚ Press Ctrl+C to stop the server. β”‚
echo β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
echo.
uvicorn mac.main:app --host 0.0.0.0 --port 8000 --reload
endlocal