Skip to content

Add /videos gallery + per-domain mp4 reel uploads - #10

Merged
ralyodio merged 1 commit into
masterfrom
feat/video-uploads
Jul 10, 2026
Merged

Add /videos gallery + per-domain mp4 reel uploads#10
ralyodio merged 1 commit into
masterfrom
feat/video-uploads

Conversation

@ralyodio

Copy link
Copy Markdown
Collaborator

What

Adds video support to moshcoding:

  • Public /videos gallery — a sibling of /badges. Shows the brand promo reels (now served from public/videos/) plus any reels uploaded to the main moshcoding.com gallery. Linked from the nav + landing media-kit CTA.
  • Uploads from the dashboard — a new Videos tab lets a page owner upload mp4 reels per parked domain (mirrors the Waitlist/Auctions/Webhooks per-domain tabs). Admins can also populate the public moshcoding.com gallery.

How it works

  • Storage reuses the existing DATA_DIR Railway-volume pattern (the same volume genart caches hero images on): the reel bytes live on the volume (lib/media.ts), the metadata in a new Turso media table (lib/db.ts).
  • Files stream through GET /api/media/[id] with HTTP range support (206 Partial Content) so <video> can seek/scrub.
  • Upload (POST /api/media) and delete (DELETE /api/media/[id]) are gated to the domain owner (or admin) via a shared resolveAccountId helper extracted into lib/api.ts (the account route now reuses it instead of its private copy).
  • Limits: mp4/webm/mov only, 100 MB cap (MEDIA_MAX_BYTES).

⚠️ Deploy note

Uploaded reels persist only if a Railway volume is mounted at DATA_DIR — same requirement as the cached generated images. Without a volume, uploads are lost on redeploy (built-in brand reels are unaffected — they ship in the image). .env.example documents this.

Verified

Built bun run build clean, then ran the full flow against a local libSQL DB + forged admin session:

  • upload → 201, list → shows it, full stream → 200, range bytes=0-99 → 206 content-range: bytes 0-99/2048, unauth upload → 401, wrong type → 400, delete → ok + file removed from disk, /videos renders all 4 built-in reels.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

Public /videos page (sibling of /badges) shows a curated pair of brand reels
(served from public/videos) plus any uploaded moshcoding.com reels. Page owners
upload their own mp4 reels per parked domain from a new dashboard "Videos" tab.

Storage reuses the existing DATA_DIR Railway-volume pattern (same volume genart
caches images on): reel bytes live on the volume, metadata in a new Turso
`media` table. Files stream through /api/media/[id] with HTTP range support so
<video> can seek. Upload/delete are gated to the domain owner (or admin) via a
shared session->account resolver extracted to lib/api.

- lib/media.ts: volume storage (mp4/webm/mov, 100MB cap)
- media table + CRUD in lib/db.ts
- /api/media (POST upload, GET list) + /api/media/[id] (GET range-stream, DELETE)
- app/videos public gallery; dashboard Videos tab
- Nav + landing + README links

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ralyodio
ralyodio force-pushed the feat/video-uploads branch from caf177d to e445277 Compare July 10, 2026 11:10
@ralyodio
ralyodio merged commit e46d444 into master Jul 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant