2026-04-20 17:58:03 +08:00
|
|
|
#!/usr/bin/env bash
|
feat: surgery pipeline API, video inference, voice confirm, and tests
- Add FastAPI routes for surgery start/end, results, pending confirmation (WAV upload), and health checks.
- Implement RTSP/Hikvision capture, consumable classification, session manager, MinIO/Baidu voice resolution, and DB persistence.
- Add documentation (client API, video backends, staging checklist) and sample camera/RTSP config.
- Add pytest suite (API contract, session manager, voice, repositories, pipeline persistence) and httpx dev dependency.
- Replace deprecated HTTP_422_UNPROCESSABLE_ENTITY with HTTP_422_UNPROCESSABLE_CONTENT.
- Fix SurgeryPipeline DB reads to use an explicit transaction with autobegin disabled.
Made-with: Cursor
2026-04-21 18:33:54 +08:00
|
|
|
# Start PostgreSQL from docker-compose.dev.yml and run the FastAPI app on the host.
|
2026-04-20 17:58:03 +08:00
|
|
|
# Usage: ./start.sh
|
feat: surgery pipeline API, video inference, voice confirm, and tests
- Add FastAPI routes for surgery start/end, results, pending confirmation (WAV upload), and health checks.
- Implement RTSP/Hikvision capture, consumable classification, session manager, MinIO/Baidu voice resolution, and DB persistence.
- Add documentation (client API, video backends, staging checklist) and sample camera/RTSP config.
- Add pytest suite (API contract, session manager, voice, repositories, pipeline persistence) and httpx dev dependency.
- Replace deprecated HTTP_422_UNPROCESSABLE_ENTITY with HTTP_422_UNPROCESSABLE_CONTENT.
- Fix SurgeryPipeline DB reads to use an explicit transaction with autobegin disabled.
Made-with: Cursor
2026-04-21 18:33:54 +08:00
|
|
|
# Optional: SKIP_DOCKER=1 to skip Compose and use an existing PostgreSQL instance.
|
2026-04-20 17:58:03 +08:00
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
cd "$ROOT"
|
|
|
|
|
|
|
|
|
|
COMPOSE_FILE="${COMPOSE_FILE:-docker-compose.dev.yml}"
|
|
|
|
|
|
|
|
|
|
if [[ "${SKIP_DOCKER:-0}" != "1" ]]; then
|
|
|
|
|
docker compose -f "$COMPOSE_FILE" up -d db
|
|
|
|
|
echo "Waiting for PostgreSQL..."
|
|
|
|
|
for _ in $(seq 1 60); do
|
|
|
|
|
if docker compose -f "$COMPOSE_FILE" exec -T db \
|
|
|
|
|
pg_isready -U "${POSTGRES_USER:-postgres}" -d "${POSTGRES_DB:-operation_room}" \
|
|
|
|
|
>/dev/null 2>&1; then
|
|
|
|
|
echo "PostgreSQL is ready."
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
sleep 1
|
|
|
|
|
done
|
|
|
|
|
else
|
feat: surgery pipeline API, video inference, voice confirm, and tests
- Add FastAPI routes for surgery start/end, results, pending confirmation (WAV upload), and health checks.
- Implement RTSP/Hikvision capture, consumable classification, session manager, MinIO/Baidu voice resolution, and DB persistence.
- Add documentation (client API, video backends, staging checklist) and sample camera/RTSP config.
- Add pytest suite (API contract, session manager, voice, repositories, pipeline persistence) and httpx dev dependency.
- Replace deprecated HTTP_422_UNPROCESSABLE_ENTITY with HTTP_422_UNPROCESSABLE_CONTENT.
- Fix SurgeryPipeline DB reads to use an explicit transaction with autobegin disabled.
Made-with: Cursor
2026-04-21 18:33:54 +08:00
|
|
|
echo "SKIP_DOCKER=1: not starting Docker Compose; using POSTGRES_* or DATABASE_URL from the environment."
|
2026-04-20 17:58:03 +08:00
|
|
|
fi
|
|
|
|
|
|
feat: surgery pipeline API, video inference, voice confirm, and tests
- Add FastAPI routes for surgery start/end, results, pending confirmation (WAV upload), and health checks.
- Implement RTSP/Hikvision capture, consumable classification, session manager, MinIO/Baidu voice resolution, and DB persistence.
- Add documentation (client API, video backends, staging checklist) and sample camera/RTSP config.
- Add pytest suite (API contract, session manager, voice, repositories, pipeline persistence) and httpx dev dependency.
- Replace deprecated HTTP_422_UNPROCESSABLE_ENTITY with HTTP_422_UNPROCESSABLE_CONTENT.
- Fix SurgeryPipeline DB reads to use an explicit transaction with autobegin disabled.
Made-with: Cursor
2026-04-21 18:33:54 +08:00
|
|
|
export POSTGRES_USER="${POSTGRES_USER:-postgres}"
|
|
|
|
|
export POSTGRES_PASSWORD="${POSTGRES_PASSWORD:-postgres}"
|
|
|
|
|
export POSTGRES_DB="${POSTGRES_DB:-operation_room}"
|
|
|
|
|
export POSTGRES_HOST="${POSTGRES_HOST:-localhost}"
|
|
|
|
|
export POSTGRES_PORT="${POSTGRES_PORT:-35432}"
|
2026-04-20 17:58:03 +08:00
|
|
|
|
feat: surgery pipeline API, video inference, voice confirm, and tests
- Add FastAPI routes for surgery start/end, results, pending confirmation (WAV upload), and health checks.
- Implement RTSP/Hikvision capture, consumable classification, session manager, MinIO/Baidu voice resolution, and DB persistence.
- Add documentation (client API, video backends, staging checklist) and sample camera/RTSP config.
- Add pytest suite (API contract, session manager, voice, repositories, pipeline persistence) and httpx dev dependency.
- Replace deprecated HTTP_422_UNPROCESSABLE_ENTITY with HTTP_422_UNPROCESSABLE_CONTENT.
- Fix SurgeryPipeline DB reads to use an explicit transaction with autobegin disabled.
Made-with: Cursor
2026-04-21 18:33:54 +08:00
|
|
|
exec uv run uvicorn main:app --host "${HOST:-0.0.0.0}" --port "${PORT:-38080}" --reload
|