Skip to content

Build frontend with Vite instead of Nextjs - #233

Merged
isakstenstrom merged 2 commits into
buildbarn:mainfrom
meroton:frontend-vite
May 4, 2026
Merged

Build frontend with Vite instead of Nextjs#233
isakstenstrom merged 2 commits into
buildbarn:mainfrom
meroton:frontend-vite

Conversation

@isakstenstrom

Copy link
Copy Markdown
Collaborator

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

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
isakstenstrom merged commit 92cd7ec into buildbarn:main May 4, 2026
5 checks passed
@isakstenstrom
isakstenstrom deleted the frontend-vite branch May 4, 2026 11:54
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.

build frontend with bazel

2 participants