Commit Graph

24 Commits

Author SHA1 Message Date
Robin Choice
e5d0b00761 feat: PWA Phase 2 — push notifications
Add web push notification support: push_subscriptions table (migration
0007), VAPID-based push service, subscribe/unsubscribe API routes, SW
push+notificationclick handlers, and subscribe UI on account page.
Triggers: new version uploaded (all project members) and version
approved/rejected (uploader).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 10:09:22 +02:00
Robin Choice
9bad5c704a chore: session checkpoint 2026-04-16 2026-04-16 22:22:09 +02:00
Robin Choice
e58a7c250e feat: PWA Phase 1 — offline audio download and playback
- API: GET /versions/:id/audio?quality=stream|original (server proxy for SW caching)
- API: GET /versions/:id/waveform-data (server proxy for offline waveform)
- SW: cache-first from musichub-offline-v1 for proxied audio/waveform endpoints
- Client: IDB-backed offline store (idb lib) with progress-tracked download
- UI: per-version offline download button with stream/original quality picker
- UI: /offline page with storage estimate and remove-all action
- Manifest: shortcuts for Dashboard + Offline-Tracks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 22:17:01 +02:00
Robin Choice
e642e63fdc fix: disable SSR for authenticated app pages
WaveSurfer.js accesses window/AudioContext at module load time,
causing SSR to throw undefined on hard reload of track pages.
All (app) routes are auth-gated and fetch data client-side — SSR
provides no benefit here.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 21:17:59 +02:00
Robin Choice
c949d6b829 fix: security hardening and stem multi-select
- Remove public /migrate endpoint (startup migration handles it)
- Add membership + canUpload check to POST /versions/track/:trackId
- Add membership check to stream-url, download-url, waveform endpoints
- Scope member PATCH/DELETE to projectId to prevent cross-project mutation
- Add auth + membership check to POST /comments/:id/resolve
- Add secure: true to session cookie in production
- Hash magic link tokens before storing (was plaintext)
- Return generic error message instead of err.message
- Fix stem multi-file-select: replace hidden attr with CSS offscreen
  (Safari/WebKit drops multiple selection on display:none file inputs)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 21:04:22 +02:00
Robin Choice
afcb818dd4 chore: rename CLAUDE.md to AGENTS.md, add symlink and docs/templates
Adds tool-agnostic AGENTS.md as canonical context file, CLAUDE.md symlink for
Claude Code compatibility, and docs/templates/ with spec.md + adr.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 15:24:02 +02:00
Robin Choice
ccd7ed3a93 refactor: simplify stem code per review
- async zip() instead of zipSync (non-blocking for large files)
- null check for track in DELETE endpoint (was non-null assertion)
- formatFileSize extracted to format.ts, imported in StemList
- Stem type exported from StemList, removed duplicate in +page.svelte
- files[idx].progress = p direct Svelte 5 mutation (no spread)
- remove narrative comments from stems.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 18:44:12 +02:00
Robin Choice
e63dc30a7f fix: remove ContentLength from presigned URL, fix macOS multi-select
- ContentLength in PutObjectCommand causes XHR upload failures (browser
  does not send matching Content-Length header in presigned PUT requests)
- Change accept to audio/* so macOS Finder allows multi-file selection
- Add step prefix to errors ([URL]/[S3]/[DB]) for easier debugging

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 18:30:50 +02:00
Robin Choice
9530add1ff feat: add STEM file support per track
- DB: stems table with trackId FK, fileKey, sortOrder, createdById
- API: GET/POST/DELETE stems, presigned upload URL, ZIP download via fflate
- Web: StemUploadDropzone (multi-file, batch upload, progress bars)
- Web: StemList with download-all-ZIP and per-stem delete
- Web: STEMs tab in track detail view
- Icon: add 'music' icon to inline set
- Auto-migration runs stems table creation on boot

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 18:13:01 +02:00
Robin Choice
df54fde710 Add README 2026-04-13 15:53:54 +02:00
Robin Choice
a0b7473d4e Fix: remove duplicate/corrupt code at end of index.ts 2026-04-13 14:42:15 +02:00
Robin Choice
fc18f43943 chore: trigger redeploy 2026-04-13 14:31:49 +02:00
Robin Choice
ed19987135 Fix: replace broken migrate import with raw SQL migration
Previous commit removed the drizzle-orm/migrator import but left the
function call, causing a crash. Now uses raw SQL execution directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:56:31 +02:00
Robin Choice
8a8d078fa7 Inline raw SQL migration on startup (no drizzle migrator)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:52:24 +02:00
Robin Choice
6971e0782b Change /migrate to GET (Coolify proxy blocks POST on root)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:46:07 +02:00
Robin Choice
41e8124d78 Raw SQL migration endpoint (bypass drizzle schema requirement)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:35:30 +02:00
Robin Choice
e66d8bb490 Add /migrate endpoint for manual trigger
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:27:51 +02:00
Robin Choice
3e65a89fe8 Fix migration path resolution in Docker
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:22:17 +02:00
Robin Choice
b87b1045e5 Auto-migrate on API startup in production
Runs drizzle-kit migrations automatically when NODE_ENV=production,
so deployments don't require manual migration commands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:17:04 +02:00
Robin Choice
e7aa866332 Fix Dockerfiles: include all workspace package.jsons for bun lockfile
The monorepo bun.lock references all workspaces. Previous Dockerfiles
only copied a subset, causing frozen-lockfile install to fail. Now all
package.jsons are copied. Also add curl + healthchecks to both images.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:09:08 +02:00
Robin Choice
09e47d8800 Password auth, artist folders, timezone fix
Add password-based registration + login alongside existing magic links.
New /register and updated /login with tabs (password default, magic link
as alternative). Bun.password.hash/verify for bcrypt. Auto-login on
register. Landing page CTAs point to /register.

Add projects.artist field for grouping projects by artist in sidebar.
Sidebar shows collapsible artist sections (▸ Anna Berger) with project
counts, "Ohne Zuordnung" for ungrouped projects. Search filters across
artist names. New/edit project forms include artist field.

Fix timezone bug: set postgres connection timezone to UTC so magic link
expiry works correctly in CEST and other non-UTC timezones.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 19:06:06 +02:00
Robin Choice
8bf72c2482 Full MVP: workspace layout, visual refresh, PWA, production deploy
Major changes since initial commit:

Schema: version branching (parentVersionId, branchLabel), share links,
guest comments, track status enum (sketch/in_progress/final/released),
track sections, cover art for projects and tracks.

API: 29+ endpoints — auth, projects, tracks, versions, comments, share
links (public + management), uploads (cover), activity feed, onboarding
demo seed. Email templates in German with brand styling.

Web: SvelteKit 5 workspace layout with persistent sidebar, breadcrumb
top-bar, collapsible right panel. SoundCloud-style waveform player with
round play button, avatar comment markers, keyboard shortcuts (Space/JKL/C).
Full German UI. Cover art with gradient fallback. Track status pills.
Activity feed dashboard. Welcome modal with demo-seed trigger. Landing
page with 7-section scroll layout. Login on /login. Public /listen/:token
page for guest feedback.

Visual: Inter Variable font, Magenta→Orange gradient accent, warm dark
neutrals, Lucide-style inline SVG icon set, spring animations on modals,
glass-effect toasts, responsive from 360px to 2560px+.

PWA: manifest, service worker, icons, iOS/Android installable.

Production: adapter-node, server-side API proxy hook, docker-compose with
Postgres + MinIO + auto-migration + health checks. Env example included.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 11:47:48 +02:00
Robin Choice
4dc095463f Phase 1: version branching + public share links
Add parentVersionId/branchLabel to versions, enabling git-style branching.
New /tree and /promote endpoints; VersionGraph (SVG) component as toggle
next to the existing list view. Upload dropzone accepts a parent for branch
uploads.

Add public share links: new share_links table, /api/v1/share router with
authenticated CRUD and a public /public/:token endpoint serving signed
stream/waveform URLs. Comments now allow guests (nullable userId, guestName)
so artists can leave timestamped feedback without an account. New
/listen/:token standalone page with password gate, optional download, and
guest comment form.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 16:31:52 +02:00
Robin Choice
e420ed198b Initial commit: Music Hub collaboration platform
Full-stack music production collaboration tool with:
- SvelteKit frontend with Design System (CSS vars, 8 shared components)
- Hono API with auth, projects, tracks, versions, comments
- PostgreSQL + Drizzle ORM (8 tables, roles, permissions)
- S3-compatible storage with presigned upload URLs
- wavesurfer.js audio player with waveform visualization
- A/B version comparison with synchronized playback
- Timestamped comments with threading and resolve workflow
- Magic Link authentication with Resend email integration
- Background audio processing (ffmpeg transcode + waveform peaks)
- Role-based access control (Owner, Engineers, Artist, Label, Management, Viewer)
- Toast notifications, skeleton loading, responsive layout
- Docker deployment setup (API + Web + Postgres)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 13:23:10 +02:00