Initial commit: RehearsalHub POC

Full-stack self-hosted band rehearsal platform:

Backend (FastAPI + SQLAlchemy 2.0 async):
- Auth with JWT (register, login, /me, settings)
- Band management with Nextcloud folder integration
- Song management with audio version tracking
- Nextcloud scan to auto-import audio files
- Band membership with link-based invite system
- Song comments
- Audio analysis worker (BPM, key, loudness, waveform)
- Nextcloud activity watcher for auto-import
- WebSocket support for real-time annotation updates
- Alembic migrations (0001–0003)
- Repository pattern, Ruff + mypy configured

Frontend (React 18 + Vite + TypeScript strict):
- Login/register page with post-login redirect
- Home page with band list and creation form
- Band page with member panel, invite link, song list, NC scan
- Song page with waveform player, annotations, comment thread
- Settings page for per-user Nextcloud credentials
- Invite acceptance page (/invite/:token)
- ESLint v9 flat config + TypeScript strict mode

Infrastructure:
- Docker Compose: PostgreSQL, Redis, API, worker, watcher, nginx
- nginx reverse proxy for static files + /api/ proxy
- make check runs all linters before docker compose build

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Steffen Schuhmann
2026-03-28 21:53:03 +01:00
commit f7be1b994d
139 changed files with 12743 additions and 0 deletions

75
Makefile Normal file
View File

@@ -0,0 +1,75 @@
.PHONY: up down build logs migrate seed test test-api test-worker test-watcher lint check format
up:
docker compose up -d
down:
docker compose down
build: check
docker compose build
logs:
docker compose logs -f
# ── Database ──────────────────────────────────────────────────────────────────
migrate:
docker compose exec api alembic upgrade head
migrate-auto:
docker compose exec api alembic revision --autogenerate -m "$(m)"
# ── Setup ─────────────────────────────────────────────────────────────────────
setup: up
@echo "Waiting for Nextcloud to initialize (this can take ~60s)..."
@sleep 60
bash scripts/nc-setup.sh
bash scripts/seed.sh
# ── Testing ───────────────────────────────────────────────────────────────────
test: test-api test-worker test-watcher
test-api:
cd api && uv run pytest tests/ -v --cov=src/rehearsalhub --cov-report=term-missing
test-worker:
cd worker && uv run pytest tests/ -v --cov=src/worker --cov-report=term-missing
test-watcher:
cd watcher && uv run pytest tests/ -v --cov=src/watcher --cov-report=term-missing
test-integration:
cd api && uv run pytest tests/integration/ -v -m integration
# ── Linting & type checking ───────────────────────────────────────────────────
# check: run all linters + type checkers locally (fast, no Docker)
check: lint typecheck-web
lint:
cd api && uv run ruff check src/ tests/ && uv run mypy src/
cd worker && uv run ruff check src/ tests/
cd watcher && uv run ruff check src/ tests/
cd web && npm run lint
typecheck-web:
cd web && npm run typecheck
format:
cd api && uv run ruff format src/ tests/
cd worker && uv run ruff format src/ tests/
cd watcher && uv run ruff format src/ tests/
# ── Dev helpers ───────────────────────────────────────────────────────────────
shell-api:
docker compose exec api bash
shell-db:
docker compose exec db psql -U $${POSTGRES_USER} -d $${POSTGRES_DB}
shell-redis:
docker compose exec redis redis-cli