Files
QQuiz/check_status.bat
handsomezhuzhu 018ed27099 🔧 Fix frontend warnings and add diagnostic tools
Fix:
- Add type: module to package.json to eliminate ES module warning
- Create separate backend/frontend startup scripts
- Add system status check tool

New files:
- check_status.bat: Diagnose system status
- start_backend_only.bat: Start backend separately
- start_frontend_only.bat: Start frontend separately

🚀 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 13:54:05 +08:00

88 lines
1.8 KiB
Batchfile

@echo off
title QQuiz - System Status Check
echo.
echo ========================================
echo QQuiz System Status Check
echo ========================================
echo.
echo [1] Checking Python...
python --version
if %errorlevel% neq 0 (
echo ERROR: Python not found!
) else (
echo OK
)
echo.
echo [2] Checking Node.js...
node --version
if %errorlevel% neq 0 (
echo ERROR: Node.js not found!
) else (
echo OK
)
echo.
echo [3] Checking PostgreSQL...
psql --version
if %errorlevel% neq 0 (
echo WARNING: PostgreSQL command not found in PATH
) else (
echo OK
)
echo.
echo [4] Checking if backend is running...
curl -s http://localhost:8000/health >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: Backend is NOT running on port 8000
echo.
echo Backend must be started first!
echo Run the backend window manually:
echo cd backend
echo venv\Scripts\activate.bat
echo uvicorn main:app --reload
) else (
echo OK - Backend is running
)
echo.
echo [5] Checking if frontend is running...
curl -s http://localhost:3000 >nul 2>&1
if %errorlevel% neq 0 (
echo WARNING: Frontend is NOT running on port 3000
) else (
echo OK - Frontend is running
)
echo.
echo [6] Checking ports...
echo Checking port 8000 (Backend):
netstat -ano | findstr :8000
echo.
echo Checking port 3000 (Frontend):
netstat -ano | findstr :3000
echo.
echo [7] Checking .env configuration...
if exist ".env" (
echo OK - .env file exists
findstr /C:"OPENAI_API_KEY=sk-" .env >nul
if %errorlevel% neq 0 (
echo WARNING: OPENAI_API_KEY may not be configured properly
) else (
echo OK - API Key appears to be configured
)
) else (
echo ERROR: .env file not found!
)
echo.
echo ========================================
echo Diagnosis Complete
echo ========================================
echo.
pause