Skip to content

Commit c29cb76

Browse files
authored
Hoist the GitHub stats into one shared constant (#134)
The star and fork counts were hardcoded independently in app/page.tsx and app/ai/page.tsx with no shared constant, so they drifted: the homepage said 3.2k+ stars and 200+ forks while /ai said 3.4k+ and 240+. Both sections render adjacent copy about the project being built in the open, so a visitor moving between the two pages saw two different star counts. Neither figure was false - the + suffix covers the actual 3423 stars and 248 forks - but nothing stopped the next refresh from updating one page and leaving the other behind, which is exactly what happened when the AI page was refreshed in #121. Both pages now read from app/services/projectStats.ts, which also holds the TSC member and organization counts quoted on both pages (verified against upstream MAINTAINERS.md: 11 members across Microsoft 4, Amazon 4, AB InBev 1, Rippling 1, YugabyteDB 1). Values stay hardcoded rather than fetched so the build keeps no network dependency; the refresh command and the date last checked are recorded next to them. Addresses the second half of #128. The create_indexes_background row in the first half is content in documentdb/docs and needs a separate PR there.
1 parent 5b2730f commit c29cb76

3 files changed

Lines changed: 39 additions & 8 deletions

File tree

app/ai/page.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import Image from "next/image";
22
import Link from "next/link";
33
import CommandSnippet from "../components/CommandSnippet";
44
import { getMetadata } from "../services/metadataService";
5+
import {
6+
documentdbGitHubForks,
7+
documentdbGitHubStars,
8+
documentdbTscMembers,
9+
documentdbTscOrganizations,
10+
} from "../services/projectStats";
511
import { withBasePath } from "../services/sitePath";
612

713
export const metadata = getMetadata({
@@ -166,17 +172,17 @@ const useCases = [
166172

167173
const credibilityPoints = [
168174
{
169-
value: "3.4k+",
175+
value: documentdbGitHubStars,
170176
label: "GitHub stars",
171177
},
172178
{
173-
value: "240+",
179+
value: documentdbGitHubForks,
174180
label: "Forks",
175181
},
176182
{
177-
value: "11",
183+
value: documentdbTscMembers,
178184
label: "TSC members",
179-
detail: "across 5 organizations",
185+
detail: `across ${documentdbTscOrganizations} organizations`,
180186
},
181187
];
182188

app/page.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import Link from "next/link";
33
import CommandSnippet from "./components/CommandSnippet";
44
import { documentdbKubernetesOperatorQuickStartUrl } from "./services/externalLinks";
55
import { getMetadata } from "./services/metadataService";
6+
import {
7+
documentdbGitHubForks,
8+
documentdbGitHubStars,
9+
documentdbTscMembers,
10+
documentdbTscOrganizations,
11+
} from "./services/projectStats";
612
import { withBasePath } from "./services/sitePath";
713

814
export const metadata = getMetadata({
@@ -131,19 +137,19 @@ const trustBadges = [
131137

132138
const credibilityPoints = [
133139
{
134-
value: "3.2k+",
140+
value: documentdbGitHubStars,
135141
label: "GitHub stars",
136142
detail: "on documentdb/documentdb",
137143
},
138144
{
139-
value: "200+",
145+
value: documentdbGitHubForks,
140146
label: "Public forks",
141147
detail: "public on GitHub",
142148
},
143149
{
144-
value: "11",
150+
value: documentdbTscMembers,
145151
label: "TSC members",
146-
detail: "representing 5 organizations",
152+
detail: `representing ${documentdbTscOrganizations} organizations`,
147153
},
148154
];
149155

app/services/projectStats.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Single source for the upstream project figures quoted on marketing pages.
2+
// They were previously hardcoded independently on / and /ai, drifted apart,
3+
// and then went stale - a visitor moving between the two pages saw two
4+
// different star counts.
5+
//
6+
// Deliberately not fetched at build time: that would add a network dependency
7+
// (and a rate-limited, unauthenticated one) to every build. Refresh by hand:
8+
//
9+
// curl -s https://api.github.com/repos/documentdb/documentdb \
10+
// | jq '{stars: .stargazers_count, forks: .forks_count}'
11+
//
12+
// Last checked 2026-08-03: 3423 stars, 248 forks.
13+
export const documentdbGitHubStars = '3.4k+';
14+
export const documentdbGitHubForks = '240+';
15+
16+
// From upstream MAINTAINERS.md: 11 members across Microsoft (4), Amazon (4),
17+
// AB InBev (1), Rippling (1), and YugabyteDB (1).
18+
export const documentdbTscMembers = '11';
19+
export const documentdbTscOrganizations = '5';

0 commit comments

Comments
 (0)