Files
AIclinicalresearch/一键启动.bat
AI Clinical Dev Team 96d9783242 fix: create mock user to resolve FK constraint issue
Issues fixed:
1. Frontend port is 3000 (not 5173)
2. Projects API returns 500 due to missing user
3. Foreign key constraint violation on projects_user_id_fkey

Solutions:
- Created create-mock-user.ts script
- Added user-mock-001 to database
- Created startup guide (娴嬭瘯鍜屽惎鍔?md)
- Created one-click launcher (涓€閿惎鍔?bat)
- Created diagnostic tool (璇婃柇闂.bat)

New files:
- backend/src/scripts/create-mock-user.ts
- 娴嬭瘯鍜屽惎鍔?md
- 涓€閿惎鍔?bat
- 璇婃柇闂.bat
2025-10-10 21:15:04 +08:00

56 lines
1.3 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
chcp 65001 >nul
echo ========================================
echo AI临床研究平台 - 一键启动脚本
echo ========================================
echo.
echo [1/5] 检查Docker容器状态...
docker ps >nul 2>&1
if errorlevel 1 (
echo ❌ Docker未运行请先启动Docker Desktop
pause
exit /b 1
)
echo [2/5] 启动PostgreSQL和Redis容器...
cd /d "%~dp0"
docker-compose up -d
if errorlevel 1 (
echo ❌ Docker容器启动失败
pause
exit /b 1
)
echo ✅ 数据库容器启动成功
echo [3/5] 等待数据库就绪...
timeout /t 5 /nobreak >nul
echo [4/5] 启动后端服务(新窗口)...
start "AI临床研究平台-后端" cmd /k "cd /d %~dp0backend && npm run dev"
echo ✅ 后端服务启动中...
echo [5/5] 等待后端启动...
timeout /t 3 /nobreak >nul
echo [6/6] 启动前端服务(新窗口)...
start "AI临床研究平台-前端" cmd /k "cd /d %~dp0frontend && npm run dev"
echo ✅ 前端服务启动中...
echo.
echo ========================================
echo 启动完成!
echo ========================================
echo.
echo 后端地址: http://localhost:3001
echo 前端地址: http://localhost:3000
echo.
echo 请等待10秒后访问前端地址
echo.
timeout /t 10 /nobreak
start http://localhost:3000
echo.
echo 按任意键关闭此窗口...
pause >nul