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

View File

@@ -0,0 +1,54 @@
from __future__ import annotations
import uuid
from sqlalchemy import select
from sqlalchemy.orm import selectinload
from rehearsalhub.db.models import AudioVersion
from rehearsalhub.repositories.base import BaseRepository
class AudioVersionRepository(BaseRepository[AudioVersion]):
model = AudioVersion
async def get_by_etag(self, nc_file_etag: str) -> AudioVersion | None:
stmt = select(AudioVersion).where(AudioVersion.nc_file_etag == nc_file_etag)
result = await self.session.execute(stmt)
return result.scalar_one_or_none()
async def list_for_song(self, song_id: uuid.UUID) -> list[AudioVersion]:
stmt = (
select(AudioVersion)
.where(AudioVersion.song_id == song_id)
.order_by(AudioVersion.version_number.desc())
)
result = await self.session.execute(stmt)
return list(result.scalars().all())
async def get_latest_for_song(self, song_id: uuid.UUID) -> AudioVersion | None:
stmt = (
select(AudioVersion)
.where(AudioVersion.song_id == song_id)
.order_by(AudioVersion.version_number.desc())
.limit(1)
)
result = await self.session.execute(stmt)
return result.scalar_one_or_none()
async def get_with_annotations(self, version_id: uuid.UUID) -> AudioVersion | None:
from rehearsalhub.db.models import Annotation, RangeAnalysis
stmt = (
select(AudioVersion)
.options(
selectinload(AudioVersion.annotations).selectinload(
Annotation.range_analysis
),
selectinload(AudioVersion.annotations).selectinload(Annotation.reactions),
selectinload(AudioVersion.annotations).selectinload(Annotation.author),
)
.where(AudioVersion.id == version_id)
)
result = await self.session.execute(stmt)
return result.scalar_one_or_none()