feat(chat): desktop usando Convex WS direto e fallback WS dedicado
This commit is contained in:
parent
8db7c3c810
commit
a8f5ff9d51
14 changed files with 735 additions and 458 deletions
|
|
@ -16,6 +16,7 @@ echo "[start-web] Using bun cache dir: $BUN_INSTALL_CACHE_DIR"
|
|||
echo "[start-web] Using APP_DIR=$(pwd)"
|
||||
echo "[start-web] NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL:-}"
|
||||
echo "[start-web] NEXT_PUBLIC_CONVEX_URL=${NEXT_PUBLIC_CONVEX_URL:-}"
|
||||
echo "[start-web] CHAT_WS_PORT=${CHAT_WS_PORT:-3030}"
|
||||
|
||||
ensure_db_writable() {
|
||||
mkdir -p "$(dirname "$DB_PATH")"
|
||||
|
|
@ -203,6 +204,19 @@ else
|
|||
echo "[start-web] skipping auth seed (SKIP_AUTH_SEED=true)"
|
||||
fi
|
||||
|
||||
# Iniciar servidor WebSocket de chat (processo dedicado)
|
||||
CHAT_WS_PORT="${CHAT_WS_PORT:-3030}"
|
||||
CHAT_WS_SCRIPT="/app/scripts/chat-ws-server.mjs"
|
||||
if [ -f "$CHAT_WS_SCRIPT" ]; then
|
||||
echo "[start-web] iniciando chat-ws-server em :$CHAT_WS_PORT"
|
||||
node "$CHAT_WS_SCRIPT" &
|
||||
CHAT_WS_PID=$!
|
||||
# Garantir cleanup
|
||||
trap "kill $CHAT_WS_PID 2>/dev/null || true" EXIT
|
||||
else
|
||||
echo "[start-web] chat-ws-server não encontrado em $CHAT_WS_SCRIPT" >&2
|
||||
fi
|
||||
|
||||
echo "[start-web] launching Next.js"
|
||||
PORT=${PORT:-3000}
|
||||
NODE_MAJOR=$(command -v node >/dev/null 2>&1 && node -v | sed -E 's/^v([0-9]+).*/\1/' || echo "")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue