Skip to content

docs: add ClickHouse analytics blog post#686

Open
berry-13 wants to merge 2 commits into
mainfrom
blog/plausible-clickhouse-migration
Open

docs: add ClickHouse analytics blog post#686
berry-13 wants to merge 2 commits into
mainfrom
blog/plausible-clickhouse-migration

Conversation

@berry-13

Copy link
Copy Markdown
Member

What

Adds a blog post on how the LibreChat website's analytics are built: Plausible for the privacy-friendly front end, ClickHouse as the storage engine underneath, and a walkthrough of the recent move between ClickHouse Cloud clusters.

The post lives at /blog/2026-06-25_clickhouse-analytics and is written first-person to match the existing ZimaCube post.

New components

  • AnalyticsArchitecture — a theme-aware, accessible data-flow diagram (browser → Plausible CE → ClickHouse Cloud, with Postgres and the Core Web Vitals store as satellites). Pure layout, no image asset.
  • SiteStats — an async server component. When PLAUSIBLE_STATS_API_KEY is set it queries the Plausible Stats API v2 at request time (cached one hour) and shows real visitor/pageview/visit numbers. Without the key it renders a dated static snapshot, so local dev, previews, and forks always build. The key stays server-side and never reaches the client.

Both are registered in lib/mdx-components.tsx. A 1200×630 cover image is included.

Enabling live stats (optional)

Env var Required Default Purpose
PLAUSIBLE_STATS_API_KEY for live data none Plausible Stats API key (Bearer). Falls back to the snapshot when unset.
PLAUSIBLE_SITE_ID no librechat.ai Site to query.
PLAUSIBLE_BASE_URL no https://plausible.librechat.ai Plausible instance the API calls hit.

Testing

  • pnpm typecheck and pnpm lint pass.
  • Post renders 200 with both components; verified visually in light and dark mode, plus the cover image at the top of the post.
  • The stats widget was verified on its snapshot fallback path (no API key in dev).

Note

No connection strings, hostnames, IPs, or credentials from the actual migration appear in the post or anywhere in this change.

A first-person post on how librechat.ai's analytics run on Plausible backed by ClickHouse, including the recent cloud-to-cloud cluster move.

Adds two reusable blog components: AnalyticsArchitecture, a theme-aware data-flow diagram, and SiteStats, a server component that reads live numbers from the Plausible Stats API when PLAUSIBLE_STATS_API_KEY is set and falls back to a static snapshot otherwise. Includes the cover image and registers both components in mdx-components.
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
librechat-ai Ready Ready Preview, Comment Jun 29, 2026 4:36pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 826f8383d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread content/blog/2026-06-25_clickhouse-analytics.mdx Outdated
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for librechat.ai

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

…ents

Replace the cluster-migration walkthrough with the part readers actually care about: pointing a LibreChat agent at the ClickHouse data and asking it questions in plain English, the privacy stance behind it, and the ClickHouse partnership tie-in. The migration drops to a single line. Adds a prompts appendix and bumps Plausible to v3.2.1.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for librechat.ai

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant