Complete Non-Conformance Report system replacing the PowerApps/SharePoint prototype: FastAPI + SQLAlchemy 2 (async) + Alembic + MySQL 8 backend, React 18 + Vite + TypeScript + MUI frontend, Entra ID auth (MSAL / JWKS, group-gated), Microsoft Graph delegated Mail.Send notifications (OBO), six-stage workflow state machine with server-side enforcement, atomic NCR-YYYY-NNNN numbering, attachments with camera capture, immutable field-level audit trail, admin reopen, reports + CSV export, WeasyPrint PDF traveler, Power BI reporting views + read-only DB user, documented VISUAL ERP job-lookup stub, pytest suite (26 tests), docker-compose deployment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
18 lines
441 B
Bash
18 lines
441 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
echo "[api] running database migrations..."
|
|
attempt=0
|
|
until alembic upgrade head; do
|
|
attempt=$((attempt + 1))
|
|
if [ "$attempt" -ge 12 ]; then
|
|
echo "[api] migrations failed after $attempt attempts, giving up." >&2
|
|
exit 1
|
|
fi
|
|
echo "[api] database not ready (attempt $attempt), retrying in 5s..."
|
|
sleep 5
|
|
done
|
|
echo "[api] migrations complete."
|
|
|
|
exec uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 2
|