Newsletter Infrastructure

The system behind draft, review, and owned publishing.

The newsletter workflow combines local static pages, Firestore source queues, OpenAI-generated drafts, and review-before-publish tooling.

The Problem: publishing should not depend on memory and manual copy-paste.

Owned archive

`assets/newsletter-issues.json` is the site-owned source for every public issue.

Draft queue

The draft generator reads queued `newsletter_sources` documents from Firestore and stores reviewable drafts.

Publishing gate

Only approved drafts are written into the public archive.

The Current Build

Local scripts

`generate:newsletter` creates drafts and `publish:newsletter` writes approved issues to the owned archive.

Firebase function

`generateScheduledNewsletterDraft` uses scheduled execution, OpenAI, and Firestore collections for source and draft state.

First-party archive

The website serves every issue and image from its own repository and domain.

Development Timeline

Issue archive

Publish each newsletter issue on the owned domain.

Asset migration

Keep historical issue images in the repository instead of on an external host.

Draft worker

Generate reviewable drafts from queued Firestore source documents.

Publish path

Write approved drafts into the local archive with a gated script.