Frontend Architecture (Builder & Client)
Relevant source files
The following files were used as context for generating this wiki page:
The Budibase frontend architecture is a modern, Svelte-based system housed within a Lerna monorepo. It is primarily composed of two distinct applications: the @budibase/builder, which is the visual development environment for creating applications, and the @budibase/client, which is the runtime that renders the final, published applications. These are supported by shared libraries like @budibase/bbui for UI components and @budibase/frontend-core for common logic.
This architecture separates the concerns of app creation from app execution. The builder produces a JSON definition of an application, which the client then interprets to render a live, single-page application. This allows for a powerful, developer-friendly build experience while ensuring the final user-facing apps are performant and lightweight.
Monorepo Package Structure
The Budibase project is a monorepo managed by Lerna, with all packages located in the packages/ directory. The frontend is composed of several key browser-focused packages.
Sources: AGENTS.md:4-10, README.md:162-164
The following diagram illustrates the high-level dependency relationships between the main frontend packages.
Key Frontend Packages
| Package | Description |
|---|---|
@budibase/builder | A Svelte application that provides the visual interface for building Budibase applications. |
@budibase/client | A Svelte-based runtime module that reads a JSON definition and renders a live, single-page web application from it. |
@budibase/bbui | A shared UI component library built with Svelte, used across both the builder and client to ensure a consistent look and feel. |
@budibase/frontend-core | Contains core frontend libraries, utilities, and logic shared between the builder and client applications. |
@budibase/shared-core | A package containing code that can be shared between both NodeJS backend and browser frontend packages. |
Sources: README.md:162-170, AGENTS.md:4-10, packages/bbui/README.md:3, packages/frontend-core/package.json:4
Core Technologies & Build Process
The frontend stack is primarily built on Svelte and TypeScript. The build process for the various packages is orchestrated using Vite, a modern frontend build tool.
Build Tools
- Lerna: Manages the monorepo, handling dependencies and running scripts across packages.
- Vite: Used as the primary build tool for the
@budibase/builder,@budibase/client, and@budibase/bbuipackages. It provides a fast development server and optimized production builds. - Routify: Used in the
@budibase/builderpackage for file-based routing.
Sources: README.md:162, packages/builder/package.json:10,12, packages/client/package.json:24, packages/bbui/package.json:13
High-Level Application Flow
The core concept of Budibase is the separation of the building and running of an application.
This diagram shows how the developer uses the builder to create a JSON definition, which is then fetched and rendered by the client for the end user.
Sources: README.md:164-166
Package Details
@budibase/builder
This is the Svelte application that developers use to build apps. It is configured to use Vite for development and building.
- Framework: Svelte
- Build Tool: Vite
- Routing:
@roxi/routify - Key Dependencies:
@budibase/bbui: For UI components.@budibase/frontend-core: For shared logic.@xyflow/svelte: For creating flow-based UIs, such as the Role Editor.codemirror: For code and JSON editing capabilities.svelte-dnd-action: For drag-and-drop functionality.
Sources: packages/builder/package.json:10-13, 52-73, packages/builder/src/components/backend/RoleEditor/RoleFlow.svelte:5-8
@budibase/client
This package is the runtime engine for all published Budibase applications. It is a lightweight Svelte module responsible for interpreting the app's JSON definition and rendering the interactive UI.
- Framework: Svelte
- Build Tool: Vite
- Key Dependencies:
@budibase/bbui: For UI components.apexcharts: For data visualization and charts.leaflet: For map components.html5-qrcode: For QR code scanning functionality.svelte-spa-router: For client-side routing within the published app.
Sources: README.md:164-166, packages/client/package.json:10, 24, 28-41
@budibase/bbui
This is the central UI component library for Budibase, ensuring a consistent user experience. It is built with Svelte and Vite and packaged for use in other frontend projects.
- Purpose: Provides common Svelte components for all Budibase frontend projects.
- Technology: Svelte, Vite.
- Styling: Relies heavily on Adobe's Spectrum CSS design system, importing various
@spectrum-css/*packages for base styling of components like buttons, dialogs, tables, and more. - Development: Uses
vite build --watchfor development.
The following diagram shows how bbui consumes Spectrum CSS components.
@budibase/frontend-core
This package serves as a shared library for non-UI logic, utilities, and state management helpers that are used by both the @budibase/builder and @budibase/client.
- Purpose: Share core frontend logic.
- Key Dependencies:
@budibase/shared-core: For logic shared with the backend.socket.io-client: For real-time communication.dayjs: For date/time manipulation.lodash: For utility functions.
Sources: packages/frontend-core/package.json:4, 13-20, AGENTS.md:7
Maintenance Mode
The frontend architecture includes a mechanism for displaying maintenance screens to both administrators in the builder and end-users in the client.
- Builder Maintenance: If a maintenance requirement is detected (e.g.,
SQS_MISSING), the builder will render a specific page (packages/builder/src/pages/builder/maintenance/index.svelte) that provides detailed information and a link to migration guides for the administrator. - Client Maintenance: In the same scenario, the published app (client) will display a more generic maintenance screen (
packages/client/src/components/MaintenanceScreen.svelte), informing the user that the installation requires attention from an administrator.
This ensures that critical infrastructure issues are communicated clearly without exposing technical details to end-users.
Sources: packages/builder/src/pages/builder/maintenance/index.svelte:15-30, packages/client/src/components/MaintenanceScreen.svelte:13-24