Initial commit — BashyOverlay v1

Twitch stream event platform with OBS browser source overlay.

Features:
- Twitch OAuth login (streamer + mod access)
- EventSub WebSocket for subs, gift subs, bits, channel points, follows, raids
- Chat commands via tmi.js in the overlay
- Gap audio — tone plays on new chat message after silence, volume/pitch scale with gap length
- Self-hosted media library (upload sounds and videos)
- Action configuration — map any event to sound, video, or alert
- Per-action cooldowns, test button, enable/disable toggle
- Multiple actions per event (all matching actions fire)
- Activity log dashboard with EventSub connection status
- Layout editor — iframe-based WYSIWYG with drag handles, live style preview
- Custom CSS and custom JS injection into overlay
- Custom DOM events (bashyoverlay:sub, bashyoverlay:raid, etc.) for custom JS hooks
- deploy.sh — one-shot setup and launch script

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Bashy 2026-04-22 23:48:35 +03:00
commit 6ad661c220
37 changed files with 2180 additions and 0 deletions

72
deploy.sh Executable file
View file

@ -0,0 +1,72 @@
#!/usr/bin/env bash
set -euo pipefail
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
info() { echo -e "${GREEN}[BashyOverlay]${NC} $1"; }
warn() { echo -e "${YELLOW}[BashyOverlay]${NC} $1"; }
error() { echo -e "${RED}[BashyOverlay]${NC} $1"; exit 1; }
# ── Python version check ──────────────────────────────────────────────────────
PYTHON=$(command -v python3 || command -v python || error "Python not found")
PY_VER=$($PYTHON -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
PY_MAJOR=$($PYTHON -c 'import sys; print(sys.version_info.major)')
PY_MINOR=$($PYTHON -c 'import sys; print(sys.version_info.minor)')
if [ "$PY_MAJOR" -lt 3 ] || { [ "$PY_MAJOR" -eq 3 ] && [ "$PY_MINOR" -lt 10 ]; }; then
error "Python 3.10+ required (found $PY_VER)"
fi
info "Python $PY_VER OK"
# ── Virtual environment ───────────────────────────────────────────────────────
if [ ! -d ".venv" ]; then
info "Creating virtual environment..."
$PYTHON -m venv .venv
fi
source .venv/bin/activate
info "Virtual environment active"
# ── Dependencies ──────────────────────────────────────────────────────────────
info "Installing dependencies..."
pip install -q --upgrade pip
pip install -q -r requirements.txt
info "Dependencies installed"
# ── .env ──────────────────────────────────────────────────────────────────────
if [ ! -f ".env" ]; then
cp .env.example .env
warn ".env created from .env.example"
warn "Edit .env with your Twitch credentials before continuing."
warn ""
warn " TWITCH_CLIENT_ID and TWITCH_CLIENT_SECRET:"
warn " Register an app at https://dev.twitch.tv/console/apps"
warn " Set OAuth Redirect URL to: http://localhost:8000/auth/callback"
warn ""
echo -n "Have you filled in .env? [y/N] "
read -r answer
if [[ ! "$answer" =~ ^[Yy]$ ]]; then
warn "Edit .env and run deploy.sh again."
exit 0
fi
fi
# ── Media directory ───────────────────────────────────────────────────────────
mkdir -p static/media
info "Media directory ready"
# ── Launch ────────────────────────────────────────────────────────────────────
HOST="${HOST:-0.0.0.0}"
PORT="${PORT:-8000}"
info "Starting BashyOverlay at http://localhost:${PORT}"
info "Open that URL in your browser to log in with Twitch."
info "OBS browser source URL: http://localhost:${PORT}/overlay"
info ""
info "Press Ctrl+C to stop."
echo ""
exec uvicorn app.main:app --host "$HOST" --port "$PORT" --reload