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:
39
api/src/rehearsalhub/storage/protocol.py
Normal file
39
api/src/rehearsalhub/storage/protocol.py
Normal file
@@ -0,0 +1,39 @@
|
||||
"""Storage abstraction. Default impl is Nextcloud/WebDAV; swap for S3, local FS, etc."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Protocol
|
||||
|
||||
|
||||
class FileMetadata:
|
||||
def __init__(self, path: str, etag: str, size: int, content_type: str) -> None:
|
||||
self.path = path
|
||||
self.etag = etag
|
||||
self.size = size
|
||||
self.content_type = content_type
|
||||
|
||||
|
||||
class StorageClient(Protocol):
|
||||
async def create_folder(self, path: str) -> None:
|
||||
"""Create a folder (and parents) at the given path."""
|
||||
...
|
||||
|
||||
async def get_file_metadata(self, path: str) -> FileMetadata:
|
||||
"""Return metadata for the file at path."""
|
||||
...
|
||||
|
||||
async def list_folder(self, path: str) -> list[FileMetadata]:
|
||||
"""List immediate children of the folder at path."""
|
||||
...
|
||||
|
||||
async def download(self, path: str) -> bytes:
|
||||
"""Download and return the raw bytes of the file at path."""
|
||||
...
|
||||
|
||||
async def get_direct_url(self, path: str) -> str:
|
||||
"""Return a URL for direct access to the file (used for HLS streaming)."""
|
||||
...
|
||||
|
||||
async def delete(self, path: str) -> None:
|
||||
"""Delete a file or folder at path."""
|
||||
...
|
||||
Reference in New Issue
Block a user