Skip to content

feat: migrate frontend to React components - #1

Merged
RedDTG merged 2 commits into
RedDTG:mainfrom
tonyctalope:feat/nextjs-frontend-migration
Jun 17, 2026
Merged

feat: migrate frontend to React components#1
RedDTG merged 2 commits into
RedDTG:mainfrom
tonyctalope:feat/nextjs-frontend-migration

Conversation

@tonyctalope

Copy link
Copy Markdown
Contributor

Summary

  • Replace the vanilla JS bundle (public/app.js) that the three route shells loaded with proper React client components rendered through Next.js. The CSS, DOM structure, and runtime behavior (WebSocket state sync, audio playback, visualizer broadcast/draw, artwork-derived primary color) are preserved so the UI stays strictly identical.
  • New shared lib under src/lib/ for types, constants, helpers, the Shell wrapper, the queue list, and the useJamState / usePrimaryArtworkColor hooks. Each page now owns its state, refs, and effects directly.
  • Move public/styles.css to src/app/globals.css and import it from page-shell so the Next.js CSS pipeline handles hashing, minification and injection (the <link rel="stylesheet" href="/assets/styles.css"> tag is gone). public/ is kept (via .gitkeep) so the Docker COPY public ./public step still finds the directory.
  • src/server.ts is untouched: the custom HTTP server still owns the WebSocket upgrade, the REST API, the /media/* Range streaming and the yt-dlp pipeline.

Test plan

  • npm run build — Next compiles, tsc -p tsconfig.server.json is clean
  • npm start then open /admin, /client, /visualizer — visuals are byte-identical with main
  • On /client: search via iTunes, add a track to the queue, watch the queue appear on /admin and /visualizer via WS
  • On /admin: Lancer / Arreter, Passer, Vider la file, Retirer — all hit the existing API endpoints
  • Audio playback on /admin autoplays once the user has interacted; the autoplay hint shows up if the browser blocks the first start; the visualizer levels propagate to /visualizer
  • docker compose up --build -d — the image still builds and runs with the same volume mounts and env vars

🤖 Generated with Claude Code

tonyctalope and others added 2 commits May 19, 2026 12:17
Replace the vanilla JS bundle that the three route shells used to load
with proper React client components rendered through Next.js. The
existing CSS, DOM structure, and behavior (WebSocket state sync, audio
playback, visualizer broadcast/draw, artwork-derived primary color) are
preserved as-is so the UI stays strictly identical.

- Shared lib under src/lib for types, constants, helpers, the Shell
  wrapper, the queue list, and the useJamState / usePrimaryArtworkColor
  hooks
- Page components now own their state, refs, and effects instead of
  injecting /assets/app.js
- Drop public/app.js and the HomeJamPage helper

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Move public/styles.css to src/app/globals.css and import it from
page-shell so the Next.js CSS pipeline handles hashing, minification,
and injection. Keep public/ around (via .gitkeep) so the Dockerfile
COPY step still finds the directory.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@RedDTG
RedDTG merged commit 6294cdc into RedDTG:main Jun 17, 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.

2 participants