Skip to content

Commit 4d69f5e

Browse files
author
Jackson Yu
authored
Merge pull request #4 from jacksonyzj/feat/marg-frontend
feat: add marg docs-assistant frontend
2 parents 9dcacf1 + 7fef1a7 commit 4d69f5e

27 files changed

Lines changed: 3143 additions & 0 deletions
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy marg-frontend to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'marg-frontend/**'
8+
9+
# Allow manual trigger from the Actions tab
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
working-directory: marg-frontend
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: oven-sh/setup-bun@v2
26+
with:
27+
bun-version: latest
28+
29+
- name: Install dependencies
30+
run: bun install --frozen-lockfile
31+
32+
- name: Build
33+
run: bun run build
34+
env:
35+
# Repo variable to rotate the client ID without a code change; falls back if unset.
36+
VITE_CLIENT_ID: ${{ vars.VITE_CLIENT_ID }}
37+
38+
- name: Deploy to gh-pages
39+
uses: peaceiris/actions-gh-pages@v4
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
publish_dir: marg-frontend/dist
43+
destination_dir: marg-frontend
44+
keep_files: true

marg-frontend/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules/
2+
dist/
3+
.vite/
4+
.DS_Store
5+
6+
# env files
7+
.env
8+
.env.local
9+
.env.*.local
10+
11+
# logs
12+
*.log

marg-frontend/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# marg-frontend
2+
3+
Claude.ai-inspired chat UI for the **marg** Botpress docs assistant. Light-first,
4+
Inter Variable, generous whitespace, max-width centered content. Assistant
5+
messages have **no bubble** (text on the page background); user messages get a
6+
soft pill. Single elevated composer at the bottom.
7+
8+
Built to embed as an `<iframe>` on the docs site.
9+
10+
## Stack
11+
12+
- Vite + React 19 + TypeScript
13+
- `@botpress/webchat` (talks to the `marg` bot via `CLIENT_ID`)
14+
- Tailwind CSS v4 with HSL-based light/dark tokens
15+
- Inter Variable (self-hosted via `@fontsource-variable/inter`)
16+
- `react-markdown` + `remark-gfm` for assistant message rendering
17+
- `lucide-react` icons
18+
19+
The bot's answers already include their **References** list as inline markdown,
20+
so the frontend renders message text as-is (no separate citations footer).
21+
22+
## Setup
23+
24+
Set `CLIENT_ID` in `src/config/constants.ts` to the marg bot's webchat client ID
25+
(install the webchat integration on the bot and deploy to obtain it).
26+
27+
## Develop
28+
29+
```bash
30+
bun install
31+
bun run dev # → http://localhost:5176/docs-bot/marg-frontend/
32+
```
33+
34+
## Build & deploy
35+
36+
```bash
37+
bun run deploy # → https://botpress.github.io/docs-bot/marg-frontend/
38+
```

marg-frontend/bun.lock

Lines changed: 1072 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

marg-frontend/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Botpress docs assistant</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/src/main.tsx"></script>
11+
</body>
12+
</html>

marg-frontend/package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "marg-frontend",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vite build",
9+
"preview": "vite preview",
10+
"predeploy": "bun run build",
11+
"deploy": "gh-pages -d dist -e marg-frontend"
12+
},
13+
"dependencies": {
14+
"@botpress/webchat": "^4.0.3",
15+
"@fontsource-variable/inter": "^5.2.8",
16+
"clsx": "^2.1.1",
17+
"lucide-react": "^0.469.0",
18+
"react": "^19.2.0",
19+
"react-dom": "^19.2.0",
20+
"react-markdown": "^9.1.0",
21+
"remark-gfm": "^4.0.0",
22+
"tailwind-merge": "^2.6.0"
23+
},
24+
"devDependencies": {
25+
"@tailwindcss/postcss": "^4.0.0",
26+
"@types/luxon": "^3.7.1",
27+
"@types/react": "^19.2.5",
28+
"@types/react-dom": "^19.2.3",
29+
"@vitejs/plugin-react": "^5.1.1",
30+
"autoprefixer": "^10.4.20",
31+
"gh-pages": "^6.3.0",
32+
"postcss": "^8.5.0",
33+
"tailwindcss": "^4.0.0",
34+
"typescript": "~5.9.3",
35+
"vite": "^7.2.4"
36+
}
37+
}

marg-frontend/postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
'@tailwindcss/postcss': {},
4+
autoprefixer: {},
5+
},
6+
}

0 commit comments

Comments
 (0)