feat(desktop): add Electron app and desktop builds #84

Open
joshuafhiggins wants to merge 7 commits from t3/electron-eac3-atmos-support into main
pull from: t3/electron-eac3-atmos-support
Owner

oTunes needs a desktop client for Windows and Linux, and later macOS.

The web UI now also builds as a Next.js static export (pnpm --filter @otunes/web build:export). In-app links use ?id= routes; share links keep /album/<id> and their link previews on the server build. Server-only files (route handlers, the proxy, share pages) use a .server.ts(x) suffix that exports leave out.

The export picks its server at /server, keeps the session in localStorage (per server, like mobile), and loads covers, avatars, streams and downloads from the selected server. Stream and download requests pass the session token as a token query parameter, since <audio> and native HLS cannot send headers. The song and download routes accept it alongside the cookie, and /api responses allow any origin. The downloads service worker matches downloaded covers from any origin, and exports skip its offline page caching since they are served locally.

Electron serves the export from 127.0.0.1:47836, with no bundled Node.js server or media gateway. A manual/tag-triggered Gitea workflow builds Windows NSIS installers and Linux Flatpaks for x64 and ARM64 in electronuserland/builder:wine. The same export is ready to ship in a macOS Tauri app.

Sign-up now checks the account-creation setting in the browser and shows a notice when it is disabled.

Verified locally: both web builds; the Electron file server (routes, host check, path traversal); in headless Chrome against the test server, server selection, sign-in, home with remote covers, album navigation and reload, and stream URLs carrying the token. Not verified: actual playback and downloads, because the test server needs this branch deployed for the token parameter and CORS; installed apps; the ARM64 Flatpak. The Linux job needs privileged containers on the runner.

Created with GPT-6.1 Sol in T3 Code through the Codex harness. Follow-ups by Claude Opus 5.5 in T3 Code through the Claude Code harness.

🤖 Generated with Claude Code

oTunes needs a desktop client for Windows and Linux, and later macOS. The web UI now also builds as a Next.js static export (`pnpm --filter @otunes/web build:export`). In-app links use `?id=` routes; share links keep `/album/<id>` and their link previews on the server build. Server-only files (route handlers, the proxy, share pages) use a `.server.ts(x)` suffix that exports leave out. The export picks its server at `/server`, keeps the session in localStorage (per server, like mobile), and loads covers, avatars, streams and downloads from the selected server. Stream and download requests pass the session token as a `token` query parameter, since `<audio>` and native HLS cannot send headers. The song and download routes accept it alongside the cookie, and `/api` responses allow any origin. The downloads service worker matches downloaded covers from any origin, and exports skip its offline page caching since they are served locally. Electron serves the export from `127.0.0.1:47836`, with no bundled Node.js server or media gateway. A manual/tag-triggered Gitea workflow builds Windows NSIS installers and Linux Flatpaks for x64 and ARM64 in `electronuserland/builder:wine`. The same export is ready to ship in a macOS Tauri app. Sign-up now checks the account-creation setting in the browser and shows a notice when it is disabled. Verified locally: both web builds; the Electron file server (routes, host check, path traversal); in headless Chrome against the test server, server selection, sign-in, home with remote covers, album navigation and reload, and stream URLs carrying the token. Not verified: actual playback and downloads, because the test server needs this branch deployed for the token parameter and CORS; installed apps; the ARM64 Flatpak. The Linux job needs privileged containers on the runner. Created with GPT-6.1 Sol in T3 Code through the Codex harness. Follow-ups by Claude Opus 5.5 in T3 Code through the Claude Code harness. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
joshuafhiggins force-pushed t3/electron-eac3-atmos-support from 52b896dc21 to a6751f586d 2026-11-18 15:03:22 -05:00 Compare
joshuafhiggins added 7 commits 2026-11-20 00:19:19 -05:00
Avatar requests now go to the selected server, since the bundled UI
strips sharp. Windows and Linux runners build both architectures, so
three machines cover all five targets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the custom EAC-3 Chromium build and macOS packaging. Windows NSIS
installers and Flatpaks for x64 and ARM64 now build in one Linux
container image.

Packaged installers previously lost the bundled Next.js dependencies:
electron-builder drops the pnpm store and NSIS cannot carry symlinks.
The bundle now replaces pnpm links with nested real copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In-app links move to /album?id=, /artist?id= and /playlist?id= so every
page can prerender. Server-only files use a .server.ts(x) suffix that
`pnpm build:export` leaves out: route handlers, the proxy, the desktop
server picker, and the /album/<id> share pages with link-preview metadata.
Exports use client-only Convex Auth and redirect in the browser.

Sign-up now checks the setting in the browser. The sign-in link always
shows, and a disabled server replaces the sign-up form with a notice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The static export now works away from the oTunes server. It picks a
server at /server (saved in localStorage), connects Convex to it, and
loads covers, avatars and streams from it. Streams and avatars pass the
session token as a `token` query parameter, which the song and avatar
routes accept alongside the cookie. The server allows any origin on /api.

Electron serves that export from 127.0.0.1:47836 and drops the bundled
Next.js server, the media gateway, symlink materializing and Sharp
pruning. The same export can ship in a Tauri app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's download routes are server-only like the other API routes. They
take the session from a `token` parameter, the options POST is allowed
cross-origin, and the client fetches songs and covers from the picked
server. The service worker matches downloaded covers from any origin,
and skips offline page caching in exports since they are served locally.
pnpm 12 fails on ignored build scripts, so electron-winstaller's is
denied explicitly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
joshuafhiggins force-pushed t3/electron-eac3-atmos-support from 7c37174e4b to 37d1195955 2026-11-20 00:19:19 -05:00 Compare
This pull request has changes conflicting with the target branch.
  • pnpm-lock.yaml
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin t3/electron-eac3-atmos-support:t3/electron-eac3-atmos-support
git checkout t3/electron-eac3-atmos-support
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joshuafhiggins/otunes#84