DataHub: architecture, product assessment, and publishing direction
DataHub: architecture, product assessment, and publishing direction
Date: 21 September 2026. Requested by Rufus. Assessment only: no application changes, content publication, purchases, or production configuration changes.
What matters most
You do not have to use a Git repository to publish to DataHub, including its blog. There is an implemented Go CLI, dh, that uploads a local directory through DataHub's HTTP API. A recent production blog article has no GitHub repository attached. This capability is real, but the documentation and operational contract are incomplete.
The blog is a DataHub publication called blog. An article is a Post within it. The same publishing machinery can put a dataset in core or another publication. GitHub is one input method; it is not the publishing system itself.
My recommended near-term product is: a trusted catalog of useful data, with stories that explain why it matters, direct consumption for people and tools, and straightforward purchasing where the data warrants it. Datopian supplies the content, increasingly with AI. The existing architecture can support this without a rewrite or a separate blog CMS.
For Rufus, the target experience is an explicit command that publishes an already-approved local directory to a chosen publication and returns a verified live URL. Local approval is the editorial gate. A technical upload/validation/finalization step should not introduce another editorial approval.
The main missing pieces are publication permissions, reliable updates, a definition of when publishing has finished, and a small DataPressr packaging step. These matter more immediately than more publisher onboarding, a full editor, or another AI interface.
Scope and evidence
This assessment follows the requested order: current architecture; product and architectural judgment; publishing direction. The companion roadmap gives practical commands and sequenced work.
Evidence reviewed:
- DataHub source at
2f6eb3fonstaging, including CLI, HTTP/tRPC routes, database schema, rendering, Inngest, payment delivery, and tests. Remoteproductionwas3a51ecc; its content matches this staging merge. Actual Vercel deployment settings were not inspected. - Latest fetched DataPressr
main,13152f0, including its agent instructions, publishing/story skills and actual story output. Its working checkout had unrelated Beads changes that blocked pulling, so a separate checkout of the fetched revision was used. Those edits were preserved. - The external content Worker, including
src/worker.jsandsrc/parser.js, read through GitHub. Its production deployment version and queue configuration were not verified. - Public pages on datahub.io and selected read-only calls to its public
post.getAPI. No publishing token, administrative database access, or purchase was used. - Existing product/strategy documents and both Beads and GitHub issue lists. Historical traffic and revenue numbers are context, not verified current results.
The architecture is established from source; selected public behavior is established from live reads. Product priorities below are recommendations, not claims that a strategy was formally adopted. Successful publication of a new directory was not tested during this assessment because publishing content is outside its scope.
1. How the system works today
The basic objects
| Object | Meaning | Example |
|---|---|---|
| User | Identity; can own publications and appear as an author | Rufus, Anu, the DataHub account |
| Publication | Named collection with an owner and public URL | /blog, /core |
| Post | Published item within a publication | /blog/my-story, /core/country-list |
| Blob | A file belonging to a Post, plus metadata and processing status | README.md, a CSV, a chart image |
| Purchase | A paid entitlement and delivery record | Buyer email, Stripe session, download token, private file key |
One Post can contain multiple Markdown pages as well as assets and data. This is a legacy of the application's broader site-publishing origins. For new blog work, one story per Post is the simplest convention.
The schema has DATAPACKAGE and OBSERVABLE post types, but no explicit STORY type. A normal Markdown page without associated datapackage metadata renders as a story. A Markdown page with a datapackage renders with the dataset interface. Observable output is served in an iframe. Consequently, a story can have a DATAPACKAGE enum value without displaying as a dataset. That naming is confusing, but a new type is not a prerequisite for publishing stories.
Architecture at a glance
Next.js is both the website and the application server. Postgres records which content exists, its ownership, metadata, authors, statistics and purchases. R2 stores file bytes. Inngest coordinates GitHub syncing. A separate Cloudflare Worker processes uploaded Markdown and datapackage files, then updates database metadata. The public renderer combines those records with stored content.
This is a single application with managed supporting services, not a static site rebuilt for every article. Publishing content does not require deploying this application repository. Application deployments change the software; content publication changes Post/Blob records and stored files.
Two API styles coexist. The dashboard and public application primarily use tRPC. The CLI uses conventional /api/v1/... HTTP endpoints. This division is reasonable if they share business rules; today some rules differ.
Publishing route A: a local directory
The implemented command is dh publish DIRECTORY --publication SLUG. It:
- Authenticates using a saved CLI credential or environment token.
- Creates or finds the named Post in the requested publication.
- Walks the directory, applying
.datahubignoreand skipping hidden entries. - Registers each file and obtains a temporary upload URL.
- Uploads bytes directly to R2, then prints the page URL.
Markdown/datapackage uploads are subsequently processed by the Worker. Direct uploads bypass GitHub and the Inngest sync workflow, but they do not eliminate background metadata processing.
The current completion message means the file uploads completed. It does not prove that the Worker finished or that the page, images, and metadata all render correctly. There is no commit of a whole publication revision: files and records change individually.
Publishing route B: a GitHub repository or subdirectory
The dashboard can connect a repository, branch and root directory. The CLI can do the same with dh publish --github OWNER/REPO --subdir PATH --publication SLUG.
DataHub creates a Post linked to that source and starts an Inngest sync. Sync resolves a commit, compares file hashes, updates changed files, removes files absent from the source, and invalidates caches. Upload events feed the same Worker used for direct content.
The GitHub-link API tries to install a webhook, but failure is non-fatal. A successful initial sync therefore does not establish that future Git pushes will automatically update the site. Repository permissions, webhook setup and autoSync must be checked.
Adding another folder to a Git repository is also not equivalent to creating another Post. The new story needs a DataHub Post registration pointing to that folder, or a direct upload. A publication lists database Posts, not arbitrary directories discovered in a repository.
How the blog fits
There is no dedicated /blog authoring subsystem in this app. /blog uses the ordinary publication page; /blog/<slug> uses the ordinary Post renderer. Its listing comes from the publication's Posts, not the README index in the separate blog repository.
Live examples from read-only post.get queries:
| Public item | Recorded source | Automatic Git sync |
|---|---|---|
| Recent Keeling Curve story | No repository, branch or root directory; consistent with direct upload | Off; no webhook |
| Older publishing tutorial | datahubio/blog, main, article-specific folder | Off; no webhook |
| Country list dataset | datasets/country-list, main | On; webhook recorded |
| Planetary boundaries dataset | No repository attached | Off |
The recent article also exists in the blog source repository. Its presence there does not mean that repository drives the live page. This is an important source-of-truth distinction: Git can be a backup of directly published content.
For your question, “Can an AI do this from somewhere else?”, the architectural answer is yes. A prepared directory and a valid credential are sufficient inputs. It does not have to run inside datahub-next or inside datahubio/blog.
Authentication, authorship and team access
dh login uses a browser authorization flow tied to a DataHub account. It saves a long-lived CLI token; the database stores its hash. dh logout revokes it. An environment-token route also exists, including a legacy shared administrator token.
GitHub authentication and GitHub content sourcing are separate: you may sign in with GitHub and publish files without putting those files in GitHub.
New account sign-ups are currently rejected by server/auth.ts; existing accounts can sign in. There is no publication-membership model for a team of editors. PostAuthor is attribution, not a permission grant.
There is a concrete authorization gap: the reviewed v1 dataset/file write routes validate tokens but do not check that the caller may modify the target publication. This is code evidence, not a production exploit test. Treat it as a priority fix before expanding automation access. “It accepts a token” is not a sound shared-blog permission model. Rufus's account and intended publication grants have not been verified.
Reading, consuming and buying data
Dataset pages combine narrative, metadata, resource previews, charts and download links. DuckDB runs in the browser for parts of the preview/filter/query experience. Stable /_r/-/... links redirect to stored files; they are useful from scripts and AI tools.
Three different capabilities should not be conflated:
- Raw-file access: fetch metadata and files from stable URLs; implemented.
- Interactive/browser data analysis: previews and DuckDB-based work in the reader's browser; implemented.
- Hosted general query API: the broader “push data, get a cloud DuckDB API” idea in older strategy documents is not established by this code. Queryless is a separate product, reached through links and a
/querylessproxy.
Paid datasets have a real application flow: public sample/metadata, server-resolved pricing, Stripe Checkout, verified payment webhook, a Purchase row, an email and a reusable download link that creates short-lived access to private storage. Refund/dispute handling can revoke access. A purchase points to a stable storage key; overwriting that key delivers updated bytes, not an immutable historical dataset version.
This is one-off data purchasing, not a completed third-party subscription marketplace. Enterprise solutions also have contact/sales journeys. Checkout code and tests were inspected; a real purchase, current prices, paid catalog coverage and fulfillment reliability were not tested here.
Publication subscriptions exist in the schema and API, but the subscribe page is disabled. The homepage newsletter uses a separate Brevo list. No integrated “publish this story and email its publication subscribers” flow was found. Publishing a story does not imply newsletter distribution.
Where the existing overview is misleading
The architecture overview, developer guide, and deployment guide need reconciliation with current code:
- They describe primarily GitHub ingestion and omit the implemented direct-upload/CLI authentication surface.
- The schema now includes CLI credentials and Purchases; the documented domain/API tables omit them.
- The developer guide says the Stripe webhook still needs implementing. Checkout and fulfillment now exist, at different routes from that guide's example.
- The docs name Typesense as a Worker responsibility. No Typesense integration was found in the inspected current Worker or app source. Do not treat it as a verified current dependency.
- Deployment docs name
main; the remote currently hasproductionandstaging, with nomainbranch. Confirm actual Vercel settings before documenting a release procedure. - Several documented routes and signup/subscription behaviors have changed.
This documentation drift is part of the publishing problem: a new teammate or AI can follow plausible instructions that describe an older product.
2. Product vision and architectural assessment
The product I think you should optimize for
“Find trustworthy data, understand what it says, and use or buy it immediately.”
For the internal team, the complementary promise is: “Publish an approved dataset or data story from your existing tools, with a useful URL and dependable updates.”
The older PRODUCT and JOBS describe a Substack-like platform for independent data publishers. The later motivation and February roadmap put more weight on existing traffic, maintained data, conversion and internal publishing. Your current instruction settles the near-term priority in favor of that latter direction.
My judgment is that the defensible asset is the combination of distribution, useful maintained datasets, editorial credibility and delivery. AI makes supplying and consuming that catalog easier. Calling the site an AI platform does not by itself explain why a visitor should trust a dataset or pay for it.
The live homepage currently leads with AI, promotes core datasets and enterprise solutions, and features fixed articles from PortalJS. That spreads attention across several propositions. I would make finding useful data primary, use relevant DataHub stories to explain it, and present AI exploration as a way to use it.
Job stories and how well they are served
These are qualitative assessments of the observed product, not measured conversion scores.
| Job story | Assessment | Main gap |
|---|---|---|
| When I arrive from search, I want to understand coverage, freshness, provenance and suitability so I can decide whether to use the data. | Useful foundation: dataset pages, sources, schema and samples | Quality/freshness vary; actual observation dates should be distinguished from upload dates |
| When I find useful data, I want a stable link or file I can use immediately in my workflow. | Strong foundation: raw links, downloads, schema and previews | Need clear consumption contract, version expectations and reliable failure reporting |
| When I need fuller or maintained data, I want to pay and receive access quickly. | Implemented for configured premium datasets | Actual funnel, coverage, quality and delivery performance need measurement |
| When I have approved a story locally, I want my AI to publish it under my byline without learning the app internals. | Technically possible, operationally weak | Access, packaging, metadata updates and verified readiness |
| When I update a dataset or story, I want the same URL to show a complete, correct new version. | Git sync has file reconciliation; direct upload is weaker | No atomic revision, update contract or rollback |
| When I read a story, I want to reach the underlying data and a relevant next action. | Possible through manual links | No consistent story-to-dataset/offer relationship or measured journey |
| When I run the catalog, I want to know which content produces successful use and revenue. | PostHog, GA imports and purchase events exist | Reconcile measures and connect stories, extraction, purchases and qualified requests |
| When I work with colleagues, I want to publish to shared team destinations with clear permissions. | Owner and author objects exist | Missing contributor grants and inconsistent API authorization |
| When I want updates, I want a clear subscription that actually sends useful information. | Partial, fragmented | Disabled publication UI; separate newsletter capture; no verified post distribution workflow |
What to keep
The core choices are sensible for a small team. Markdown, datapackages and ordinary files are portable and friendly to AI tools. Keeping database metadata separate from large file storage is useful. Direct presigned uploads avoid routing every byte through the web server. GitHub sync remains valuable for established maintained datasets. The shared Post renderer already supports narrative and data; there is no need to build a separate blogging application.
The payment path is further along than the older docs imply. It contains idempotency, retries for delivery email, private storage and revocation behavior. Improve and observe it rather than replace it based on outdated plans.
Managed hosting, database and storage let the team focus on content and customer outcomes. I would keep the current app shape and clarify internal boundaries before considering service splits.
What to improve first
Make publishing a coherent operation. Today record creation, bytes, parsing, Post metadata, cached rendering and listing visibility can disagree. The API even sets file status to SUCCESS before the upload occurs. Give a publish operation a manifest, validation, an identifiable revision and a definite completion result. This is the largest reliability improvement for automation.
Define ownership of metadata. The visible story title can come from Blob frontmatter, while its search title comes from the Post. The direct-create endpoint ignores replacement title/description for existing Posts. Story dates use database creation time; direct file uploads do not advance the Post's modification time. The publication's “Newest” sort uses modification time. These behaviors will confuse an author who expects editing and republishing files to update the whole page consistently.
Fix permission boundaries before broadening token distribution. A publication needs a small, explicit list of permitted internal publishers. This does not require building enterprise organizations and complex roles. Authorship and editing rights should remain separate. The trusted-content boundary also matters because the renderer evaluates MDX. Existing domain-isolation work in #949 is relevant; this assessment is not a full security audit.
Protect the existing distribution asset. The sampled live story returned readable HTML and the correct title, but no canonical link, OG image or Article JSON-LD was found in that response. The source has commented-out canonical and image handling. Existing issues #916–#920 already cover this work. Google's guidance supports using canonical signals for duplicate URLs and Article metadata to describe articles. These are worthwhile improvements, not promises of ranking gains.
An especially relevant policy detail: the apex sitemap currently includes publications owned by the datahub user. The live blog satisfies that; the sampled climate-and-environment publication is owned by Anu. A new personal publication does not automatically receive identical sitemap treatment. This does not prove it cannot be indexed. It means the intended first-party destination should be chosen explicitly, rather than creating a new publication casually and expecting the same promotion.
Connect stories to useful actions. Each story should link to its actual dataset and an appropriate next step: download, explore, buy fuller coverage, or request help. A story does not have to be commercial, but its relationship to the catalog should be clear. Add reciprocal links where useful and give fresh DataHub stories deliberate homepage placement.
Measure outcomes rather than content volume alone. Track time from approved bundle to working URL; failed publishes; story-to-dataset clicks; successful extraction; checkout completion; delivery success; and qualified requests. The raw route currently counts non-preview file requests as downloads, including Markdown/assets and automated callers, before establishing that the target object exists. Those counts are not the same as successful human data use. Treat source freshness, traffic, extraction and revenue as separate measures.
What I would defer
- A full hosted WYSIWYG/editorial CMS and a second approval workflow: your approval already happens locally.
- External publisher onboarding, social-network expansion and paid publication subscriptions until team publishing and customer demand justify them.
- A microservice rewrite or generic hosted data-compute platform. The current failure points are contracts and consistency, not proof that services need splitting.
- Bulk migration of existing content or URL changes to achieve a purer model. Preserve working URLs and improve new writes first.
- A general charting platform. DataPressr's committed SVG charts already travel well with stories; interactive views can remain optional.
3. Publishing direction for Rufus and DataPressr
DataPressr is the preparation and editorial environment: capture sources, structure data, validate, find an argument, produce charts, write prose and obtain local approval. DataHub is the destination: render, distribute, serve files and deliver purchases. The adapter between them should be small enough to understand at a glance.
Use one approved output directory per Post, with a root README.md, explicit target publication and stable slug. A story includes its chart/image assets and does not need a datapackage. A dataset includes a datapackage, its public resources and a root README. Stories can link to datasets in other publications.
DataPressr's current story output is a flat shared folder containing articles, outlines, build scripts and assets. Its current push skill still calls dh push, requires environment variables and assumes dataset resources. It therefore does not implement the desired story-to-blog journey, even though the underlying DataHub server can support it. The actual oil story also records an outstanding author voice pass; it should not be treated as already approved by this assessment.
Three possible approaches:
| Approach | Benefit | Cost / limitation | Recommendation |
|---|---|---|---|
| Package an approved local directory and use the existing CLI/API | Matches your working style; no content Git dependency; reuses live capabilities | Needs small adapter and targeted publishing fixes | Default |
| Keep stories in Git and register each story directory for syncing | Useful history and review; works for existing Git-managed content | Repo access, registration and working webhook required; indirect for local approval | Keep as optional route |
| Add a standalone blog CMS or publisher platform | Could suit a larger editorial team later | New source of truth, integration and migration work | Defer |
The first practical milestone should be an existing-account teammate publishing one approved Markdown-plus-SVG story to blog, and one dataset to another explicitly permitted publication, from outside this app repository. Measure time and document every manual intervention. Do not turn that into a requirement for a large new platform before the first useful trial.
For reliable routine use, complete the permission, metadata and publish-finalization work in the roadmap. The user-facing command remains simple; the server takes responsibility for making its success message trustworthy.
Follow-up and source map
Assessment tracking: datahub-next-ckx. Follow-up epic: datahub-next-cyz, with six scoped tasks covering permissions, metadata/update semantics, complete revisions, DataPressr integration, a measured content pilot and current operator documentation. No implementation task is marked complete by this assessment.
| Evidence area | Files |
|---|---|
| Identity and domain model | prisma/schema.prisma, server/auth.ts, lib/cli-auth.ts |
| CLI behavior and installation | cli/cmd/publish.go, cli/cmd/root.go, cli/cmd/config.go, cli/README.md, .github/workflows/cli-release.yml |
| Direct writes and permission gap | app/api/v1/_auth.ts, app/api/v1/publications/[slug]/datasets/ |
| Git sync and metadata seeding | inngest/functions.ts, inngest/sync-helpers.ts, lib/extract-post-metadata.ts, app/api/webhook/route.ts |
| Story/dataset rendering | app/[publication]/[post]/[[...slug]]/page.tsx, components/MDX.tsx, server/api/routers/post.ts |
| Listing and dates | server/api/routers/publication.ts, lib/publication-sort.ts |
| SEO and content policy | app/[publication]/[post]/layout.tsx, app/sitemap.ts, app/robots.ts |
| Raw access and analytics | app/api/raw/[publication]/[post]/[branch]/[[...path]]/route.tsx, lib/tracking.ts, lib/tracking-server.ts |
| Commerce | server/api/routers/premium.ts, app/api/webhook/stripe/route.ts, app/download/[token]/route.ts, lib/premium-store.ts |
| Newsletter and subscriptions | lib/front/actions.ts, server/api/routers/subscription.ts, app/[publication]/subscribe/page.tsx |
| DataPressr integration | Latest DataPressr AGENTS.md, skills/push/SKILL.md, skills/story/SKILL.md, site/stories/ |
Remaining unknowns for implementation are operational facts: Rufus's existing DataHub account and public byline, the intended ownership/grants for additional publications, actual deployment settings and Worker queue wiring, and current traffic/revenue/delivery baselines. They do not prevent this assessment or change the recommended starting point.