Skip to content

Commit c340021

Browse files
fix page
1 parent 9eb79da commit c340021

6 files changed

Lines changed: 985 additions & 67 deletions

File tree

‎app/components/Markdown.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,25 +90,25 @@ function getMarkdownComponents() {
9090
</h4>
9191
),
9292

93-
// Unordered lists with blue round bullets
94-
ul: ({ depth, ...props }: any) => (
93+
// Unordered lists with consistent nested indentation
94+
ul: ({ ...props }: any) => (
9595
<ul
96-
className={depth > 0 ? "ml-6 space-y-2 text-gray-300 mb-4 list-disc list-inside" : "space-y-2 text-gray-300 mb-4 list-disc list-inside"}
96+
className="mb-4 list-disc space-y-2 pl-6 text-gray-300 [&_ul]:mb-0 [&_ul]:mt-2 [&_ul]:list-[circle] [&_ul]:pl-6 [&_ol]:mb-0 [&_ol]:mt-2 [&_ol]:pl-6"
9797
{...props}
9898
/>
9999
),
100100

101-
// Ordered lists with blue numbers
101+
// Ordered lists with consistent nested indentation
102102
ol: ({ ...props }) => (
103103
<ol
104-
className="space-y-2 text-gray-300 mb-4 list-decimal list-inside"
104+
className="mb-4 list-decimal space-y-2 pl-6 text-gray-300 [&_ul]:mb-0 [&_ul]:mt-2 [&_ul]:pl-6 [&_ol]:mb-0 [&_ol]:mt-2 [&_ol]:pl-6"
105105
{...props}
106106
/>
107107
),
108108

109109
// List items
110110
li: ({ ...props }) => (
111-
<li className="marker:text-blue-400 marker:mr-3 marker:flex-shrink-0 [&>p]:m-0 [&>p]:inline" {...props} />
111+
<li className="leading-relaxed marker:text-blue-400 [&>p]:m-0 [&>p]:inline [&>ul]:mb-0 [&>ul]:mt-2 [&>ol]:mb-0 [&>ol]:mt-2" {...props} />
112112
),
113113

114114
// Inline code

‎app/data/samples.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
import { Sample } from '../types/Sample';
44

55
export const samples: Sample[] = [
6+
{
7+
id: 'personal-memory-mcp-ts',
8+
title: 'Personal AI Memory: Cross-Platform MCP Server with DocumentDB Vector Search',
9+
description: 'A TypeScript MCP server that gives any AI assistant — Copilot CLI, Claude, Gemini — persistent personalized memory backed by DocumentDB. Uses a 4-layer retrieval strategy: cosmosSearch vector similarity, full-text search indexes, array tag queries, and regex fallback. Demonstrates DocumentDB\'s vector search (pgvector), MongoDB wire protocol compatibility, text indexes, atomic update operators, and flexible document schema in a practical AI application.',
10+
language: 'TypeScript',
11+
industry: 'AI/ML',
12+
difficulty: 'Intermediate',
13+
tags: ['MCP', 'AI Memory', 'Vector Search', 'Full-Text Search', 'Text Index', 'Express', 'RAG', 'DocumentDB OSS', 'Open Source'],
14+
githubUrl: 'https://github.com/documentdb/documentdb-samples-gallery/tree/main/personal-memory-mcp-ts',
15+
},
616
{
717
id: 'hotel-agent-ts',
818
title: 'Hotel Recommendation Agent: RAG with Native Vector Search and LLM Synthesizer in TypeScript',
@@ -66,11 +76,11 @@ export const samples: Sample[] = [
6676
{
6777
id: 'activity-log-fastapi-py',
6878
title: 'Activity Log & Notification Service: Real-Time Event Ingestion with FastAPI, Beanie, and DocumentDB',
69-
description: 'A production-style async Python backend that ingests high-volume activity events via FastAPI, stores them in DocumentDB using the Beanie ODM over Motor, and exposes endpoints to query recent activities, compute server-side aggregation statistics ($facet pipeline), and stream real-time ERROR alerts to clients over WebSockets.',
79+
description: 'A production-style async Python backend that ingests high-volume activity events via FastAPI, stores them in DocumentDB using the Beanie ODM (backed by PyMongo async), and exposes endpoints to query recent activities, compute server-side aggregation statistics ($facet pipeline), and stream real-time ERROR alerts to clients over WebSockets.',
7080
language: 'Python',
7181
industry: 'DevOps / Observability',
7282
difficulty: 'Intermediate',
73-
tags: ['FastAPI', 'Beanie', 'Motor', 'REST API', 'WebSocket', 'Aggregation', 'DocumentDB OSS', 'Open Source'],
83+
tags: ['FastAPI', 'Beanie', 'PyMongo', 'REST API', 'WebSocket', 'Aggregation', 'DocumentDB OSS', 'Open Source'],
7484
githubUrl: 'https://github.com/documentdb/documentdb-samples-gallery/tree/main/activity-log-fastapi-py',
7585
}
7686
];

‎app/docs/[section]/[[...slug]]/page.tsx‎

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,16 @@ export async function generateMetadata({ params }: PageProps) {
5050

5151
export default async function ArticlePage({ params }: PageProps) {
5252
const { section, slug = [] } = await params;
53+
const currentSlug = slug[slug.length - 1];
5354

54-
if (section === 'getting-started' && slug[slug.length - 1] === 'prebuilt-packages') {
55+
if (section === 'getting-started' && currentSlug === 'prebuilt-packages') {
5556
redirect('/docs/getting-started/packages');
5657
}
5758

59+
if (section === 'getting-started' && currentSlug === 'vscode-extension-guide') {
60+
redirect('/docs/getting-started/vscode-quickstart');
61+
}
62+
5863
const articleData = getArticleByPath(section, slug);
5964

6065
if (!articleData) {
@@ -153,14 +158,31 @@ export default async function ArticlePage({ params }: PageProps) {
153158

154159
{showInstallPrimer && (
155160
<section className="mb-8 rounded-xl border border-blue-500/30 bg-blue-500/5 p-5">
156-
<h2 className="text-xl font-semibold text-white">Install DocumentDB first</h2>
161+
<h2 className="text-xl font-semibold text-white">Install and verify DocumentDB</h2>
157162
<p className="mt-2 text-sm text-gray-300">
158-
Start with Docker for the fastest setup, or choose Linux packages for persistent servers.
163+
Start with Docker for the fastest setup, or choose Linux packages for persistent servers. Then verify the connection with mongosh before moving to a driver quick start.
159164
</p>
160165
<div className="mt-4 grid gap-4 lg:grid-cols-2">
161166
<div className="rounded-lg border border-neutral-700 bg-neutral-900/60 p-4">
162167
<p className="mb-3 text-sm font-semibold text-white">Quick run with Docker</p>
163168
<CommandSnippet command={dockerQuickRunCommand} label="Docker" />
169+
<div className="mt-4 flex flex-wrap gap-3">
170+
<Link
171+
href="/docs/getting-started/mongo-shell-quickstart"
172+
className="inline-flex items-center justify-center rounded-md border border-neutral-600 px-4 py-2 text-sm font-semibold text-gray-200 transition-colors hover:border-neutral-500 hover:bg-neutral-800"
173+
>
174+
Mongo Shell Quick Start
175+
</Link>
176+
<Link
177+
href="/docs/getting-started/mongo-shell-quickstart"
178+
className="inline-flex items-center justify-center rounded-md bg-blue-500 px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-blue-400"
179+
>
180+
Mongo Shell Quick Start
181+
</Link>
182+
</div>
183+
<p className="mt-3 text-sm text-gray-400">
184+
Recommended first path: Docker -&gt; Mongo Shell Quick Start -&gt; Node.js Quick Start or Python Quick Start.
185+
</p>
164186
</div>
165187
<div className="rounded-lg border border-neutral-700 bg-neutral-900/60 p-4">
166188
<p className="text-sm font-semibold text-white">Install from Linux packages</p>
@@ -172,7 +194,7 @@ export default async function ArticlePage({ params }: PageProps) {
172194
href="/docs/getting-started/docker"
173195
className="inline-flex items-center justify-center rounded-md border border-neutral-600 px-4 py-2 text-sm font-semibold text-gray-200 transition-colors hover:border-neutral-500 hover:bg-neutral-800"
174196
>
175-
Docker guide
197+
Docker Quick Start
176198
</Link>
177199
<Link
178200
href="/packages"
@@ -184,7 +206,7 @@ export default async function ArticlePage({ params }: PageProps) {
184206
href="/docs/getting-started/packages"
185207
className="inline-flex items-center justify-center rounded-md border border-neutral-600 px-4 py-2 text-sm font-semibold text-gray-200 transition-colors hover:border-neutral-500 hover:bg-neutral-800"
186208
>
187-
Linux packages docs
209+
Linux Packages Quick Start
188210
</Link>
189211
</div>
190212
</div>

‎app/lib/packageInstall.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ echo "deb [signed-by=/usr/share/keyrings/postgresql.gpg] https://apt.postgresql.
5353
curl -fsSL https://documentdb.io/documentdb-archive-keyring.gpg | sudo gpg --dearmor --yes -o /usr/share/keyrings/documentdb-archive-keyring.gpg && \\
5454
echo "deb [arch=${aptArch} signed-by=/usr/share/keyrings/documentdb-archive-keyring.gpg] https://documentdb.io/deb stable ${aptTarget}" | sudo tee /etc/apt/sources.list.d/documentdb.list >/dev/null && \\
5555
sudo apt update && \\
56-
sudo apt install -y postgresql-${aptPgVersion}-documentdb`;
56+
sudo apt install -y postgresql-${aptPgVersion}-documentdb documentdb_gateway`;
5757
}
5858

5959
export function buildRpmInstallCommand(
@@ -78,5 +78,5 @@ printf '%s\\n' \\
7878
'enabled=1' \\
7979
'gpgcheck=1' \\
8080
'gpgkey=https://documentdb.io/documentdb-archive-keyring.gpg' | sudo tee /etc/yum.repos.d/documentdb.repo >/dev/null && \\
81-
sudo dnf install -y postgresql${rpmPgVersion}-documentdb`;
81+
sudo dnf install -y postgresql${rpmPgVersion}-documentdb documentdb-gateway`;
8282
}

‎app/packages/page.tsx‎

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ const nextGuides = [
3333
href: "/docs/getting-started",
3434
},
3535
{
36-
title: "Python",
36+
title: "Python Quick Start",
3737
description: "Install PyMongo and connect to your local DocumentDB instance.",
3838
href: "/docs/getting-started/python-setup",
3939
},
4040
{
41-
title: "Node.js",
41+
title: "Node.js Quick Start",
4242
description: "Use the Node.js driver and run your first queries locally.",
4343
href: "/docs/getting-started/nodejs-setup",
4444
},
4545
{
46-
title: "VS Code",
46+
title: "Visual Studio Code Quick Start",
4747
description: "Connect through the VS Code extension for a guided local workflow.",
4848
href: "/docs/getting-started/vscode-quickstart",
4949
},
@@ -70,13 +70,19 @@ export default function PackagesPage() {
7070

7171
const aptCommand = buildAptInstallCommand(aptTarget, aptArch, aptPgVersion);
7272
const rpmCommand = buildRpmInstallCommand(rpmTarget, rpmArch, rpmPgVersion);
73-
const selectedPackageName =
73+
const selectedPackageNames =
7474
packageFamily === "apt"
75-
? `postgresql-${aptPgVersion}-documentdb`
76-
: `postgresql${rpmPgVersion}-documentdb`;
75+
? `postgresql-${aptPgVersion}-documentdb + documentdb_gateway`
76+
: `postgresql${rpmPgVersion}-documentdb + documentdb-gateway`;
7777
const selectedTargetText =
7878
packageFamily === "apt" ? aptTargetLabels[aptTarget] : rpmTargetLabels[rpmTarget];
7979
const selectedArchText = packageFamily === "apt" ? aptArch : rpmArch;
80+
const selectedPgVersion = packageFamily === "apt" ? aptPgVersion : rpmPgVersion;
81+
const setupCommand = `sudo documentdb-setup \\
82+
--username <YOUR_USERNAME> \\
83+
--password <YOUR_PASSWORD> \\
84+
--pg-version ${selectedPgVersion} \\
85+
--load-sample-data`;
8086

8187
return (
8288
<div className="min-h-screen bg-neutral-900 py-12">
@@ -87,8 +93,8 @@ export default function PackagesPage() {
8793
</h1>
8894
<p className="mx-auto max-w-3xl text-lg text-gray-300">
8995
Choose Docker for the fastest local setup, or Linux packages for managed host
90-
installations. The generated package commands also configure the PostgreSQL
91-
dependency repositories required by DocumentDB.
96+
installations. The generated package commands configure the PostgreSQL
97+
dependency repositories and install the packages required by DocumentDB.
9298
</p>
9399
<div className="mt-4 flex flex-wrap justify-center gap-3 text-sm">
94100
<span className="rounded-full border border-green-500/30 bg-green-500/20 px-3 py-1 text-green-300">
@@ -151,7 +157,7 @@ export default function PackagesPage() {
151157
href="/docs/getting-started/docker"
152158
className="inline-flex items-center justify-center rounded-md border border-blue-400 bg-blue-500/10 px-4 py-2 text-sm font-semibold text-blue-200 transition-colors hover:bg-blue-500/20"
153159
>
154-
Open Docker quick start →
160+
Open Docker Quick Start →
155161
</Link>
156162
</div>
157163
</>
@@ -267,15 +273,30 @@ export default function PackagesPage() {
267273
label={packageFamily === "apt" ? "APT" : "RPM"}
268274
/>
269275
<p className="mt-3 text-sm text-gray-400">
270-
Target: {selectedTargetText} · Architecture: {selectedArchText} · package name{" "}
271-
<code className="text-gray-300">{selectedPackageName}</code>
276+
Target: {selectedTargetText} · Architecture: {selectedArchText} · package names{" "}
277+
<code className="text-gray-300">{selectedPackageNames}</code>
272278
</p>
273279
<p className="mt-2 text-sm text-gray-400">
274280
The generated command adds the PostgreSQL upstream repositories that provide
275281
PostgreSQL, <code className="text-gray-300">pg_cron</code>,{" "}
276282
<code className="text-gray-300">pgvector</code>, PostGIS, and{" "}
277283
<code className="text-gray-300">rum</code>.
278284
</p>
285+
<p className="mt-2 text-sm text-gray-400">
286+
It also installs the PostgreSQL extension package plus the gateway package
287+
required for MongoDB-compatible connections on port 10260.
288+
</p>
289+
<div className="mt-4 rounded-lg border border-neutral-700 bg-neutral-900/60 p-4">
290+
<p className="mb-3 text-sm font-semibold text-white">
291+
Then initialize and start DocumentDB
292+
</p>
293+
<CommandSnippet command={setupCommand} label="Setup" />
294+
<p className="mt-3 text-sm text-gray-400">
295+
Use <code className="text-gray-300">--skip-pg-init</code> and{" "}
296+
<code className="text-gray-300">--pg-port</code> if you want to attach
297+
DocumentDB to an existing PostgreSQL cluster instead of creating a new one.
298+
</p>
299+
</div>
279300
{packageFamily === "apt" ? (
280301
<p className="mt-2 text-sm text-amber-300">
281302
Debian 13 is now supported in the APT repository-backed install flow. Debian
@@ -435,12 +456,19 @@ export default function PackagesPage() {
435456
<div className="rounded-md border border-neutral-700 bg-black p-3">
436457
<code className="text-xs text-green-400 sm:text-sm">
437458
sudo apt update && apt search documentdb && apt-cache policy
438-
postgresql-16-documentdb
459+
postgresql-16-documentdb documentdb_gateway
460+
</code>
461+
</div>
462+
<div className="rounded-md border border-neutral-700 bg-black p-3">
463+
<code className="text-xs text-green-400 sm:text-sm">
464+
sudo dnf clean all && dnf search documentdb && rpm -qi
465+
postgresql16-documentdb documentdb-gateway
439466
</code>
440467
</div>
441468
<div className="rounded-md border border-neutral-700 bg-black p-3">
442469
<code className="text-xs text-green-400 sm:text-sm">
443-
sudo dnf clean all && dnf search documentdb && rpm -qi postgresql16-documentdb
470+
sudo systemctl status documentdb-gateway --no-pager && sudo journalctl -u
471+
documentdb-gateway --no-pager -n 20
444472
</code>
445473
</div>
446474
</div>
@@ -453,8 +481,9 @@ export default function PackagesPage() {
453481
3. Connect and try it
454482
</h2>
455483
<p className="text-sm leading-6 text-gray-400">
456-
Once DocumentDB is running, use port 10260 and follow one of these guides to make
457-
your first connection.
484+
After you run <code className="text-gray-300">documentdb-setup</code> and the
485+
gateway is listening on port 10260, follow one of these guides to make your first
486+
connection.
458487
</p>
459488
</div>
460489

0 commit comments

Comments
 (0)