Public experience
Published dates expose briefing sections, artifact metadata, and a canonical PDF rundown with text, navigation, sharing, and accessible loading or error states.
Cloudflare publishing platform
A single Cloudflare Worker serves the Vite frontend, public briefing APIs, protected CMS APIs, and private R2 media; D1 stores the dated content and synchronization metadata.
The repository rebuilds the news briefing site and its editorial CMS around one Worker, with content imported from a read-only Google Drive and media kept private.
Published dates expose briefing sections, artifact metadata, and a canonical PDF rundown with text, navigation, sharing, and accessible loading or error states.
Protected administrators edit days and sections, manage artifacts, review Drive sync history, and publish or unpublish content.
Private media lives in R2 and structured records in D1. Generated images, documents, transcripts, and raw source files are not tracked in Git.
The Worker routes browser requests and scheduled work while Vite builds the frontend assets. Admin requests are guarded by Cloudflare Access; Drive sync writes validated drafts and metadata to the storage bindings.
Browser (public or Access-protected admin)
-> Cloudflare Worker (src/worker.ts)
-> Vite assets and public APIs
-> Admin APIs -> Access JWT verification
-> D1 (content, settings, sync history)
-> R2 (private artifacts and media)
<- PDF.js briefing rundown and media responses
Hourly cron -> read-only Google Drive sync -> validated drafts or complete imports
Plain browser DOM code in src/client.ts and src/styles.css, with PDF.js rendering in src/pdf-rundown.ts.
src/worker.ts handles public content, admin CMS operations, uploads, private media delivery, and scheduled synchronization.
D1 (AK_CONTENT) stores days, artifacts, mappings, settings, and sync history; R2 (AK_MEDIA) stores private files with metadata and range-aware delivery.
Implemented behavior is documented from the current source and task checklist. Deployment and live Access verification are intentionally reported as remaining rollout work.
date/slide URL state.Discover YYYY-MM-DD folders and supported infographic-, briefing-, data-, and slides- prefixes; use checksums and idempotent updates.
Private R2 responses support ETags, HEAD, byte ranges, immutable caching, and security headers for public assets.
The root Worker declares an hourly cron (0 * * * *) for Drive synchronization dispatch.
Dependencies and platform bindings are taken from package.json and wrangler.jsonc.
nodejs_compataktuaalnekaamera-contentaktuaalnekaamera-mediaThese are the principal entry points and operational files; TASKS.md references earlier headline-only RAG infrastructure as pending retirement after the root rollout.
| Path | Responsibility |
|---|---|
index.html, src/client.ts, src/styles.css | Vite entry point and public/CMS browser UI. |
src/worker.ts | Request routing, APIs, uploads, media, and scheduled sync. |
src/pdf-rundown.ts | PDF.js rundown rendering and page navigation. |
src/access.ts, src/env.ts | Access authorization and Worker binding definitions. |
src/db.ts, migrations/0001_initial.sql | D1 data access and initial schema. |
src/drive.ts, src/validation.ts | Drive import/export and content/file validation helpers. |
wrangler.jsonc, TASKS.md | Bindings, preview environment, custom domain, cron, and rollout gates. |
test/, .github/workflows/ci.yml | Vitest coverage and CI check/deploy dry-run workflow. |
Drive content is discovered and synchronized as structured records and private artifacts; review mode keeps changes unpublished until an editor verifies them.
Use a dated Drive folder and supported file prefixes.
Read-only service account finds supported files and exports.
Checksums, file formats, and briefing data are checked.
Idempotent D1/R2 updates remain drafts by default.
CMS editor corrects mappings and previews the day.
Publish makes the date and public artifacts available.
Local development uses Vite plus a Wrangler Worker with local D1/R2 emulation. Deployment commands are documented, but the repository does not prove that remote resources or the production domain are currently live.
npm install
npm run db:migrate:local
cp .dev.vars.example .dev.vars
npm run dev:worker # Worker on :8787
npm run dev # Vite on :5173Open http://localhost:5173/admin. Vite proxies /api and /media to the Worker.
npm run lint
npm run typecheck
npm test
npm run build
npm run check
npm run deploy:dryCI runs npm run check and a Wrangler deploy dry run on pushes and pull requests.
ak.kliimask.ee and retire the superseded staging resources.Local-only secret boundary. Keep .dev.vars, real Access values, service-account credentials, private media, and source briefing files out of Git. Never deploy DEV_ADMIN_BYPASS=true.