// CONTENTS Part 06 · Apps and UI

// PART 06

UI server, suite shell, theme, and i18n

Chapter 28 / 56 2 min read English Part 06 of 14

botui is the static front-end server: three site trees (suite on 3000, cloud on 4000, login on 5000) served from botui/ui/, with botserver supplying APIs and HTMX fragments behind them. Changes to HTML/JS/CSS need no recompilation — refresh the page; only Rust changes in botui/src/ need cargo build -p botui.

Suite app structure

The three sites

Port Tree Serves Never serves
3000 botui/ui/suite/ chat, apps, desktop shell /cloud/*
4000 botui/ui/cloud/ store, dashboard, plans, offers /login, /signup (307 → 5000)
5000 botui/ui/login/ login, signup application pages

GB_LOGIN_URL (from the LOGIN_URL env var, default http://localhost:5000) is injected into suite and cloud pages so the front end can redirect to the login site without hardcoding it.

The desktop shell

suite/desktop.html bootstraps the workspace: window manager, taskbar, app tiles, security context. Suite apps are HTMX fragments loaded into that shell (hx-get partials); opening an app HTML directly breaks it, which is why deep links always go through desktop routes (/drive, /chat/<bot>).

Module pattern for app code (botui/ui/suite/<app>/modules/):

<app>.html          # loads plain <script> files in order
modules/
├── 01_state.js     # config, state, constants
├── 02_render.js    # rendering
├── 03_events.js    # event handlers
└── 99_init.js      # only the init() call

Plain scripts (not ES modules), globally visible via load order, each file under 450 lines and starting with "use strict";, named {order}_{firstFunctionName}.js.

Design system

DESIGN-SYSTEM.md at the repository root is the mandatory standard for every UI (suite, cloud, login, assistant, splash, desktop):

  • All colors, spacing, radii, shadows, motion and typography come from the --id-* identity tokens in botui/ui/suite/identity/tokens.css.
  • The default theme (suite/public/themes/default.css) is identical to the design system; other themes vary only the accent color — never layout or component look.
  • Local fonts only (identity/fonts.css), inline local icons, no CDN links.
  • --id-focus is a box-shadow token used as box-shadow, not an outline color.

i18n

No user-facing string is hardcoded. HTML uses data-i18n (plus data-i18n-placeholder, -title, -aria-label); JS uses gbT("key", "English fallback"). Every new or changed key must be added to all locale catalogs — botlib/locales/{en,it,ru,pt-BR,es,fr,de,ja,ko,zh-CN}/*.ftl, one .ftl per feature topic. Inventing auto-* keys (machine-generated, uncatalogued) is forbidden, and status regions need role="status" aria-live="polite".

What botserver contributes to the UI

Surface Endpoint family
HTMX fragments /api/ui/*, /cloud/partials/*
Product/profile GET /api/product (.product values)
App catalog + installs /api/apps/*
WebSocket /ws (chat, office events)

botserver never returns a complete HTML page — if you find yourself writing one in a route handler, it belongs in botui/ui/ instead.

Testing the UI

All web-facing verification is browser-based (Chrome CDP); opening apps inside the desktop shell is mandatory — a direct app URL renders a broken shell and proves nothing. Screenshots go to /tmp/, never the repository.

Found a mistake? Open an issue · All books

// SEARCH ESC
Pagefind · 236 pages · 4 books Enter to open ↑ ↓ to move