First push
This commit is contained in:
seclusionenthusiast committed 2026-03-03 14:52:19 +09:00
commit c4a020c191
146 files changed
+40796

No files matched your search

Executable
+36
View File
@@ -0,0 +1,36 @@
#!/bin/bash
# StemEngine startup script.
# Builds the React frontend (full build, then watch mode) and starts the
# FastAPI backend. Both processes run in the same container so that
# .tsx/.ts edits on the host are picked up and served without a Docker rebuild.
set -e
FRONTEND=/app/frontend
BACKEND=/app/backend
echo "========================================="
echo " StemEngine startup"
echo "========================================="
# ── Frontend ──────────────────────────────────────────────────────────────────
cd "$FRONTEND"
# Install / sync packages. --prefer-offline uses the local cache first so
# subsequent starts are fast; falls back to the registry if needed.
echo "[frontend] Syncing npm packages..."
npm install --prefer-offline --no-audit --no-fund 2>&1 | grep -v "^npm warn" || true
# Initial full build so backend/static is populated before uvicorn starts.
# Subsequent hot-rebuilds are handled by --watch below.
echo "[frontend] Building..."
npx vite build 2>&1
echo "[frontend] Starting watch mode (rebuilds on .tsx/.ts changes)..."
npx vite build --watch 2>&1 &
# ── Backend ───────────────────────────────────────────────────────────────────
cd /app
echo "[backend] Starting uvicorn..."
exec python3.11 -m uvicorn backend.main:app \
--host 0.0.0.0 --port 8000 --log-level info --reload