You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5.**App titles + favicons**: edit `services/frontend/apps/*/index.html` and `services/frontend/apps/*/public/favicon.ico`
24
+
25
+
## How Configuration Works (Build-Time vs Runtime)
26
+
27
+
Vite apps are **static builds**. By default, all `VITE_*` variables are read at **build time** and baked into the built JS/CSS.
28
+
29
+
This repository also supports **runtime overrides** in container deployments:
30
+
31
+
-`services/frontend/.env.production` contains placeholder values like `VITE_BOT_NAME=VITE_BOT_NAME`
32
+
-`services/frontend/env.sh` replaces those placeholder strings inside built `*.js`/`*.css` files at startup
33
+
34
+
That replacement only happens if you **run `env.sh` against the directory that nginx serves** (default: `/usr/share/nginx/html`).
35
+
36
+
| Scenario | Where to set `VITE_BOT_NAME`| When it takes effect |
37
+
|---|---|---|
38
+
| Local dev (`npm run chat:serve`) |`services/frontend/.env.development` (or `.env.development.local`) | on server restart |
39
+
| Static hosting (S3, nginx without `env.sh`) | build environment or `services/frontend/.env.production` with real values | at build time |
40
+
| Docker/Kubernetes (with `env.sh`) | container env vars + `env.sh` run at startup (in `infrastructure/rag/values.yaml` set `frontend.envs.vite.VITE_BOT_NAME`) | at container startup |
41
+
15
42
## Configuration Options
16
43
17
44
### Environment Variables
18
45
19
-
All customization is done through environment variables that can be set at build time or runtime:
46
+
UI rebranding uses `VITE_*`environment variables (see “Build-Time vs Runtime” above):
20
47
21
48
| Variable | Description | Default Value | Example |
|`VITE_BOT_NAME`| The AI assistant's display name | "Knowledge Agent" | "DocBot" |
24
51
|`VITE_UI_LOGO_PATH`| Common path to the main navigation logo (fallback for both light/dark) | "/assets/navigation-logo.svg" | "/assets/my-logo.png" |
25
52
|`VITE_UI_LOGO_PATH_LIGHT`| Path to logo used in light mode (falls back to `VITE_UI_LOGO_PATH`) | — | "/assets/logo-light.svg" |
26
53
|`VITE_UI_LOGO_PATH_DARK`| Path to logo used in dark mode (falls back to `VITE_UI_LOGO_PATH`) | — | "/assets/logo-dark.svg" |
27
-
|`VITE_UI_THEME_DEFAULT`| Default theme when user first visits | "light" | "dark" |
28
-
|`VITE_UI_THEME_OPTIONS`| Available theme options (comma-separated) | "light,dark" | "light,dark,auto" |
29
-
30
-
### Bot Name Customization
31
-
32
-
The bot name appears in the initial welcome message in the chat interface.
33
-
34
-
**Default Message:**
54
+
|`VITE_UI_THEME_DEFAULT`| Default theme when user first visits | "dark" | "light" |
55
+
|`VITE_UI_THEME_OPTIONS`| Available theme options (comma-separated) | "light,dark" | "light" |
35
56
36
-
```text
37
-
Hi 👋, I'm your AI Assistant Knowledge Agent, here to support you with any questions regarding the provided documents!
38
-
```
57
+
### Bot Name & Welcome Message
39
58
40
-
**Setting Custom Bot Name:**
59
+
The bot name is read from `VITE_BOT_NAME` (see `services/frontend/libs/shared/settings.ts`) and is used in:
41
60
42
-
1.**Development Environment:**
61
+
- the sender name for assistant chat bubbles (`services/frontend/libs/chat-app/ui/ChatMessages.vue`)
62
+
- the first “welcome” message when a chat session starts (`services/frontend/libs/chat-app/data-access/+state/chat.store.ts`)
43
63
44
-
```bash
45
-
# In your .env file
46
-
VITE_BOT_NAME=DocBot
47
-
```
64
+
#### Change the bot name
48
65
49
-
2.**Docker/Production:**
66
+
-**Local development**: set `VITE_BOT_NAME` in `services/frontend/.env.development` (or create `services/frontend/.env.development.local`) and restart `npm run chat:serve`.
67
+
-**Build-time (no runtime injection)**: set `VITE_BOT_NAME` in your environment before building (for example `VITE_BOT_NAME="Acme Assistant" npm -C services/frontend run chat:build`).
68
+
-**Runtime (Docker/Kubernetes)**: set `VITE_BOT_NAME` in the container environment and ensure `services/frontend/env.sh` runs (see “Docker Deployment” / “Kubernetes/Helm Deployment” below).
50
69
51
-
```bash
52
-
# Environment variable
53
-
export VITE_BOT_NAME="Your Custom Bot Name"
54
-
```
70
+
#### Change the welcome message text
55
71
56
-
3.**Kubernetes/Helm:**
72
+
Edit the translation string and keep `{bot_name}` for interpolation:
57
73
58
-
```yaml
59
-
# In your values.yaml or deployment
60
-
env:
61
-
- name: VITE_BOT_NAME
62
-
value: "Corporate Knowledge Assistant"
63
-
```
74
+
Files:
75
+
-`services/frontend/libs/i18n/chat/en.json`
76
+
-`services/frontend/libs/i18n/chat/de.json`
64
77
65
78
### Logo Customization
66
79
@@ -93,8 +106,8 @@ The logo appears in the navigation header of both chat and admin applications. Y
93
106
94
107
**Fallback order:**
95
108
96
-
- Light: `VITE_UI_LOGO_PATH_LIGHT` → `VITE_UI_LOGO_PATH` → `/assets/navigation-logo.svg` (default asset exists in both apps: [chat](../services/frontend/apps/chat-app/public/assets/navigation-logo.svg), [admin](../services/frontend/apps/admin-app/public/assets/navigation-logo.svg))
97
-
- Dark: `VITE_UI_LOGO_PATH_DARK` → `VITE_UI_LOGO_PATH` → `/assets/navigation-logo.svg` (default asset exists in both apps: [chat](../services/frontend/apps/chat-app/public/assets/navigation-logo.svg), [admin](../services/frontend/apps/admin-app/public/assets/navigation-logo.svg))
109
+
- Light: `VITE_UI_LOGO_PATH_LIGHT` → `VITE_UI_LOGO_PATH` → `/assets/navigation-logo-light.svg` (default asset exists in both apps: [chat](../services/frontend/apps/chat-app/public/assets/navigation-logo-light.svg), [admin](../services/frontend/apps/admin-app/public/assets/navigation-logo-light.svg))
110
+
- Dark: `VITE_UI_LOGO_PATH_DARK` → `VITE_UI_LOGO_PATH` → `/assets/navigation-logo-dark.svg` (default asset exists in both apps: [chat](../services/frontend/apps/chat-app/public/assets/navigation-logo-dark.svg), [admin](../services/frontend/apps/admin-app/public/assets/navigation-logo-dark.svg))
The frontend uses Tailwind v4 with daisyUI v5. In the following, we describe how to customize the theme using central CSS (recommended for brand colors shared by both apps):
-`--base-200-highlight` (highlight “jump to source” anchors)
172
+
125
173
Theme behavior:
126
174
127
-
- Default theme and options are set by env vars: `VITE_UI_THEME_DEFAULT`, `VITE_UI_THEME_OPTIONS`
128
-
- The selected theme is stored in `localStorage` under `app-theme`
129
-
- Theme switching updates `html[data-theme]` so daisyUI variables apply
175
+
1.**Set Default Theme:**
176
+
177
+
```bash
178
+
# Users will see dark mode by default
179
+
VITE_UI_THEME_DEFAULT=dark
180
+
```
181
+
182
+
1.**Configure Available Options:**
183
+
184
+
```bash
185
+
# Only allow light mode (remove theme toggle)
186
+
VITE_UI_THEME_OPTIONS=light
187
+
188
+
# Support both themes (default)
189
+
VITE_UI_THEME_OPTIONS=light,dark
190
+
```
191
+
192
+
**Theme Behavior:**
193
+
194
+
- Theme preference is saved in browser's localStorage
195
+
- Theme persists across browser sessions
196
+
- The built-in theme toggle is shown only when both `light` and `dark` are available
197
+
- Manual theme switching overrides the default setting
198
+
- Theme selection is stored under `localStorage["app-theme"]` and applied via `html[data-theme]`
199
+
200
+
### Markdown / Chat Content Styling
201
+
202
+
Chat answers, user prompts, and citations are rendered from Markdown via `marked` (see `services/frontend/libs/shared/utils/src/lib/marked.utils.ts`) and styled via global CSS in `services/frontend/libs/shared/global.css`.
203
+
204
+
Rebrandable bits:
205
+
206
+
- Code blocks: `--chat-code-*` variables and `.chat-code-block*` styles
207
+
- Typography: `.prose` overrides keep headings/links readable across themes
130
208
131
209
## Development Setup
132
210
133
211
### Local Development
134
212
135
-
1.**Create/modify `.env` file in frontend directory** (services/frontend/.env):
213
+
Vite reads env files from `services/frontend/`. Common ones:
To use runtime variables in Docker, you must ensure the container runs:
172
257
173
-
1.**The env.sh script automatically replaces variables** in built JS/CSS files when the container starts. See [services/frontend/env.sh](../services/frontend/env.sh).
before nginx serves the files (otherwise placeholders like `VITE_BOT_NAME` will remain).
263
+
264
+
See `services/frontend/env.sh` for details, including `TARGET_DIR` override.
174
265
175
266
### Kubernetes/Helm Deployment
176
267
177
-
1.**Configure in your Helm values.yaml** (example chart values at [infrastructure/rag/values.yaml](../infrastructure/rag/values.yaml)):
268
+
The Helm chart wires env vars via `frontend.envs.vite` into a ConfigMap and mounts a writable `/usr/share/nginx/html`. It also runs the copy + `env.sh` step (see `infrastructure/rag/templates/frontend/deployment.yaml`).
269
+
270
+
1.**Configure in your Helm `values.yaml`** (example values at [infrastructure/rag/values.yaml](../infrastructure/rag/values.yaml)):
@@ -203,23 +297,12 @@ For Docker deployments, the frontend uses a special script (services/frontend/en
203
297
204
298
### Adding Custom Themes
205
299
206
-
To add themes beyond light/dark, update both the settings and the theme source:
300
+
This repo is optimized for `light`/`dark` theming. You can still add a custom theme, but note:
207
301
208
-
1. **Update the settings configuration** in [services/frontend/libs/shared/settings.ts](../services/frontend/libs/shared/settings.ts):
302
+
- The built-in UI toggle only switches between `light` and `dark` (`services/frontend/libs/shared/ui/ThemeToggle.vue`).
303
+
- If you want a custom theme without adding a theme picker, set `VITE_UI_THEME_OPTIONS` to a single theme and the toggle will disappear.
209
304
210
-
```typescript
211
-
// frontend/libs/shared/settings.ts
212
-
const defaultSettings: AppSettings = {
213
-
ui: {
214
-
theme: {
215
-
default: "light",
216
-
options: ["light", "dark", "brand-red"], // Add your theme
217
-
},
218
-
},
219
-
};
220
-
```
221
-
222
-
2. Define the theme either e.g. in CSS (recommended for shared branding):
305
+
To add a custom theme, define it in `services/frontend/libs/ui-styles/src/tailwind.css`:
223
306
224
307
CSS (Tailwind v4):
225
308
@@ -232,6 +315,13 @@ CSS (Tailwind v4):
232
315
}
233
316
```
234
317
318
+
Then select it via env vars:
319
+
320
+
```bash
321
+
VITE_UI_THEME_DEFAULT=brand-red
322
+
VITE_UI_THEME_OPTIONS=brand-red
323
+
```
324
+
235
325
### Internationalization
236
326
237
327
Bot names and messages support internationalization:
@@ -263,9 +353,12 @@ Bot names and messages support internationalization:
263
353
264
354
### Bot Name Not Updating
265
355
266
-
-**Issue**: Bot name shows as `{bot_name}` instead of actual name
267
-
-**Cause**: Vue computed property not accessed correctly
268
-
-**Solution**: Use `initialMessage.value` instead of `initialMessage` in the store
356
+
- **Issue**: Bot name stays at the default or shows a placeholder value (e.g. `VITE_BOT_NAME`)
357
+
- **Cause**: Runtime env replacement did not run (Vite env vars are build-time by default)
358
+
- **Solutions**:
359
+
- Ensure `services/frontend/.env.production` contains placeholders for the variables you want to replace (this repo includes `VITE_BOT_NAME`, `VITE_UI_*`, etc.)
360
+
- Ensure the container runs `env.sh` after copying the built files into `/usr/share/nginx/html`
361
+
- Verify the variable is set in the container environment (Kubernetes `ConfigMap`/`Secret`, Docker `-e`, etc.)
269
362
270
363
### Logo Not Loading / Wrong for Theme
271
364
@@ -291,6 +384,7 @@ Bot names and messages support internationalization:
291
384
- **Issue**: Customization works in development but not production
292
385
- **Cause**: Vite environment variables are build-time only
293
386
- **Solutions**:
387
+
- Ensure the variables exist as placeholders at build time (see `services/frontend/.env.production`)
294
388
- For Docker: Ensure `env.sh` script runs after copying files
295
389
- For Kubernetes: Use ConfigMap/Secret with proper mounting
296
390
- Verify environment variables are set in container
Copy file name to clipboardExpand all lines: infrastructure/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -257,6 +257,8 @@ frontend:
257
257
258
258
The following values should be adjusted for the deployment:
259
259
260
+
> ⓘ INFO: If the backend pod gets `OOMKilled` (exit code `137`) on local k3d/Tilt setups, reduce `backend.workers` (each uvicorn worker is a separate Python process), disable reranking `RERANKER_ENABLED: false` or pin a smaller Flashrank model (e.g. `RERANKER_MODEL: ms-marco-TinyBERT-L-2-v2`), and/or increase the memory available to Docker/k3d.
0 commit comments