Platform ·DarDev Team · 5 min read

DarDev News: SQLite CMS, React home, and static SEO pages

news.dardev.net runs a SQLite CMS in Ops, a React SPA at the home route, and static HTML article pages for SEO—export on publish keeps all three in sync.

Pipeline diagram from Ops editor through SQLite to React home and static article HTML

DarDev News at news.dardev.net combines three delivery layers: SQLite as the editorial source of truth in the integration bus, a React single-page app at the site root for browsing and consent-aware analytics, and static HTML article pages at /article/*.html for SEO and social previews. Publishing from DarDev Ops Mail tab validates content, writes SQLite, auto-exports articles.json, pings IndexNow, and triggers rebuild scripts that keep JSON, React bundle, and static HTML aligned.

This supersedes the merge-draft-only era for editors while preserving git-friendly draft files in dardev-news/content/drafts/ for agent and PR workflows. The news-dardev-architecture article documents the earlier static-plus-sync-worker foundation; this guide covers the dynamic CMS path shipped in Phase 0–3.

Domain split: Ops CMS, bus API, public site

News CMS lives in Domain A DarDev Ops editor. Publish calls Domain B platform bus sync-worker routes under /api/news/articles. Public site nginx serves React from dardev-news/web build output at / with SPA fallback, static SEO HTML under /article/, and proxies /api/news to the worker for live list and article fetch.

  • SQLite file: data/news.db on VPS, NEWS_DB_PATH in worker env
  • Export path: dardev-news/data/articles.json on publish
  • Ops editor: Mail tab News articles panel with block renderer preview
  • React home: dardev-news/web Vite app with react-router
  • SEO pages: build-static-articles.py generates /article/{slug}.html

dogfood-our-own-stack applies—we operate the same Hesabi-era discipline on content: validate before publish, no secrets in articles.json, forms proxy to bus rather than embedding SMTP in static files.

Publish workflow today

Operator edits in Ops or merges validated draft. POST /api/news/articles/{slug}/publish runs validation, sets published flag, exports JSON, runs IndexNow for home and article URL via sync-worker news-indexnow.js. Local full pipeline: bash scripts/news/rebuild-from-sqlite.sh exports, builds static HTML, optional IndexNow. Deploy: wsl bash scripts/deploy-news.sh rsyncs built assets to dardev-vps.

  1. Edit or import draft with .md frontmatter plus .blocks.json body
  2. python scripts/validate-article.py --draft content/drafts/{slug}.md
  3. Publish via Ops or API publish endpoint
  4. Auto-export articles.json for digest and fallback loaders
  5. Rebuild static HTML and React site for nginx
  6. IndexNow notifies search engines of changed URLs

SQLite API surface

GET /api/news/articles lists published articles for React home loadArticles(). GET /api/news/articles/:slug returns single article for loadArticle(slug). POST export and rebuild endpoints support ops automation. Environment variables NEWS_DB_PATH, NEWS_EXPORT_PATH, and optional NEWS_REBUILD_CMD configure paths on VPS versus local dev.

Daily internal digest reads SQLite first with JSON fallback—inside-unified-mailer-stack ties digest send to sync-worker direct SMTP from news@send.dardev.net. Editorial changes in SQLite propagate to staff inbox content without manual JSON copy.

React public site

dardev-news/web/ uses Vite plus React. Routes: home listing and /article/:slug client view. BlockRenderer.tsx renders paragraph, heading, list, code, callout, faq, table, steps, image, and video blocks matching .blocks.json schema used in drafts.

scripts/news/build-react-site.sh outputs to dardev-news/app/ then root index.html plus spa/ assets. nginx dardev-mailer.conf serves React at / with try_files fallback, redirects legacy /app/ to /, and keeps /article/*.html for crawlers that prefer static documents.

Forms, GDPR-style consent banner, and Google Analytics G-7NHVP20B5C ported from legacy assets/js—tracking loads only after consent. Category hubs from site.json drive home sections for Hesabi, Platform, Company, and DarDevOps.

Static SEO layer

React is primary human experience at /. Static HTML remains for link previews, search indexing discipline, and subscribers sharing article URLs that resolve without JavaScript execution. build-static-articles.py reads exported JSON and emits per-slug HTML with meta tags, Open Graph, and JSON-LD where configured.

IndexNow on publish supplements rebuild script sitemap pings—key configured in site.json indexNowKey field without publishing the key value in articles.

Draft and validation pipeline

Agents and writers produce dardev-news/content/drafts/{slug}.md YAML frontmatter plus {slug}.blocks.json typed body. validate-article.py checks word count per contentType, FAQ presence on guides, metaDescription length, solution slug validity, blocked marketing claims such as misaligned Listmonk From on the root domain, and cover image assignment via ensure_cover.

merge-draft-to-json.py remains for bootstrap and CI import; Phase 4 cutover deprecates manual merge for editors in favor of Ops publish only. import_articles_to_sqlite.py ingests JSON batch to SQLite when migrating legacy content.

Scripts reference

  • scripts/news/import_articles_to_sqlite.py — JSON to SQLite
  • scripts/news/export_sqlite_to_json.py — SQLite to JSON
  • scripts/news/rebuild-from-sqlite.sh — export plus static build plus IndexNow
  • scripts/news/build-react-site.sh — Vite production build
  • scripts/validate-article.py — draft gate before merge or import
  • scripts/deploy-news.sh — VPS rsync deploy

Relationship to mail and CRM

Subscribe and contact forms on news site POST to /api/news routes proxied to sync-worker—Listmonk double opt-in and Twenty CRM contact creation per double-opt-in-subscribe-flows and crm-driven-product-lists. News content does not send mail itself; campaigns reference news.dardev.net URLs from send.dardev.net Listmonk templates.

Phase E articles document platform work in the same pipeline—this meta-article included. Redaction rules from DARDEV-NEWS-PHASE-E-PLAN apply: architecture yes, credentials and internal IDs no.

Is the home page still static HTML?

No. React SPA at / loads articles from /api/news/articles API. Static HTML is per-article under /article/*.html for SEO.

Where do editors publish?

DarDev Ops Mail tab News panel preferred. API POST publish works for automation. Git drafts remain for agent batch workflows.

What happens if SQLite and JSON diverge?

Publish and export endpoints rewrite JSON from SQLite—SQLite wins. Rebuild scripts should run after bulk import.

Does React replace merge-draft-to-json.py?

Not fully until Phase 4. Drafts still merge for bootstrap; production editor path is SQLite publish.

How does this link to news-dardev-architecture?

That article describes static JSON plus sync worker forms foundation. This guide adds SQLite CMS, React home, and publish automation on top.

Get company news

Releases and announcements — confirm from your inbox.

Subscribe to updates