Build frontend with Vite instead of Nextjs - #233
Merged
Conversation
isakstenstrom
marked this pull request as draft
April 21, 2026 15:16
This was referenced Apr 22, 2026
Merged
isakstenstrom
force-pushed
the
frontend-vite
branch
from
April 29, 2026 06:29
ac7ef78 to
ec3d96f
Compare
isakstenstrom
marked this pull request as ready for review
April 29, 2026 14:19
meroton-benjamin
approved these changes
May 4, 2026
We use nothing of the server side features of Nextjs. Instead of a server side rendered app, we can build a static site with Vite. This allows us to simplify the deployment process as we don't need to run a separate container for the frontend. We can also use the same configuration file as the backend to configure the frontend, inserting the config into the `index.html` on the fly every time it is served.
The frontend is now a static SPA. This makes it possible to embed the frontend build in the backend binary. This makes it possible to deploy bb-portal with a single binary.
isakstenstrom
force-pushed
the
frontend-vite
branch
from
May 4, 2026 11:43
ec3d96f to
71c5058
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
NOTE: This is a stacked PR. Please merge #226, #227, #228, #229, #230, #231, #232 first.
This PR removes Next.js from the frontend, instead building the frontend with Vite, using Tanstack Router for routing. We can do this since we use nothing of the server side features of Next.js. With this change we simplify the architecture, and it allows us to deploy it as a static SPA instead of an entire docker image for the frontend. We can also use the same configuration file as the backend to configure the frontend, inserting the config into the index.html on the fly every time it is served.
The static SPA files are embedded in the go binary when building (in production) and it serves the frontend, thus reducing the number of docker images to 1. Note that this new combined image has a new name (bb-portal), and does not use the old name of the backend.
Related discussion: #219
Closes #24, #219