Skip to content

Commit 8af9585

Browse files
committed
feat: rebrand from rag-demo to DocRAG
Replace Nexus Analytics orange theme with DocRAG monochrome + blue accent identity. Update colors, typography (Inter + JetBrains Mono), UI copy, SuperDoc theme, package names, and READMEs to match new brand.md.
1 parent 8a96705 commit 8af9585

17 files changed

Lines changed: 219 additions & 257 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Each demo is a standalone app that showcases a real-world use case: extracting d
66

77
## Demos
88

9-
### [`rag/`](./rag)Document RAG with Citations
9+
### [`rag/`](./rag)DocRAG
1010

11-
Ask questions across multiple `.docx` files. The AI answers with citations that scroll to the exact paragraph, comment, or tracked change in the source document.
11+
Ask your documents. Get cited answers. Upload `.docx` files and get AI-powered answers with citations that scroll to the exact paragraph, comment, or tracked change in the source document.
1212

1313
**Stack**: Cloudflare Workers + R2 + D1 + Vectorize, React, SuperDoc, Claude, OpenAI embeddings
1414

rag/README.md

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# Document RAG with SuperDoc
1+
# DocRAG
22

3-
Ask questions across multiple `.docx` files. Get answers with citations that navigate to the exact paragraph, comment, or tracked change in the source document.
3+
Ask your documents. Get cited answers.
4+
5+
Upload `.docx` files, ask questions in natural language, and get answers with citations that navigate to the exact paragraph, comment, or tracked change in the source document. Powered by [SuperDoc](https://superdoc.dev).
46

57
## How it Works
68

7-
1. **Upload** `.docx` files through the UI or CLI
9+
1. **Upload** `.docx` files through the UI
810
2. **Extract** text, comments, and tracked changes using the [SuperDoc SDK](https://docs.superdoc.dev)
911
3. **Chunk** each paragraph with its stable node ID, embed with OpenAI
1012
4. **Store** chunks in Cloudflare Vectorize, metadata in D1, files in R2
11-
5. **Query**user asks a question, relevant chunks are retrieved via vector search
13+
5. **Query**ask a question, relevant chunks are retrieved via vector search
1214
6. **Answer** — Claude generates a response with `[cite:ID]` references
1315
7. **Navigate** — click a citation to scroll to the source in the SuperDoc viewer
1416

@@ -18,11 +20,10 @@ Ask questions across multiple `.docx` files. Get answers with citations that nav
1820
apps/
1921
api/ Cloudflare Worker — query, documents, file serving
2022
web/ React frontend — document viewer + chat sidebar
21-
ingest/ CLI — extract + embed locally, upload to Worker
2223
ingest-service/ Docker service — automated extraction for VM deployment
2324
packages/
2425
shared/ SuperDoc extraction, chunking, embedding client
25-
docs/ Sample .docx files (fictional "Nexus Analytics" project)
26+
docs/ Sample .docx files
2627
```
2728

2829
## Quick Start
@@ -42,10 +43,10 @@ bun install
4243

4344
# Create Cloudflare resources
4445
cd apps/api
45-
npx wrangler d1 create rag-demo
46+
npx wrangler d1 create docrag
4647
# Copy the database_id into wrangler.toml
4748

48-
npx wrangler d1 execute rag-demo --local --file=schema.sql
49+
npx wrangler d1 execute docrag --local --file=schema.sql
4950
npx wrangler vectorize create rag-chunks --dimensions=1536 --metric=cosine
5051

5152
# Add secrets for local dev
@@ -64,27 +65,10 @@ bun run dev:api
6465

6566
# Terminal 2: Frontend (Vite)
6667
bun run dev:web
67-
68-
# Ingest sample documents
69-
bun ingest docs/nexus-prd.docx
70-
bun ingest docs/nexus-budget.docx
71-
bun ingest docs/nexus-legal-review.docx
72-
bun ingest docs/nexus-meeting-notes.docx
73-
bun ingest docs/nexus-customer-research.docx
7468
```
7569

7670
Open [http://localhost:3000](http://localhost:3000)
7771

78-
### Sample Questions
79-
80-
Try these across the Nexus Analytics documents:
81-
82-
- "What are the biggest risks to the beta launch?"
83-
- "How much will the NLQ feature cost?"
84-
- "What was decided about HIPAA?"
85-
- "What do customers think about anomaly detection?"
86-
- "Who is HealthBridge and why do they matter?"
87-
8872
## Deploy
8973

9074
### Worker + Frontend
@@ -94,7 +78,7 @@ Try these across the Nexus Analytics documents:
9478
cd apps/api
9579
wrangler secret put OPENAI_API_KEY
9680
wrangler secret put ANTHROPIC_API_KEY
97-
wrangler d1 execute rag-demo --remote --file=schema.sql
81+
wrangler d1 execute docrag --remote --file=schema.sql
9882
wrangler deploy
9983

10084
# Deploy frontend to Cloudflare Pages
@@ -107,15 +91,19 @@ bun run deploy:web
10791
For automated ingestion, deploy the Docker service to a VM:
10892

10993
```bash
110-
docker build -f apps/ingest-service/Dockerfile -t rag-ingest .
94+
docker build -f apps/ingest-service/Dockerfile -t docrag-ingest .
11195
docker run -d \
112-
-e API_URL=https://rag-demo-api.<account>.workers.dev \
96+
-e API_URL=https://docrag-api.<account>.workers.dev \
11397
-e OPENAI_API_KEY=sk-... \
11498
-e AUTH_TOKEN=your-shared-secret \
11599
-p 4000:4000 \
116-
rag-ingest
100+
docrag-ingest
117101
```
118102

119103
## License
120104

121105
MIT
106+
107+
---
108+
109+
Built by [SuperDoc](https://superdoc.dev)

rag/apps/api/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"name": "@rag-demo/api",
2+
"name": "@docrag/api",
33
"private": true,
44
"type": "module",
55
"scripts": {
66
"dev": "wrangler dev",
77
"deploy": "wrangler deploy",
8-
"db:create": "wrangler d1 create rag-demo",
9-
"db:migrate": "wrangler d1 execute rag-demo --file=schema.sql"
8+
"db:create": "wrangler d1 create docrag",
9+
"db:migrate": "wrangler d1 execute docrag --file=schema.sql"
1010
},
1111
"dependencies": {
1212
"@anthropic-ai/sdk": "^0.30.0",
13-
"@rag-demo/shared": "workspace:*"
13+
"@docrag/shared": "workspace:*"
1414
},
1515
"devDependencies": {
1616
"@cloudflare/workers-types": "^4.20250326.0",

rag/apps/api/wrangler.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = "rag-demo-api"
1+
name = "docrag-api"
22
main = "src/worker.ts"
33
compatibility_date = "2026-03-26"
44
compatibility_flags = ["nodejs_compat"]

rag/apps/ingest-service/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
buildChunks,
66
createEmbeddingClient,
77
extractDocument,
8-
} from "@rag-demo/shared";
8+
} from "@docrag/shared";
99

1010
const PORT = Number(process.env.PORT ?? 4000);
1111
const API_URL = process.env.API_URL;
@@ -18,7 +18,7 @@ if (!OPENAI_KEY) {
1818
}
1919
if (!API_URL) {
2020
console.error(
21-
"Missing API_URL (e.g. https://rag-demo-api.<account>.workers.dev)",
21+
"Missing API_URL (e.g. https://docrag-api.<account>.workers.dev)",
2222
);
2323
process.exit(1);
2424
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "@rag-demo/ingest-service",
2+
"name": "@docrag/ingest-service",
33
"private": true,
44
"type": "module",
55
"scripts": {
66
"start": "bun run index.ts",
77
"dev": "bun --hot index.ts"
88
},
99
"dependencies": {
10-
"@rag-demo/shared": "workspace:*",
10+
"@docrag/shared": "workspace:*",
1111
"@superdoc-dev/cli": "latest"
1212
}
1313
}

rag/apps/web/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ function App() {
3333
<div className="app">
3434
<header className="topbar">
3535
<div className="topbar-logo">
36-
<div className="topbar-mark">N</div>
36+
<div className="topbar-mark">D</div>
3737
<span className="topbar-name">
38-
Nexus Analytics{" "}
38+
DocRAG{" "}
3939
<span className="topbar-by">
4040
by{" "}
4141
<a

rag/apps/web/components/ChatMessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function ChatMessage({
2222
onCitationClick,
2323
}: Props) {
2424
if (loading) {
25-
return <div className="message message-loading">Analyzing documents</div>;
25+
return <div className="message message-loading">Searching documents</div>;
2626
}
2727
if (role === "user") {
2828
return <div className="message message-user">{content}</div>;

rag/apps/web/components/ChatPanel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ export function ChatPanel({ onCitationClick }: Props) {
8181
<div className="chat-body">
8282
{messages.length === 0 && (
8383
<div className="chat-empty">
84-
<span className="chat-empty-title">Ask a question</span>
84+
<span className="chat-empty-title">Ask your documents</span>
8585
<span className="chat-empty-hint">
86-
SuperDoc extracts text, comments, and tracked changes for
87-
AI-powered search.
86+
Get cited answers from paragraphs, comments, and tracked changes.
87+
Click a citation to see the source.
8888
</span>
8989
</div>
9090
)}

rag/apps/web/components/DocumentViewer.tsx

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,29 @@ import { useEffect, useRef, useState } from "react";
22
import { createTheme, SuperDoc } from "superdoc";
33
import "superdoc/style.css";
44

5-
// Nexus Analytics brand theme for the SuperDoc editor
6-
const nexusTheme = createTheme({
7-
name: "nexus",
8-
font: "'DM Sans', 'Inter', sans-serif",
5+
const docragTheme = createTheme({
6+
name: "docrag",
7+
font: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif",
98
colors: {
10-
action: "#E67E22",
11-
actionHover: "#D35400",
9+
action: "#0070F3",
10+
actionHover: "#005CC5",
1211
actionText: "#FFFFFF",
1312
bg: "#FFFFFF",
14-
text: "#1E293B",
15-
textMuted: "#64748B",
16-
border: "#E2E8F0",
13+
text: "#000000",
14+
textMuted: "#888888",
15+
border: "#E5E5E5",
1716
},
1817
vars: {
19-
// Comment card styling — override computed vars directly
20-
"--sd-ui-comments-card-bg": "#FEF7ED",
21-
"--sd-ui-comments-card-hover-bg": "#FEF0DB",
18+
"--sd-ui-comments-card-bg": "#F0F7FF",
19+
"--sd-ui-comments-card-hover-bg": "#E0EFFF",
2220
"--sd-ui-comments-card-active-bg": "#FFFFFF",
23-
"--sd-ui-comments-card-active-border": "#E67E22",
24-
"--sd-ui-comments-card-shadow": "0px 4px 12px 0px rgba(230, 126, 34, 0.12)",
25-
// Comment text highlights in the document
26-
"--sd-comments-highlight-external": "#E67E2240",
27-
"--sd-comments-highlight-external-active": "#E67E2266",
28-
"--sd-comments-highlight-external-faded": "#E67E2220",
29-
"--sd-comments-highlight-hover": "#E67E2255",
30-
"--sd-comments-selection-background": "#E67E2255",
21+
"--sd-ui-comments-card-active-border": "#0070F3",
22+
"--sd-ui-comments-card-shadow": "0px 4px 12px 0px rgba(0, 112, 243, 0.12)",
23+
"--sd-comments-highlight-external": "#0070F340",
24+
"--sd-comments-highlight-external-active": "#0070F366",
25+
"--sd-comments-highlight-external-faded": "#0070F320",
26+
"--sd-comments-highlight-hover": "#0070F355",
27+
"--sd-comments-selection-background": "#0070F355",
3128
},
3229
});
3330

@@ -66,7 +63,7 @@ export function DocumentViewer({ documentId, citation, filename }: Props) {
6663
if (!docFile || !containerRef.current) return;
6764

6865
superdocRef.current?.destroy();
69-
containerRef.current.classList.add(nexusTheme);
66+
containerRef.current.classList.add(docragTheme);
7067
superdocRef.current = new SuperDoc({
7168
selector: containerRef.current,
7269
document: docFile,

0 commit comments

Comments
 (0)