Files
live/start.sh
T
admin 2e4594fa77 Initial commit: LiveStream Platform
Backend: FastAPI + SQLAlchemy + SQLite
Frontend: React + Vite + Ant Design (serif Anthropic theme)
Media server: MediaMTX with edge node support
Load balancing: round-robin / weighted / least-conn
Multicast detection with automatic fallback
Transcoding support via FFmpeg (configurable quality)
hls.js player with line & quality switching
Admin panel with password auth
Windows compatible scripts
2026-08-07 15:02:07 +08:00

36 lines
878 B
Bash
Executable File

#!/bin/bash
set -e
BASE="/workspace/livestream-platform"
echo "[livestream] Starting services..."
cd "$BASE/mediamtx"
if pgrep -f "mediamtx mediamtx.yml" > /dev/null; then
echo "[livestream] MediaMTX already running."
else
nohup ./mediamtx mediamtx.yml > /tmp/mediamtx.log 2>&1 &
sleep 2
echo "[livestream] MediaMTX started."
fi
cd "$BASE/backend"
if curl -sf http://127.0.0.1:8080/api/health > /dev/null 2>&1; then
echo "[livestream] Backend already running."
else
nohup ./venv/bin/python run.py > /tmp/backend.log 2>&1 &
sleep 3
echo "[livestream] Backend started on :8080."
fi
cd "$BASE/frontend"
if curl -sf http://127.0.0.1:5173 > /dev/null 2>&1; then
echo "[livestream] Frontend already running."
else
nohup npm run dev > /tmp/frontend.log 2>&1 &
sleep 3
echo "[livestream] Frontend started on :5173."
fi
echo "[livestream] All services up."