Port frontend from Astro to Vite + React Router SPA #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates the frontend from Astro to a Vite + React Router single-page application (SPA). This change is required because Discord Activities require SPAs for proper functionality.
Key changes:
.astrofiles) to React page componentsMiniRouter,RoomLoaderAutomatic,AdminRoomEditPage) and replace with React Router equivalents/assetsinstead of/_astro) and serveindex.htmlfor all frontend routes (SPA fallback)Updates since last revision
app.all("/assets/:unused", proxyDownstream)which was incorrectly proxying frontend assets to Broadcast Box instead of serving them from the static foldernpm ci --only=productiontonpm cifor frontend so vite (a devDependency) is available during build.dockerignoreto excludenode_modulesanddistfolders, ensuring reproducible Docker builds across environmentslocation.hrefwith React Router navigation inDiscordMagicRedirect.jsx,DiscordRoomRedirector.jsx, andutils.jsto ensure Discord Activities won't kill the app due to top-level navigation. ThecheckChannelRoomAssociationfunction now accepts an optionalnavigateFncallback parameter.Review & Testing Checklist for Human
.discordsays.com). Specifically verify that navigating between routes does NOT cause a full page reload.docker compose buildworks from a clean checkout./room/{roomId}and verify video streaming works.index.htmlas other routes. Verify basic auth still protects the admin API endpoints and the UI works.?fullscreen=1to a room URL and verify the fullscreen styling applies correctly.Recommended Test Plan
docker compose build && docker compose up/,/room,/room/{id},/discord,/admin,/admin/room/{id}Local Testing Screenshots
Notes
/publish/:keyroute still useslocation.hrefintentionally since it proxies to Broadcast Box and won't be used in Discord Activities