Files
soft/start-dev.bat
MingNian 435af55c4a Initial commit: HealthManager full-stack health management platform
Backend: .NET 10 + PostgreSQL + EF Core + JWT + SignalR
Frontend patient: React 19 + TypeScript + Vite (mobile H5)
Frontend doctor: React 19 + TypeScript + Vite (desktop web)
2026-05-20 16:18:56 +08:00

76 lines
2.2 KiB
Batchfile

@echo off
chcp 65001 >nul 2>&1
title HealthManager - Dev Startup
echo ==========================================
echo HealthManager Dev Environment
echo ==========================================
set "DOTNET=C:\Program Files\dotnet\dotnet.exe"
set "REDIS=C:\Program Files\Redis\redis-server.exe"
set "PG_DATA=D:\APP\data\pgdata"
set "PG_BIN=D:\PostgreSQL\18\pgsql\bin"
set "MINIO_DATA=D:\APP\data\minio"
echo.
echo [1/4] Starting PostgreSQL...
if exist "%PG_BIN%\pg_ctl.exe" (
"%PG_BIN%\pg_ctl.exe" -D "%PG_DATA%" -l "%PG_DATA%\pg.log" start 2>nul
if errorlevel 1 (
echo PostgreSQL is already running or failed to start
) else (
echo PostgreSQL started
)
) else (
echo [WARN] PostgreSQL not found at %PG_BIN%
)
echo.
echo [2/4] Starting Redis...
tasklist /fi "imagename eq redis-server.exe" | find /i "redis-server.exe" >nul
if errorlevel 1 (
start "Redis" /MIN "%REDIS%" "%ProgramFiles%\Redis\redis.windows.conf"
echo Redis started
) else (
echo Redis is already running
)
echo.
echo [3/4] Starting MinIO...
tasklist /fi "imagename eq minio.exe" | find /i "minio.exe" >nul
if errorlevel 1 (
if not exist "%MINIO_DATA%" mkdir "%MINIO_DATA%"
start "MinIO" /MIN minio server "%MINIO_DATA%" --address ":9000" --console-address ":9001"
echo MinIO started
) else (
echo MinIO is already running
)
echo.
echo [4/4] Starting Backend API...
cd /d "%~dp0backend"
if exist "%DOTNET%" (
start "HealthManager API" "%DOTNET%" run --project src\HealthManager.WebApi --urls "http://localhost:5000" --environment Development
echo Backend API starting (http://localhost:5000)
echo Swagger: http://localhost:5000/swagger
) else (
echo [ERROR] .NET SDK not found
)
echo.
echo ==========================================
echo Startup Complete!
echo.
echo Backend API: http://localhost:5000
echo Swagger: http://localhost:5000/swagger
echo MinIO: http://localhost:9001
echo PostgreSQL: localhost:5432
echo Redis: localhost:6379
echo.
echo Frontend (manual start):
echo cd frontend-patient ^&^& npm run dev
echo cd frontend-doctor ^&^& npm run dev
echo ==========================================
echo.
pause